How to use the getFixedT function from i18next
Find comprehensive JavaScript i18next.getFixedT code examples handpicked from public code repositorys.
40 41 42 43 44 45 46
ns: namespaces, preload: languages, }); require('../utils/Logger').ready(`${languages.length} language(s) have loaded. (${languages.join(', ')})`); return new Map(languages.map(item => [item, i18next.getFixedT(item)])); };
325
475
19
53 54 55 56 57 58 59 60 61 62
function updateAvailableLanguages() { Object.keys(languageResources).forEach((key) => { // for some reason, 'pt-br' was not working, use just pt instead const k = key.split('-')[0] languages[k] = i18next.getFixedT(k)('language-name') }) state.translation = { t: i18next.t,
228
0
62
+ 3 other calls in file
GitHub: atomiclabs/hyperdex
47 48 49 50 51 52
await appReady; return i18next; }); exports.i18n = i18next; exports.translate = namespaces => namespaces ? i18next.getFixedT(null, namespaces) : i18next.t.bind(i18next);
61
151
12
15 16 17 18 19 20 21 22 23 24
}, 1000 * 60); } async sendReminder(doc) { const language = (doc.serverLang) || 'pt-BR'; const t = i18next.getFixedT(language); if (doc.rememberInPv) { try { const user = await this.client.users.fetch(doc.id);
15
0
0
18 19 20 21 22 23 24 25 26 27
}) const t = (key, options) => i18n.t(key, options) const getFixedT = lang => { const t = i18n.getFixedT(lang) return t } module.exports = { i18n, t, getFixedT }
3
10
7
GitHub: 3merge/q3-api
128 129 130 131 132 133 134 135 136
return this; } subjecti18n(subject, vars = {}) { this.meta.subject = i18next.getFixedT(this.lang)( ['subjects', subject].join(':'), vars, );
0
3
5
24 25 26 27 28 29 30 31 32 33
async run(interaction){ let client = this.client; let user_translation = await translations.get_lang(interaction.user); let locale = global.t = i18next.getFixedT(user_translation || 'pt-BR'); if(interaction.isCommand()){ let command = client.commands2.get(interaction.commandName.toLowerCase()); //if (!client.commands2.has(interaction.commandName.toLowerCase())) return;
0
1
0
GitHub: saas-plat/metaquery
-4 -3
const i18next = require('i18next'); exports.t = i18next.getFixedT(null, 'metaquery');
0
1
0