OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "i18n", | 7 "namespace": "i18n", |
8 "description": "Use the <code>chrome.i18n</code> infrastructure to implement
internationalization across your whole app or extension.", | 8 "description": "Use the <code>chrome.i18n</code> infrastructure to implement
internationalization across your whole app or extension.", |
9 "types": [], | 9 "types": [], |
10 "functions": [ | 10 "functions": [ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 { | 48 { |
49 "name": "getUILanguage", | 49 "name": "getUILanguage", |
50 "type": "function", | 50 "type": "function", |
51 "nocompile": true, | 51 "nocompile": true, |
52 "description": "Gets the browser UI language of the browser. This is dif
ferent from $(ref:i18n.getAcceptLanguages) which returns the preferred user lang
uages.", | 52 "description": "Gets the browser UI language of the browser. This is dif
ferent from $(ref:i18n.getAcceptLanguages) which returns the preferred user lang
uages.", |
53 "parameters": [], | 53 "parameters": [], |
54 "returns": { | 54 "returns": { |
55 "type": "string", | 55 "type": "string", |
56 "description": "The browser UI language code such as en-US or fr-FR." | 56 "description": "The browser UI language code such as en-US or fr-FR." |
57 } | 57 } |
| 58 }, |
| 59 { |
| 60 "name": "detectLanguage", |
| 61 "type": "function", |
| 62 "description": "Detects the language of the provided text using CLD.", |
| 63 "parameters": [ |
| 64 { |
| 65 "type": "string", |
| 66 "name": "text", |
| 67 "minimum": 0, |
| 68 "optional": true, |
| 69 "description": "Defaults to the null string." |
| 70 }, |
| 71 { |
| 72 "type": "function", |
| 73 "name": "callback", |
| 74 "parameters": [ |
| 75 { |
| 76 "type": "object", |
| 77 "name": "result", |
| 78 "description": "LanguageDetectionResult object that holds detect
ed langugae reliability and array of DetectedLanguage", |
| 79 "properties": { |
| 80 "is_reliable": { "type": "boolean", "description": "CLD detect
ed language reliability" }, |
| 81 "languages": |
| 82 { |
| 83 "type": "array", |
| 84 "description": "array of detectedLanguage", |
| 85 "items": |
| 86 { |
| 87 "type": "object", |
| 88 "description": "DetectedLanguage object that holds det
ected ISO language code and its percentage in the input string", |
| 89 "properties": |
| 90 { |
| 91 "language": { "type": "string", "description": "An
ISO language code such as <code>en</code> or <code>fr</code>. For a complete li
st of languages supported by this method, see <a href='http://src.chromium.org/v
iewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc'>kLanguag
eInfoTable</a>. The 2nd to 4th columns will be checked and the first non-NULL va
lue will be returned except for Simplified Chinese for which zh-CN will be retur
ned. For an unknown language, <code>und</code> will be returned." }, |
| 92 "percentage": { "type": "integer", "description":
"The percentage of the detected language" } |
| 93 } |
| 94 } |
| 95 } |
| 96 } |
| 97 } |
| 98 ] |
| 99 } |
| 100 ] |
58 } | 101 } |
59 ], | 102 ], |
60 "events": [] | 103 "events": [] |
61 } | 104 } |
62 ] | 105 ] |
OLD | NEW |