FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.t() function

string fcf.t(string a_str, string a_lang = fcf.getContext().language || fcf.getConfiguration().defaultLanguage)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Performs a line feed. If no translation is found, the original string is returned.

Arguments

string a_str
- Translation string

string a_lang = fcf.getContext().language || fcf.getConfiguration().defaultLanguage
- Translation language. If no translation is specified, then the language set in the execution context is used, or the default language if the language in the execution context is not specified.
Result
string
- Translated string

Example: Function application

fcf.getConfiguration().append({ translations: [ { language: "ja", translations: { "Hello world": "こんにちは世界", } } ], }); fcf.getContext().language = "ja" console.log(fcf.t("Hello world"));

Output:

こんにちは世界