{"id":2433,"date":"2012-11-02T13:55:40","date_gmt":"2012-11-02T04:55:40","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=2433"},"modified":"2013-01-30T17:03:02","modified_gmt":"2013-01-30T08:03:02","slug":"javascript-api-for-officemicrosoft-translator-api%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%a6%e9%81%b8%e6%8a%9e%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e7%bf%bb%e8%a8%b3%e3%81%99%e3%82%8b%e3%82%af","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=2433","title":{"rendered":"[Office\u7528\u30a2\u30d7\u30ea]Microsoft Translator API\u3092\u5229\u7528\u3057\u3066\u9078\u629e\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3059\u308b(\u30af\u30ed\u30b9\u30c9\u30e1\u30a4\u30f3\u5bfe\u5fdc)\u3002"},"content":{"rendered":"<p>\u300c<a href=\"\/\/www.ka-net.org\/blog\/?p=2142\" title=\"[JavaScript API for Office]Microsoft Translator API\u3092\u5229\u7528\u3057\u3066\u9078\u629e\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3059\u308b\u3002\" target=\"_blank\">[JavaScript API for Office]Microsoft Translator API\u3092\u5229\u7528\u3057\u3066\u9078\u629e\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3059\u308b\u3002<\/a>\u300d\u3067\u3001Microsoft Translator API\u3092\u6d3b\u7528\u3057\u305f\u7ffb\u8a33\u30a2\u30d7\u30ea\u306b\u3064\u3044\u3066\u8a18\u4e8b\u3092\u66f8\u304d\u307e\u3057\u305f\u304c\u3001Word 2013 RTM\u3067\u6539\u3081\u3066\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u52d5\u4f5c\u3057\u306a\u304f\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><!--more--><br \/>\nOAuth\u8a8d\u8a3c\u90e8\u5206\u3067\u8e93\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u3069\u3046\u3084\u3089\u30af\u30ed\u30b9\u30c9\u30e1\u30a4\u30f3\u5236\u7d04\u306b\u5f15\u3063\u639b\u304b\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059(\u524d\u56de\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u3068\u304d\u306b\u306f\u554f\u984c\u306a\u304b\u3063\u305f\u306e\u3067\u3001IE\u3084Office\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u539f\u56e0\uff1f)\u3002<\/p>\n<p>\u5bfe\u51e6\u6cd5\u3068\u3057\u3066\u300c<a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/office\/fp142230%28v=office.15%29.aspx\" title=\"Office \u7528\u30a2\u30d7\u30ea\u306e\u958b\u767a\u306e\u30d9\u30b9\u30c8 \u30d7\u30e9\u30af\u30c6\u30a3\u30b9\" target=\"_blank\">Office \u7528\u30a2\u30d7\u30ea\u306e\u958b\u767a\u306e\u30d9\u30b9\u30c8 \u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>\u300d\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u901a\u308a\u3001\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306bAppDomain\u8981\u7d20\u3092\u8ffd\u52a0\u3057\u3066\u307f\u305f\u306e\u3067\u3059\u304c\u3001<\/p>\n<blockquote><p>\u8907\u6570\u306e\u30c9\u30e1\u30a4\u30f3\u306b\u307e\u305f\u304c\u308b\u30d6\u30e9\u30a6\u30ba<\/p>\n<p>\u53ef\u80fd\u3067\u3042\u308c\u3070\u3001\u8907\u6570\u306e\u30c9\u30e1\u30a4\u30f3\u306b\u307e\u305f\u304c\u308b\u30d6\u30e9\u30a6\u30ba\u306f\u907f\u3051\u307e\u3059\u3002oAuth \u3092\u4f7f\u7528\u3057\u3066\u3042\u308b\u30b5\u30a4\u30c8\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u5225\u306e\u30c9\u30e1\u30a4\u30f3\u306e\u5225\u306e\u30b5\u30a4\u30c8\u3068\u5171\u6709\u3059\u308b\u5834\u5408\u306a\u3069\u3001\u3053\u308c\u304c\u5fc5\u8981\u306a\u30b7\u30ca\u30ea\u30aa\u3067\u306f\u3001\u30a2\u30d7\u30ea\u306e\u30de\u30cb\u30d5\u30a7\u30b9\u30c8 \u30d5\u30a1\u30a4\u30eb\u3067 AppDomains \u8981\u7d20\u3068 AppDomain \u8981\u7d20\u3092\u4f7f\u7528\u3057\u3066\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p><\/blockquote>\n<p><a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/office\/fp142230%28v=office.15%29.aspx\" title=\"Office \u7528\u30a2\u30d7\u30ea\u306e\u958b\u767a\u306e\u30d9\u30b9\u30c8 \u30d7\u30e9\u30af\u30c6\u30a3\u30b9\" target=\"_blank\">Office \u7528\u30a2\u30d7\u30ea\u306e\u958b\u767a\u306e\u30d9\u30b9\u30c8 \u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a> \u3088\u308a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;OfficeApp xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/appforoffice\/1.0&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:type=&quot;TaskPaneApp&quot;&gt;\r\n  &lt;Id&gt;90a23a95-9db7-445c-9c71-faaccfe114bb&lt;\/Id&gt;\r\n  &lt;Version&gt;1.0&lt;\/Version&gt;\r\n  &lt;ProviderName&gt;\u304d\u306c\u3042\u3055&lt;\/ProviderName&gt;\r\n  &lt;DefaultLocale&gt;ja-JP&lt;\/DefaultLocale&gt;\r\n  &lt;DisplayName DefaultValue=&quot;\u7ffb\u8a33\u30a2\u30d7\u30ea2&quot; \/&gt;\r\n  &lt;Description DefaultValue=&quot;Microsoft Translator API\u3092\u5229\u7528\u3057\u3066\u9078\u629e\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3057\u307e\u3059\u3002&quot;\/&gt;\r\n  &lt;IconUrl DefaultValue=&quot;http:\/\/officeimg.vo.msecnd.net\/_layouts\/images\/general\/office_logo.jpg&quot; \/&gt;\r\n  &lt;AppDomains&gt;\r\n    &lt;AppDomain&gt;https:\/\/datamarket.accesscontrol.windows.net&lt;\/AppDomain&gt;\r\n    &lt;AppDomain&gt;http:\/\/api.microsofttranslator.com&lt;\/AppDomain&gt;\r\n  &lt;\/AppDomains&gt;\r\n  &lt;Capabilities&gt;\r\n    &lt;Capability Name=&quot;Document&quot; \/&gt;\r\n    &lt;Capability Name=&quot;Workbook&quot; \/&gt;\r\n  &lt;\/Capabilities&gt;\r\n  &lt;DefaultSettings&gt;\r\n    &lt;SourceLocation DefaultValue=&quot;http:\/\/localhost\/apps\/MSTranslator2.html&quot; \/&gt;\r\n  &lt;\/DefaultSettings&gt;\r\n  &lt;Permissions&gt;ReadWriteDocument&lt;\/Permissions&gt;\r\n&lt;\/OfficeApp&gt;<\/pre>\n<p>\u7d50\u679c\u306f\u5909\u308f\u3089\u305aOAuth\u8a8d\u8a3c\u304c\u4e0a\u624b\u304f\u3044\u304d\u307e\u305b\u3093\u3002<br \/>\n\u4ed5\u65b9\u304c\u306a\u3044\u306e\u3067OAuth\u8a8d\u8a3c\u90e8\u5206\u3092PHP\u306b\u4efb\u305b\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u30fbMSTranslator.xml(\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb)<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;OfficeApp xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/appforoffice\/1.0&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:type=&quot;TaskPaneApp&quot;&gt;\r\n  &lt;Id&gt;26b8c84d-8891-4ca3-8b5f-189da663cfa7&lt;\/Id&gt;\r\n  &lt;Version&gt;1.0&lt;\/Version&gt;\r\n  &lt;ProviderName&gt;\u304d\u306c\u3042\u3055&lt;\/ProviderName&gt;\r\n  &lt;DefaultLocale&gt;ja-JP&lt;\/DefaultLocale&gt;\r\n  &lt;DisplayName DefaultValue=&quot;\u7ffb\u8a33\u30a2\u30d7\u30ea&quot; \/&gt;\r\n  &lt;Description DefaultValue=&quot;Microsoft Translator API\u3092\u5229\u7528\u3057\u3066\u9078\u629e\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3057\u307e\u3059\u3002&quot;\/&gt;\r\n  &lt;IconUrl DefaultValue=&quot;http:\/\/officeimg.vo.msecnd.net\/_layouts\/images\/general\/office_logo.jpg&quot; \/&gt;\r\n  &lt;Capabilities&gt;\r\n    &lt;Capability Name=&quot;Document&quot; \/&gt;\r\n    &lt;Capability Name=&quot;Workbook&quot; \/&gt;\r\n  &lt;\/Capabilities&gt;\r\n  &lt;AppDomains&gt;\r\n    &lt;AppDomain&gt;https:\/\/datamarket.accesscontrol.windows.net&lt;\/AppDomain&gt;\r\n    &lt;AppDomain&gt;http:\/\/api.microsofttranslator.com&lt;\/AppDomain&gt;\r\n  &lt;\/AppDomains&gt;\r\n  &lt;DefaultSettings&gt;\r\n    &lt;SourceLocation DefaultValue=&quot;http:\/\/localhost\/apps\/MSTranslator.html&quot; \/&gt;\r\n  &lt;\/DefaultSettings&gt;\r\n  &lt;Permissions&gt;ReadWriteDocument&lt;\/Permissions&gt;\r\n&lt;\/OfficeApp&gt;\r\n<\/pre>\n<p><strong>\u30fbMSTranslator.html<\/strong><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n        &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=Edge&quot;&gt;\r\n        &lt;script src=&quot;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.7.2\/jquery.min.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script src=&quot;https:\/\/az88874.vo.msecnd.net\/api\/1.0\/office.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script&gt;\r\n            var target;\r\n            Office.initialize = function (reason) {\r\n                $(document).ready(function () {\r\n                    Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, document_SelectionChange);\r\n                });\r\n            }\r\n            function document_SelectionChange(eventArgs) {\r\n                if ($(&quot;#action&quot;).attr(&quot;checked&quot;)) {\r\n                    eventArgs.document.getSelectedDataAsync(Office.CoercionType.Text, function(asyncResult) {\r\n                        if (asyncResult.status != Office.AsyncResultStatus.Failed) {\r\n                            target = asyncResult.value;\r\n                            execTranslate();\r\n                        }\r\n                    });\r\n                }\r\n            }\r\n            \r\n            $(function(){\r\n                $(&quot;#result&quot;).click(\r\n                    function() {\r\n                        this.focus();\r\n                        this.select();\r\n                        clipboardData.setData(&quot;text&quot;, this.value);\r\n                    }\r\n                );\r\n                \r\n                $(&quot;#fromLng&quot;).change(function() {\r\n                    if ($(&quot;#action&quot;).attr(&quot;checked&quot;)) {\r\n                        execTranslate();\r\n                    }\r\n                });\r\n                \r\n                $(&quot;#toLng&quot;).change(function() {\r\n                    if ($(&quot;#action&quot;).attr(&quot;checked&quot;)) {\r\n                        execTranslate();\r\n                    }\r\n                });\r\n            });\r\n            \r\n            function execTranslate() {\r\n                if (target) {\r\n                    fncTranslate($(&quot;#fromLng&quot;).val(), $(&quot;#toLng&quot;).val(), target);\r\n                }\r\n            }\r\n            \r\n            function fncTranslate(fromLng, toLng, str) {\r\n                $(&quot;#result&quot;).val(&quot;\u305f\u3060\u3044\u307e\u51e6\u7406\u4e2d\u3067\u3059\u3002&quot;);\r\n                $.getJSON(\r\n                    &quot;oauth.php&quot;,\r\n                    function(data, status) {\r\n                        var ah = &quot;Bearer &quot; + data.access_token;\r\n                        $.ajax({\r\n                            type: &quot;GET&quot;,\r\n                            url: &quot;http:\/\/api.microsofttranslator.com\/V2\/Ajax.svc\/Translate&quot;,\r\n                            dataType: &quot;jsonp&quot;,\r\n                            data: {\r\n                                appId: ah,\r\n                                text: str,\r\n                                from: fromLng,\r\n                                to: toLng\r\n                            },\r\n                            jsonp: &quot;oncomplete&quot;,\r\n                            success: function(data, dataType){\r\n                                $(&quot;#result&quot;).val(data);\r\n                            },\r\n                            error: function() {\r\n                                $(&quot;#result&quot;).val(&quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot;);\r\n                            }\r\n                        });\r\n                    }\r\n                );\r\n            }\r\n        &lt;\/script&gt;\r\n        &lt;style&gt;\r\n            body {\r\n                font-family:Arial,sans-serif;\r\n                font-size:0.9em;\r\n            }\r\n            select,textarea {width:100%}\r\n        &lt;\/style&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;input id=&quot;action&quot; type=&quot;checkbox&quot; title=&quot;\u30c1\u30a7\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306e\u307f\u7ffb\u8a33\u304c\u884c\u308f\u308c\u307e\u3059\u3002&quot;&gt;\u52d5\u4f5c\r\n        &lt;table&gt;\r\n            &lt;tr&gt;\r\n                &lt;td&gt;\u7ffb\u8a33\u5143\u8a00\u8a9e:&lt;\/td&gt;\r\n                &lt;td&gt;\r\n                    &lt;select id=&quot;fromLng&quot; title=&quot;\u7ffb\u8a33\u5143\u8a00\u8a9e&quot;&gt;\r\n                        &lt;option value=&quot;&quot; selected&gt;\u81ea\u52d5\u691c\u51fa&lt;\/option&gt;\r\n                        &lt;option value=&quot;ar&quot;&gt;\u30a2\u30e9\u30d3\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;bg&quot;&gt;\u30d6\u30eb\u30ac\u30ea\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ca&quot;&gt;\u30ab\u30bf\u30ed\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;zh-CHS&quot;&gt;\u7c21\u4f53\u5b57\u4e2d\u56fd\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;zh-CHT&quot;&gt;\u7e41\u4f53\u5b57\u4e2d\u56fd\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;cs&quot;&gt;\u30c1\u30a7\u30b3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;da&quot;&gt;\u30c7\u30f3\u30de\u30fc\u30af\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;nl&quot;&gt;\u30aa\u30e9\u30f3\u30c0\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;en&quot;&gt;\u82f1\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;et&quot;&gt;\u30a8\u30b9\u30c8\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;fi&quot;&gt;\u30d5\u30a3\u30f3\u30e9\u30f3\u30c9\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;fr&quot;&gt;\u30d5\u30e9\u30f3\u30b9\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;de&quot;&gt;\u30c9\u30a4\u30c4\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;el&quot;&gt;\u30ae\u30ea\u30b7\u30e3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ht&quot;&gt;\u30cf\u30a4\u30c1\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;he&quot;&gt;\u30d8\u30d6\u30e9\u30a4\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;hi&quot;&gt;\u30d2\u30f3\u30c7\u30a3\u30fc\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;mww&quot;&gt;Hmong Daw&lt;\/option&gt;\r\n                        &lt;option value=&quot;hu&quot;&gt;\u30cf\u30f3\u30ac\u30ea\u30fc\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;id&quot;&gt;\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;it&quot;&gt;\u30a4\u30bf\u30ea\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ja&quot;&gt;\u65e5\u672c\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ko&quot;&gt;\u97d3\u56fd\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;lv&quot;&gt;\u30e9\u30c8\u30d3\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;lt&quot;&gt;\u30ea\u30c8\u30a2\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;no&quot;&gt;\u30ce\u30eb\u30a6\u30a7\u30fc\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;fa&quot;&gt;\u30da\u30eb\u30b7\u30e3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;pl&quot;&gt;\u30dd\u30fc\u30e9\u30f3\u30c9\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;pt&quot;&gt;\u30dd\u30eb\u30c8\u30ac\u30eb\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ro&quot;&gt;\u30eb\u30fc\u30de\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ru&quot;&gt;\u30ed\u30b7\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;sk&quot;&gt;\u30b9\u30ed\u30d0\u30ad\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;sl&quot;&gt;\u30b9\u30ed\u30d9\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;es&quot;&gt;\u30b9\u30da\u30a4\u30f3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;sv&quot;&gt;\u30b9\u30a6\u30a7\u30fc\u30c7\u30f3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;th&quot;&gt;\u30bf\u30a4\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;tr&quot;&gt;\u30c8\u30eb\u30b3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;uk&quot;&gt;\u30a6\u30af\u30e9\u30a4\u30ca\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;vi&quot;&gt;\u30d9\u30c8\u30ca\u30e0\u8a9e&lt;\/option&gt;\r\n                    &lt;\/select&gt;\r\n                &lt;\/td&gt;\r\n            &lt;\/tr&gt;\r\n            &lt;tr&gt;\r\n                &lt;td&gt;\u7ffb\u8a33\u5148\u8a00\u8a9e:&lt;\/td&gt;\r\n                &lt;td&gt;\r\n                    &lt;select id=&quot;toLng&quot; title=&quot;\u7ffb\u8a33\u5148\u8a00\u8a9e&quot;&gt;\r\n                        &lt;option value=&quot;ar&quot;&gt;\u30a2\u30e9\u30d3\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;bg&quot;&gt;\u30d6\u30eb\u30ac\u30ea\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ca&quot;&gt;\u30ab\u30bf\u30ed\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;zh-CHS&quot;&gt;\u7c21\u4f53\u5b57\u4e2d\u56fd\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;zh-CHT&quot;&gt;\u7e41\u4f53\u5b57\u4e2d\u56fd\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;cs&quot;&gt;\u30c1\u30a7\u30b3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;da&quot;&gt;\u30c7\u30f3\u30de\u30fc\u30af\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;nl&quot;&gt;\u30aa\u30e9\u30f3\u30c0\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;en&quot; selected&gt;\u82f1\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;et&quot;&gt;\u30a8\u30b9\u30c8\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;fi&quot;&gt;\u30d5\u30a3\u30f3\u30e9\u30f3\u30c9\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;fr&quot;&gt;\u30d5\u30e9\u30f3\u30b9\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;de&quot;&gt;\u30c9\u30a4\u30c4\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;el&quot;&gt;\u30ae\u30ea\u30b7\u30e3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ht&quot;&gt;\u30cf\u30a4\u30c1\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;he&quot;&gt;\u30d8\u30d6\u30e9\u30a4\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;hi&quot;&gt;\u30d2\u30f3\u30c7\u30a3\u30fc\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;mww&quot;&gt;Hmong Daw&lt;\/option&gt;\r\n                        &lt;option value=&quot;hu&quot;&gt;\u30cf\u30f3\u30ac\u30ea\u30fc\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;id&quot;&gt;\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;it&quot;&gt;\u30a4\u30bf\u30ea\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ja&quot;&gt;\u65e5\u672c\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ko&quot;&gt;\u97d3\u56fd\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;lv&quot;&gt;\u30e9\u30c8\u30d3\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;lt&quot;&gt;\u30ea\u30c8\u30a2\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;no&quot;&gt;\u30ce\u30eb\u30a6\u30a7\u30fc\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;fa&quot;&gt;\u30da\u30eb\u30b7\u30e3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;pl&quot;&gt;\u30dd\u30fc\u30e9\u30f3\u30c9\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;pt&quot;&gt;\u30dd\u30eb\u30c8\u30ac\u30eb\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ro&quot;&gt;\u30eb\u30fc\u30de\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;ru&quot;&gt;\u30ed\u30b7\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;sk&quot;&gt;\u30b9\u30ed\u30d0\u30ad\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;sl&quot;&gt;\u30b9\u30ed\u30d9\u30cb\u30a2\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;es&quot;&gt;\u30b9\u30da\u30a4\u30f3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;sv&quot;&gt;\u30b9\u30a6\u30a7\u30fc\u30c7\u30f3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;th&quot;&gt;\u30bf\u30a4\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;tr&quot;&gt;\u30c8\u30eb\u30b3\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;uk&quot;&gt;\u30a6\u30af\u30e9\u30a4\u30ca\u8a9e&lt;\/option&gt;\r\n                        &lt;option value=&quot;vi&quot;&gt;\u30d9\u30c8\u30ca\u30e0\u8a9e&lt;\/option&gt;\r\n                    &lt;\/select&gt;\r\n                &lt;\/td&gt;\r\n            &lt;\/tr&gt;\r\n        &lt;\/table&gt;\r\n        &lt;textarea id=&quot;result&quot; title=&quot;\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u5185\u5bb9\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002&quot; rows=&quot;15&quot;&gt;\u3053\u3053\u306b\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002&lt;\/textarea&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p><strong>\u30fboauth.php<\/strong><\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;?php\r\n    \/\/********** \u8981\u5909\u66f4 **********\r\n    $client_id = &quot;**********&quot;; \/\/\u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID\r\n    $client_secret = &quot;******&quot;; \/\/\u9867\u5ba2\u306e\u79d8\u5bc6\r\n    \/\/****************************\r\n    \r\n    $url = &quot;https:\/\/datamarket.accesscontrol.windows.net\/v2\/OAuth2-13&quot;;\r\n    $scope = &quot;http:\/\/api.microsofttranslator.com&quot;;\r\n    $grant_type = &quot;client_credentials&quot;;\r\n    \r\n    $ary = array (\r\n        &quot;grant_type&quot;    =&gt; $grant_type,\r\n        &quot;scope&quot;         =&gt; $scope,\r\n        &quot;client_id&quot;     =&gt; $client_id,\r\n        &quot;client_secret&quot; =&gt; $client_secret\r\n    );\r\n    $ary = http_build_query($ary, &quot;&quot;, &quot;&amp;&quot;);\r\n    $opt = array (\r\n        CURLOPT_URL            =&gt; $url,\r\n        CURLOPT_POST           =&gt; TRUE,\r\n        CURLOPT_POSTFIELDS     =&gt; $ary,\r\n        CURLOPT_RETURNTRANSFER =&gt; TRUE,\r\n        CURLOPT_SSL_VERIFYPEER =&gt; FALSE\r\n    );\r\n    $ch = curl_init();\r\n    curl_setopt_array($ch, $opt);\r\n    $res = curl_exec($ch);\r\n    curl_close($ch);\r\n    \r\n    \/\/json\u3068\u3057\u3066\u51fa\u529b\r\n    header(&quot;Content-Type: text\/javascript; charset=utf-8&quot;);\r\n    print $res;\r\n?&gt;<\/pre>\n<p>\u4eca\u5ea6\u306f\u4e0a\u624b\u304f\u3044\u304d\u307e\u3057\u305f\u3002<br \/>\n\u30a2\u30d7\u30ea\u306e\u52d5\u4f5c\u304c\u8907\u6570\u306e\u30c9\u30e1\u30a4\u30f3\u9593\u306b\u8de8\u308b\u5834\u5408\u306f\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306a\u30d7\u30ed\u30ad\u30b7\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5229\u7528\u3082\u6709\u52b9\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u300c[JavaScript API for Office]Microsoft Translator API\u3092\u5229\u7528\u3057\u3066\u9078\u629e\u6587\u5b57\u5217\u3092\u7ffb\u8a33\u3059\u308b\u3002\u300d\u3067\u3001Microsoft Translator API\u3092\u6d3b\u7528\u3057\u305f\u7ffb\u8a33\u30a2\u30d7\u30ea\u306b\u3064\u3044\u3066\u8a18 [&hellip;]","protected":false},"author":1,"featured_media":7119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[130,4,79],"tags":[74,77],"class_list":["post-2433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apps-for-office","category-office","category-office2013","tag-office-2013","tag-apps-for-office"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-OfficeAddins.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-Df","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2433"}],"version-history":[{"count":6,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2433\/revisions"}],"predecessor-version":[{"id":2660,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2433\/revisions\/2660"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7119"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}