| Index: chrome/common/extensions/api/i18n.json
|
| diff --git a/chrome/common/extensions/api/i18n.json b/chrome/common/extensions/api/i18n.json
|
| index d29c0e69cf8f6fc22fe67ff30a1f4e0be939f666..26ffe2d3ed8b599fe33c8d2f3fb2b402e936eca4 100644
|
| --- a/chrome/common/extensions/api/i18n.json
|
| +++ b/chrome/common/extensions/api/i18n.json
|
| @@ -55,6 +55,49 @@
|
| "type": "string",
|
| "description": "The browser UI language code such as en-US or fr-FR."
|
| }
|
| + },
|
| + {
|
| + "name": "detectLanguage",
|
| + "type": "function",
|
| + "description": "Detects the language of the provided text using CLD.",
|
| + "parameters": [
|
| + {
|
| + "type": "string",
|
| + "name": "text",
|
| + "minimum": 0,
|
| + "optional": true,
|
| + "description": "Defaults to the null string."
|
| + },
|
| + {
|
| + "type": "function",
|
| + "name": "callback",
|
| + "parameters": [
|
| + {
|
| + "type": "object",
|
| + "name": "result",
|
| + "description": "LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage",
|
| + "properties": {
|
| + "is_reliable": { "type": "boolean", "description": "CLD detected language reliability" },
|
| + "languages":
|
| + {
|
| + "type": "array",
|
| + "description": "array of detectedLanguage",
|
| + "items":
|
| + {
|
| + "type": "object",
|
| + "description": "DetectedLanguage object that holds detected ISO language code and its percentage in the input string",
|
| + "properties":
|
| + {
|
| + "language": { "type": "string", "description": "An ISO language code such as <code>en</code> or <code>fr</code>. For a complete list of languages supported by this method, see <a href='http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc'>kLanguageInfoTable</a>. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, <code>und</code> will be returned." },
|
| + "percentage": { "type": "integer", "description": "The percentage of the detected language" }
|
| + }
|
| + }
|
| + }
|
| + }
|
| + }
|
| + ]
|
| + }
|
| + ]
|
| }
|
| ],
|
| "events": []
|
|
|