A list of all of the column names in the translation table.
Flags : Cached (Note this is uncached)
Expression : const sql =
SELECT name FROM PRAGMA_TABLE_INFO('translation'); return this.getArray(sql).map(item => item.name);
The source language used to identify the key column in the translations table. The str
argument to translate()
must appear in this column.
Flags : Cached, Parameter (Note this is uncached)
Expression : "en-us"
Locked to read-only.
Flags : Cached (Note this is uncached)
Expression : true
The language to be used as the target, if not specified in the translate()
call. This must match a column name in the translations table.
Flags : Cached, Parameter (Note this is uncached)
Expression : "en-us"
translate(str, lang)
Looks up str
in the key column and returns the corresponding string in the lang
column. If lang
is not provided, uses the current targetLanguage
value.
Flags : Method (Note this is uncached)
Expression : return function(str, lang) { const target = lang ? lang : this.targetLanguage; const sql =
SELECT * FROM translation WHERE [${this.keyLanguage}]='${str}'; let res; try { res = this.getValue(sql, target); } catch (e) { res =
${str}; R.message.warn(
Unable to translate '${str}'); } return res; };
UITranslationsTable (d.1.0)
Mixins: SqliteDB
Defines the language translation table. The table needs to be provided as an SQLite DB. Although the author can create tables with any column names, we recommend using international standard locale ids, such as 'en-us' and 'jp-jp'.