summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/i18n.json
blob: 510256ce2a99d4c33233eb4878f3886a1fc9c78e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "i18n",
    "description": "Use the <code>chrome.i18n</code> infrastructure to implement internationalization across your whole app or extension.",
    "types": [],
    "functions": [
      {
        "name": "getAcceptLanguages",
        "type": "function",
        "description": "Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use <code>window.navigator.language</code>.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "languages", "type": "array", "items": {"type": "string"}, "description": "Array of the accept languages of the browser, such as en-US,en,zh-CN"}
            ]
          }
        ]
      },
      {
        "name": "getMessage",
        "nocompile": true,
        "type": "function",
        "description": "Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the <code>getMessage()</code> call is wrong &mdash; for example, <em>messageName</em> is not a string or the <em>substitutions</em> array has more than 9 elements &mdash; this method returns <code>undefined</code>.",
        "parameters": [
          {
            "type": "string",
            "name": "messageName",
            "description": "The name of the message, as specified in the <a href='i18n-messages.html'><code>messages.json</code></a> file."
          },
          {
            "type": "any",
            "name": "substitutions",
            "optional": true,
            "description": "Up to 9 substitution strings, if the message requires any."
          }
        ],
        "returns": {
          "type": "string",
          "description": "Message localized for current locale."
        }
      }
    ],
    "events": []
  }
]