API > wxt/browser > WxtI18n
Interface: WxtI18n
Contents
Extends
Static
Methods
detectLanguage()
detectLanguage(
text
):Promise
<DetectLanguageCallbackResultType
>
Detects the language of the provided text using CLD.
Parameters
▪ text: string
User input string to be translated.
Inherited from
I18n.Static.detectLanguage
Source
node_modules/.pnpm/@types+webextension-polyfill@0.10.7/node_modules/@types/webextension-polyfill/namespaces/i18n.d.ts:83
getAcceptLanguages()
getAcceptLanguages():
Promise
<string
[]>
Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use $(ref:i18n.getUILanguage).
Inherited from
I18n.Static.getAcceptLanguages
Source
node_modules/.pnpm/@types+webextension-polyfill@0.10.7/node_modules/@types/webextension-polyfill/namespaces/i18n.d.ts:56
getMessage()
getMessage(
messageName
,substitutions
?):string
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 — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns <code>
undefined</code>
.
Parameters
▪ messageName: string
The name of the message, as specified in the <code>
$(topic:i18n-messages)[messages.json]</code>
file.
▪ substitutions?: string
| string
[]
Optional. Substitution strings, if the message requires any.
Returns
Message localized for current locale.
Inherited from
I18n.Static.getMessage
Source
node_modules/.pnpm/@types+webextension-polyfill@0.10.7/node_modules/@types/webextension-polyfill/namespaces/i18n.d.ts:68
getUILanguage()
getUILanguage():
string
Gets the browser UI language of the browser. This is different from $(ref:i18n.getAcceptLanguages) which returns the preferred user languages.
Returns
The browser UI language code such as en-US or fr-FR.
Inherited from
I18n.Static.getUILanguage
Source
node_modules/.pnpm/@types+webextension-polyfill@0.10.7/node_modules/@types/webextension-polyfill/namespaces/i18n.d.ts:76
Generated using typedoc-plugin-markdown and TypeDoc