From ea17b2e9c73b95511716ed8833bba55f32221893 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Wed, 21 Jan 2026 21:34:25 +0100 Subject: [PATCH] Rework how strings are localized (#15589) * replace lodash template usage with micromustache * remove function brackets from translations * add newline * remove old test * split core translations from content translations * fix directory not existing * fix lint --- gulp/gulp-cache.js | 29 +++++++---- package-lock.json | 13 +++++ package.json | 1 + test/content/translator.js | 7 +-- test/helpers/content.helper.js | 4 +- website/client/index.html | 2 +- website/client/package-lock.json | 13 +++++ website/client/package.json | 1 + website/client/src/pages/user-main.vue | 57 +++++++++++++--------- website/common/locales/bg/content.json | 4 +- website/common/locales/bg/pets.json | 4 +- website/common/locales/cs/content.json | 4 +- website/common/locales/cs/pets.json | 4 +- website/common/locales/da/content.json | 4 +- website/common/locales/da/pets.json | 4 +- website/common/locales/de/content.json | 6 +-- website/common/locales/de/pets.json | 4 +- website/common/locales/en/content.json | 6 +-- website/common/locales/en/pets.json | 4 +- website/common/locales/en_GB/content.json | 6 +-- website/common/locales/en_GB/pets.json | 4 +- website/common/locales/es/content.json | 6 +-- website/common/locales/es/pets.json | 4 +- website/common/locales/es_419/content.json | 4 +- website/common/locales/es_419/pets.json | 4 +- website/common/locales/fr/content.json | 6 +-- website/common/locales/fr/pets.json | 4 +- website/common/locales/he/content.json | 4 +- website/common/locales/he/pets.json | 2 +- website/common/locales/hr/content.json | 6 +-- website/common/locales/hr/pets.json | 4 +- website/common/locales/hu/content.json | 6 +-- website/common/locales/hu/pets.json | 4 +- website/common/locales/id/content.json | 4 +- website/common/locales/id/pets.json | 4 +- website/common/locales/it/content.json | 6 +-- website/common/locales/it/pets.json | 4 +- website/common/locales/ja/content.json | 6 +-- website/common/locales/ja/pets.json | 4 +- website/common/locales/ko/content.json | 4 +- website/common/locales/ko/pets.json | 4 +- website/common/locales/nl/content.json | 6 +-- website/common/locales/nl/pets.json | 4 +- website/common/locales/pl/content.json | 6 +-- website/common/locales/pl/pets.json | 4 +- website/common/locales/pt/content.json | 4 +- website/common/locales/pt/pets.json | 4 +- website/common/locales/pt_BR/content.json | 6 +-- website/common/locales/pt_BR/pets.json | 4 +- website/common/locales/ro/content.json | 4 +- website/common/locales/ro/pets.json | 4 +- website/common/locales/ru/content.json | 6 +-- website/common/locales/ru/pets.json | 4 +- website/common/locales/sk/content.json | 6 +-- website/common/locales/sk/pets.json | 4 +- website/common/locales/sr/content.json | 4 +- website/common/locales/sr/pets.json | 4 +- website/common/locales/sv/content.json | 4 +- website/common/locales/sv/pets.json | 4 +- website/common/locales/tr/content.json | 6 +-- website/common/locales/tr/pets.json | 4 +- website/common/locales/uk/content.json | 6 +-- website/common/locales/uk/pets.json | 4 +- website/common/locales/zh/content.json | 6 +-- website/common/locales/zh/pets.json | 4 +- website/common/locales/zh_TW/content.json | 4 +- website/common/locales/zh_TW/pets.json | 4 +- website/common/script/i18n.js | 16 ++++-- website/server/controllers/api-v3/i18n.js | 41 +++++++++++++--- website/server/libs/i18n.js | 44 +++++++++++++---- website/server/middlewares/language.js | 4 +- 71 files changed, 302 insertions(+), 194 deletions(-) diff --git a/gulp/gulp-cache.js b/gulp/gulp-cache.js index ebe85ff984..0b27010892 100644 --- a/gulp/gulp-cache.js +++ b/gulp/gulp-cache.js @@ -33,26 +33,37 @@ gulp.task('cache:content', done => { } }); +function safeMkdir (path) { + try { + fs.mkdirSync(path); + } catch (err) { + if (err.code !== 'EEXIST') throw err; + } +} + gulp.task('cache:i18n', done => { // Requiring at runtime because these files access `common` // code which in production works only if transpiled so after // gulp build:babel:common has run - const { BROWSER_SCRIPT_CACHE_PATH, geti18nBrowserScript } = require('../website/server/libs/i18n'); // eslint-disable-line global-require + const { BROWSER_SCRIPT_CACHE_PATH, geti18nCoreBrowserScript, geti18nContentBrowserScript } = require('../website/server/libs/i18n'); // eslint-disable-line global-require const { langCodes } = require('../website/server/libs/i18n'); // eslint-disable-line global-require try { - // create the cache folder (if it doesn't exist) - try { - fs.mkdirSync(BROWSER_SCRIPT_CACHE_PATH); - } catch (err) { - if (err.code !== 'EEXIST') throw err; - } + // create the cache folders (if they doesn't exist) + safeMkdir(BROWSER_SCRIPT_CACHE_PATH); + safeMkdir(`${BROWSER_SCRIPT_CACHE_PATH}core/`); + safeMkdir(`${BROWSER_SCRIPT_CACHE_PATH}content/`); // create and save the i18n browser script for each language langCodes.forEach(languageCode => { fs.writeFileSync( - `${BROWSER_SCRIPT_CACHE_PATH}${languageCode}.js`, - geti18nBrowserScript(languageCode), + `${BROWSER_SCRIPT_CACHE_PATH}core/${languageCode}.js`, + geti18nCoreBrowserScript(languageCode), + 'utf8', + ); + fs.writeFileSync( + `${BROWSER_SCRIPT_CACHE_PATH}content/${languageCode}.js`, + geti18nContentBrowserScript(languageCode), 'utf8', ); }); diff --git a/package-lock.json b/package-lock.json index 9ae3b26a45..ac884610d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,7 @@ "lodash": "^4.17.21", "merge-stream": "^2.0.0", "method-override": "^3.0.0", + "micromustache": "^8.0.3", "moment": "^2.29.4", "moment-recur": "git://github.com/HabitRPG/moment-recur.git#d3e8e6da0806f13b74dd2e4d7d9053e6a63db119", "mongoose": "^8.9.5", @@ -14869,6 +14870,18 @@ "node": ">=0.10.0" } }, + "node_modules/micromustache": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/micromustache/-/micromustache-8.0.3.tgz", + "integrity": "sha512-SXjrEPuYNtWq0reR9LR2nHdzdQx/3re9HPcDGjm00L7hi2RsH5KMRBhYEBvPdyQC51RW/2TznjwX/sQLPPyHNw==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/userpixel/micromustache/blob/master/.github/FUNDING.yml" + } + }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", diff --git a/package.json b/package.json index f387894b21..c778f7de97 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "lodash": "^4.17.21", "merge-stream": "^2.0.0", "method-override": "^3.0.0", + "micromustache": "^8.0.3", "moment": "^2.29.4", "moment-recur": "git://github.com/HabitRPG/moment-recur.git#d3e8e6da0806f13b74dd2e4d7d9053e6a63db119", "mongoose": "^8.9.5", diff --git a/test/content/translator.js b/test/content/translator.js index 9bb0e87ed3..2f780ef394 100644 --- a/test/content/translator.js +++ b/test/content/translator.js @@ -1,12 +1,7 @@ -import { STRING_ERROR_MSG, STRING_DOES_NOT_EXIST_MSG } from '../helpers/content.helper'; +import { STRING_DOES_NOT_EXIST_MSG } from '../helpers/content.helper'; import translator from '../../website/common/script/content/translation'; describe('Translator', () => { - it('returns error message if string is not properly formatted', () => { - const improperlyFormattedString = translator('petName', { attr: 0 })(); - expect(improperlyFormattedString).to.match(STRING_ERROR_MSG); - }); - it('returns an error message if string does not exist', () => { const stringDoesNotExist = translator('stringDoesNotExist')(); expect(stringDoesNotExist).to.match(STRING_DOES_NOT_EXIST_MSG); diff --git a/test/helpers/content.helper.js b/test/helpers/content.helper.js index 5dae94ce4b..383aa563c2 100644 --- a/test/helpers/content.helper.js +++ b/test/helpers/content.helper.js @@ -1,8 +1,8 @@ import i18n from '../../website/common/script/i18n'; import './globals.helper'; -import { translations } from '../../website/server/libs/i18n'; +import { contentTranslations } from '../../website/server/libs/i18n'; -i18n.translations = translations; +i18n.translations = contentTranslations; export const STRING_ERROR_MSG = /^Error processing the string ".*". Please see Help > Report a Bug.$/; export const STRING_DOES_NOT_EXIST_MSG = /^String '.*' not found.$/; diff --git a/website/client/index.html b/website/client/index.html index bc3dc19bef..f27b4bb99b 100644 --- a/website/client/index.html +++ b/website/client/index.html @@ -32,6 +32,6 @@ - + diff --git a/website/client/package-lock.json b/website/client/package-lock.json index 29c2d0e278..e9949d5386 100644 --- a/website/client/package-lock.json +++ b/website/client/package-lock.json @@ -29,6 +29,7 @@ "jquery": "^3.7.1", "lodash": "^4.17.21", "markdown-it": "^14.0.0", + "micromustache": "^8.0.3", "moment": "^2.29.4", "nconf": "^0.12.1", "sass": "^1.63.4", @@ -6412,6 +6413,18 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/micromustache": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/micromustache/-/micromustache-8.0.3.tgz", + "integrity": "sha512-SXjrEPuYNtWq0reR9LR2nHdzdQx/3re9HPcDGjm00L7hi2RsH5KMRBhYEBvPdyQC51RW/2TznjwX/sQLPPyHNw==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/userpixel/micromustache/blob/master/.github/FUNDING.yml" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", diff --git a/website/client/package.json b/website/client/package.json index d209e07077..651b64cdb2 100644 --- a/website/client/package.json +++ b/website/client/package.json @@ -33,6 +33,7 @@ "jquery": "^3.7.1", "lodash": "^4.17.21", "markdown-it": "^14.0.0", + "micromustache": "^8.0.3", "moment": "^2.29.4", "nconf": "^0.12.1", "sass": "^1.63.4", diff --git a/website/client/src/pages/user-main.vue b/website/client/src/pages/user-main.vue index 36b13dac14..aa223b7444 100644 --- a/website/client/src/pages/user-main.vue +++ b/website/client/src/pages/user-main.vue @@ -268,7 +268,6 @@ export default { this.$store.dispatch('user:fetch'), this.$store.dispatch('tasks:fetchUserTasks'), ]).then(() => { - this.$store.state.isUserLoaded = true; let analyticsConsent = localStorage.getItem('analyticsConsent'); if (analyticsConsent !== null) { analyticsConsent = analyticsConsent === 'true'; @@ -276,31 +275,11 @@ export default { this.$store.dispatch('user:set', { 'preferences.analyticsConsent': analyticsConsent }); } } - if (window && window['habitica-i18n']) { - if (this.user.preferences.language === window['habitica-i18n'].language.code) { - return null; - } - } - if (window && window['habitica-i18n']) { - if (this.user.preferences.language === window['habitica-i18n'].language.code) { - return null; - } - } + Analytics.updateUser(); - return axios.get( - '/api/v4/i18n/browser-script', - { - language: this.user.preferences.language, - headers: { - 'Cache-Control': 'no-cache', - Pragma: 'no-cache', - Expires: '0', - }, - }, - ); + return this.loadAllTranslations(); }).then(() => { - const i18nData = window && window['habitica-i18n']; - this.$loadLocale(i18nData); + this.$store.state.isUserLoaded = true; this.hideLoadingScreen(); // Adjust the timezone offset @@ -380,6 +359,36 @@ export default { hideLoadingScreen () { this.loading = false; }, + async loadContentTranslations () { + const contentTranslations = await axios.get( + '/api/v4/i18n/content', + { + language: this.user.preferences.language, + }, + ); + const i18nData = window && window['habitica-i18n']; + i18nData.strings = { ...i18nData.strings, ...contentTranslations.data }; + this.$loadLocale(i18nData); + }, + async loadAllTranslations () { + if (window && window['habitica-i18n']) { + if (this.user.preferences.language === window['habitica-i18n'].language.code) { + return this.loadContentTranslations(); + } + } + await axios.get( + '/api/v4/i18n/core', + { + language: this.user.preferences.language, + headers: { + 'Cache-Control': 'no-cache', + Pragma: 'no-cache', + Expires: '0', + }, + }, + ); + return this.loadContentTranslations(); + }, }, }; diff --git a/website/common/locales/bg/content.json b/website/common/locales/bg/content.json index 91c5066247..db3342e174 100644 --- a/website/common/locales/bg/content.json +++ b/website/common/locales/bg/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Велоцираптор", "questEggVelociraptorMountText": "Велоцираптор", "questEggVelociraptorAdjective": "умен", - "eggNotes": "Намерете излюпваща отвара, която да излеете върху това яйце и от него ще се излюпи <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Намерете излюпваща отвара, която да излеете върху това яйце и от него ще се излюпи <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Нормален цвят", "hatchingPotionWhite": "Бял цвят", "hatchingPotionDesert": "Пустинен цвят", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Светещо в тъмното", "hatchingPotionFrost": "Скреж", "hatchingPotionIcySnow": "Леден сняг", - "hatchingPotionNotes": "Излейте това върху яйце и от него ще се излюпи любимец с(ъс) <%= potText(locale) %>.", + "hatchingPotionNotes": "Излейте това върху яйце и от него ще се излюпи любимец с(ъс) <%= potText %>.", "foodMeat": "Месо", "foodMeatThe": "Месото", "foodMeatA": "Месо", diff --git a/website/common/locales/bg/pets.json b/website/common/locales/bg/pets.json index 6043b910bc..750ca09c2e 100644 --- a/website/common/locales/bg/pets.json +++ b/website/common/locales/bg/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Не притежавате този прево.", "feedPet": "Искате ли да дадете <%= text %> на <%= name %>?", "raisedPet": "Вие отгледахте <%= pet %>!", - "petName": "<%= egg(locale) %> с(ъс) <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> с(ъс) <%= potion(locale) %>", + "petName": "<%= egg %> с(ъс) <%= potion %>", + "mountName": "<%= mount %> с(ъс) <%= potion %>", "keyToPets": "Ключ от зверилника за любимци", "keyToPetsDesc": "Освобождаване на всички стандартни любимци, за да можете да ги съберете отново. (Това не засяга любимците от мисии и редките любимци.)", "keyToMounts": "Ключ от зверилника за превози", diff --git a/website/common/locales/cs/content.json b/website/common/locales/cs/content.json index c503532d32..31c289a2a5 100644 --- a/website/common/locales/cs/content.json +++ b/website/common/locales/cs/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "chytrý", - "eggNotes": "Najdi líhnoucí lektvar, nalij ho na vejce a to se vylíhne v <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Najdi líhnoucí lektvar, nalij ho na vejce a to se vylíhne v <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Základní", "hatchingPotionWhite": "Bílý", "hatchingPotionDesert": "Pouštní", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Ve tmě svítící", "hatchingPotionFrost": "Zmrzlý", "hatchingPotionIcySnow": "Ledově Sněhový", - "hatchingPotionNotes": "Nalij ho na vejce a vylíhne se ti <%= potText(locale) %> mazlíček.", + "hatchingPotionNotes": "Nalij ho na vejce a vylíhne se ti <%= potText %> mazlíček.", "foodMeat": "Maso", "foodMeatThe": "Maso", "foodMeatA": "Maso", diff --git a/website/common/locales/cs/pets.json b/website/common/locales/cs/pets.json index 16d9a9dae8..95da4df436 100644 --- a/website/common/locales/cs/pets.json +++ b/website/common/locales/cs/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Nevlastníš toto jezdecké zvíře.", "feedPet": "Dát <%= text %> svému <%= name %>?", "raisedPet": "Vychoval jsi svého <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Klíč ke Kotcům Mazlíčků", "keyToPetsDesc": "Propusť všechny své běžné mazlíčky abys je mohl sbírat znovu. (Ti vzácní a z výprav tím nebudou ovlivněni.)", "keyToMounts": "Klíč ke Kotcům Zvířat", diff --git a/website/common/locales/da/content.json b/website/common/locales/da/content.json index 35fe35e1a4..d7bf959b30 100644 --- a/website/common/locales/da/content.json +++ b/website/common/locales/da/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "en vaks", - "eggNotes": "Find en udrugningseliksir til at hælde på dit æg, og det vil udklække <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Find en udrugningseliksir til at hælde på dit æg, og det vil udklække <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Almindelig", "hatchingPotionWhite": "Hvid", "hatchingPotionDesert": "Ørken", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Selvlysende", "hatchingPotionFrost": "Frost", "hatchingPotionIcySnow": "Isnende sne", - "hatchingPotionNotes": "Hæld denne over et æg, og det vil udklækkes til et <%= potText(locale) %> kæledyr.", + "hatchingPotionNotes": "Hæld denne over et æg, og det vil udklækkes til et <%= potText %> kæledyr.", "foodMeat": "Kød", "foodMeatThe": "Kødet", "foodMeatA": "Kød", diff --git a/website/common/locales/da/pets.json b/website/common/locales/da/pets.json index 36b12ac02f..1e6915b3a6 100644 --- a/website/common/locales/da/pets.json +++ b/website/common/locales/da/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Du ejer ikke dette ridedyr.", "feedPet": "Giv <%= text %> til din <%= name %>?", "raisedPet": "Du har opdrættet din/dit <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %>-<%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %>-<%= mount %>", "keyToPets": "Nøgle til Kæledyrskennelen", "keyToPetsDesc": "Sæt alle standardkæledyrene fri, så du kan samle dem igen. (Kæledyr fra quests og sjældne kæledyr påvirkes ikke.)", "keyToMounts": "Nøgle til Ridedyrskennelen", diff --git a/website/common/locales/de/content.json b/website/common/locales/de/content.json index b3dfb03e19..c12d21310d 100644 --- a/website/common/locales/de/content.json +++ b/website/common/locales/de/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor-Haustier", "questEggVelociraptorMountText": "Velociraptor-Reittier", "questEggVelociraptorAdjective": "ein cleveres", - "eggNotes": "Finde ein Schlüpfelixier, das Du über dieses Ei gießen kannst, damit ein <%= eggAdjective(locale) %> <%= eggText(locale) %> schlüpfen kann.", + "eggNotes": "Finde ein Schlüpfelixier, das Du über dieses Ei gießen kannst, damit ein <%= eggAdjective %> <%= eggText %> schlüpfen kann.", "hatchingPotionBase": "Normales", "hatchingPotionWhite": "Weißes", "hatchingPotionDesert": "Wüstenfarbenes", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Fluoreszierendes", "hatchingPotionFrost": "Frostiges", "hatchingPotionIcySnow": "Eisschnee", - "hatchingPotionNotes": "Gieße dies über ein Ei und es wird ein <%= potText(locale) %> Haustier daraus schlüpfen.", + "hatchingPotionNotes": "Gieße dies über ein Ei und es wird ein <%= potText %> Haustier daraus schlüpfen.", "foodMeat": "Fleisch", "foodMeatThe": "das Fleisch", "foodMeatA": "Fleisch", @@ -406,7 +406,7 @@ "hatchingPotionBalloon": "Ballon", "wackyPotionAddlNotes": "Kann nicht zum Reittier großgezogen oder für Quest-Haustier Eier benutzt werden.", "hatchingPotionCryptid": "Kryptisch", - "wackyPotionNotes": "Schütte dies über ein Ei und es wird als Durchgeknalltes <%= potText(locale) %> Haustier schlüpfen.", + "wackyPotionNotes": "Schütte dies über ein Ei und es wird als Durchgeknalltes <%= potText %> Haustier schlüpfen.", "questEggPlatypusText": "Schnabeltier", "questEggPlatypusMountText": "Schnabeltier", "questEggPlatypusAdjective": "ein Perfektionist", diff --git a/website/common/locales/de/pets.json b/website/common/locales/de/pets.json index 7e281f50e8..5300ed6ba3 100644 --- a/website/common/locales/de/pets.json +++ b/website/common/locales/de/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Du besitzt dieses Reittier nicht.", "feedPet": "<%= text %> an <%= name %> verfüttern?", "raisedPet": "Du hast ein <%= pet %> aufgezogen!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Schlüssel zu den Haustier-Zwingern", "keyToPetsDesc": "Lässt alle Standard-Haustiere frei, so dass Du sie erneut sammeln kannst. (Quest- und seltene Haustiere sind nicht betroffen.)", "keyToMounts": "Schlüssel zu den Reittier-Zwingern", diff --git a/website/common/locales/en/content.json b/website/common/locales/en/content.json index 740e1a6a8d..c6cd132481 100644 --- a/website/common/locales/en/content.json +++ b/website/common/locales/en/content.json @@ -287,7 +287,7 @@ "questEggPlatypusMountText": "Platypus", "questEggPlatypusAdjective": "a perfectionist", - "eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Base", "hatchingPotionWhite": "White", @@ -357,9 +357,9 @@ "hatchingPotionCryptid": "Cryptid", "hatchingPotionOpal": "Opal", - "hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> Pet.", + "hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText %> Pet.", "premiumPotionUnlimitedNotes": "Not usable on Quest Pet eggs.", - "wackyPotionNotes": "Pour this on an egg, and it will hatch as a Wacky <%= potText(locale) %> Pet.", + "wackyPotionNotes": "Pour this on an egg, and it will hatch as a Wacky <%= potText %> Pet.", "wackyPotionAddlNotes": "Cannot be raised to Mounts or used on Quest Pet eggs.", "foodMeat": "Meat", diff --git a/website/common/locales/en/pets.json b/website/common/locales/en/pets.json index e3f4d12ce8..f1043770d0 100644 --- a/website/common/locales/en/pets.json +++ b/website/common/locales/en/pets.json @@ -71,8 +71,8 @@ "mountNotOwned": "You do not own this mount.", "feedPet": "Feed <%= text %> to your <%= name %>?", "raisedPet": "You grew your <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Key to the Pet Kennels", "keyToPetsDesc": "Release all standard Pets so you can collect them again. (Quest Pets and rare Pets are not affected.)", "keyToMounts": "Key to the Mount Kennels", diff --git a/website/common/locales/en_GB/content.json b/website/common/locales/en_GB/content.json index 82832601f4..c427301975 100644 --- a/website/common/locales/en_GB/content.json +++ b/website/common/locales/en_GB/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "a clever", - "eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Base", "hatchingPotionWhite": "White", "hatchingPotionDesert": "Desert", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Glow-in-the-Dark", "hatchingPotionFrost": "Frost", "hatchingPotionIcySnow": "Icy Snow", - "hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> Pet.", + "hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText %> Pet.", "foodMeat": "Meat", "foodMeatThe": "the Meat", "foodMeatA": "Meat", @@ -406,7 +406,7 @@ "hatchingPotionBalloon": "Balloon", "hatchingPotionCryptid": "Cryptid", "wackyPotionAddlNotes": "Cannot be raised to Mounts or used on Quest Pet eggs.", - "wackyPotionNotes": "Pour this on an egg, and it will hatch as a Wacky <%= potText(locale) %> Pet.", + "wackyPotionNotes": "Pour this on an egg, and it will hatch as a Wacky <%= potText %> Pet.", "questEggPlatypusText": "Platypus", "questEggPlatypusMountText": "Platypus", "questEggPlatypusAdjective": "a perfectionist", diff --git a/website/common/locales/en_GB/pets.json b/website/common/locales/en_GB/pets.json index 88476a7f25..be02598854 100644 --- a/website/common/locales/en_GB/pets.json +++ b/website/common/locales/en_GB/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "You do not own this mount.", "feedPet": "Feed <%= text %> to your <%= name %>?", "raisedPet": "You grew your <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Key to the Pet Kennels", "keyToPetsDesc": "Release all standard Pets so you can collect them again. (Quest Pets and rare Pets are not affected.)", "keyToMounts": "Key to the Mount Kennels", diff --git a/website/common/locales/es/content.json b/website/common/locales/es/content.json index c1d4a43f0c..e3dbbed695 100644 --- a/website/common/locales/es/content.json +++ b/website/common/locales/es/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "un ingenioso", - "eggNotes": "Encuentra una poción de eclosión para verter en este huevo y eclosionará en <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Encuentra una poción de eclosión para verter en este huevo y eclosionará en <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Base", "hatchingPotionWhite": "Blanco", "hatchingPotionDesert": "del Desierto", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "que brilla en la oscuridad", "hatchingPotionFrost": "Escarcha", "hatchingPotionIcySnow": "Nieve Glacial", - "hatchingPotionNotes": "Vierte esto en un huevo y eclosionará como una Mascota <%= potText(locale) %>.", + "hatchingPotionNotes": "Vierte esto en un huevo y eclosionará como una Mascota <%= potText %>.", "foodMeat": "Carne", "foodMeatThe": "La Carne", "foodMeatA": "Carne", @@ -405,7 +405,7 @@ "hatchingPotionBalloon": "Globo", "questEggAlpacaAdjective": "una colmada", "hatchingPotionCryptid": "Críptido", - "wackyPotionNotes": "Vierte esto en un huevo y eclosionará como una Mascota Absurda <%= potText(locale) %>.", + "wackyPotionNotes": "Vierte esto en un huevo y eclosionará como una Mascota Absurda <%= potText %>.", "wackyPotionAddlNotes": "No puede convertirse en una Montura o usarse en huevos de Mascotas de Misión.", "questEggPlatypusMountText": "Marsupial", "hatchingPotionOpal": "Ópalo", diff --git a/website/common/locales/es/pets.json b/website/common/locales/es/pets.json index 7c3dfc5dd8..f266aac7ca 100644 --- a/website/common/locales/es/pets.json +++ b/website/common/locales/es/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "No tienes esta montura.", "feedPet": "¿Dar de comer <%= text %> a tu <%= name %>?", "raisedPet": "¡Creciste tu <%= pet %>!", - "petName": "<%= egg(locale) %> <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> <%= potion(locale) %>", + "petName": "<%= egg %> <%= potion %>", + "mountName": "<%= mount %> <%= potion %>", "keyToPets": "Llave a las Casetas de las Mascotas", "keyToPetsDesc": "Libera todas las mascotas estándar para coleccionarlas de nuevo. (Las mascotas de misión y las raras no se verán afectadas.)", "keyToMounts": "Llave a las Casetas de las Monturas", diff --git a/website/common/locales/es_419/content.json b/website/common/locales/es_419/content.json index 456bc09db2..9b84166350 100644 --- a/website/common/locales/es_419/content.json +++ b/website/common/locales/es_419/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "un inteligente", - "eggNotes": "Encuentra una poción de eclosión para verter sobre este huevo y se convertirá en <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Encuentra una poción de eclosión para verter sobre este huevo y se convertirá en <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Base", "hatchingPotionWhite": "Blanco", "hatchingPotionDesert": "Desierto", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Fosforescente", "hatchingPotionFrost": "Escarcha", "hatchingPotionIcySnow": "Nieve Helada", - "hatchingPotionNotes": "Vierte esto sobre un huevo, y nacerá una mascota <%= potText(locale) %>.", + "hatchingPotionNotes": "Vierte esto sobre un huevo, y nacerá una mascota <%= potText %>.", "foodMeat": "Carne", "foodMeatThe": "la Carne", "foodMeatA": "Carne", diff --git a/website/common/locales/es_419/pets.json b/website/common/locales/es_419/pets.json index 35045d3899..0c0f87b316 100644 --- a/website/common/locales/es_419/pets.json +++ b/website/common/locales/es_419/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "No tienes esta montura.", "feedPet": "¿Dar de comer <%= text %> a tu <%= name %>?", "raisedPet": "¡Hiciste crecer tu <%= pet %>!", - "petName": "<%= egg(locale) %> <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> <%= potion(locale) %>", + "petName": "<%= egg %> <%= potion %>", + "mountName": "<%= mount %> <%= potion %>", "keyToPets": "Llave de las Casetas de Mascotas", "keyToPetsDesc": "Libera todas las Mascotas estándar para poder coleccionarlas de nuevo. (Las Mascotas de Misión y las raras no son afectadas.)", "keyToMounts": "Llave de las Casetas de Monturas", diff --git a/website/common/locales/fr/content.json b/website/common/locales/fr/content.json index b1c30946f9..27d595db2f 100644 --- a/website/common/locales/fr/content.json +++ b/website/common/locales/fr/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Vélociraptor", "questEggVelociraptorMountText": "Vélociraptor", "questEggVelociraptorAdjective": "un intelligent", - "eggNotes": "Trouvez une potion d’éclosion à verser sur cet œuf et il en sortira <%= eggAdjective(locale) %> bébé <%= eggText(locale) %>.", + "eggNotes": "Trouvez une potion d’éclosion à verser sur cet œuf et il en sortira <%= eggAdjective %> bébé <%= eggText %>.", "hatchingPotionBase": "de base", "hatchingPotionWhite": "des neiges", "hatchingPotionDesert": "du désert", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "phosphorescent", "hatchingPotionFrost": "du gel", "hatchingPotionIcySnow": "de neige verglacée", - "hatchingPotionNotes": "Versez-la sur un œuf et il en sortira un Familier <%= potText(locale) %>.", + "hatchingPotionNotes": "Versez-la sur un œuf et il en sortira un Familier <%= potText %>.", "foodMeat": "Côtelette", "foodMeatThe": "la côtelette", "foodMeatA": "une côtelette", @@ -406,7 +406,7 @@ "hatchingPotionBalloon": "Ballon", "wackyPotionAddlNotes": "Ne peut se transformer en Monture ni être utilisée sur les œufs de Familier de Quête.", "hatchingPotionCryptid": "Cyptide", - "wackyPotionNotes": "Versez-la sur un œuf et il en sortira un Familier <%= potText(locale) %> Farfelu.", + "wackyPotionNotes": "Versez-la sur un œuf et il en sortira un Familier <%= potText %> Farfelu.", "questEggPlatypusText": "Ornithorynque", "questEggPlatypusMountText": "Ornithorynque", "questEggPlatypusAdjective": "organisé", diff --git a/website/common/locales/fr/pets.json b/website/common/locales/fr/pets.json index f433a06946..999cc5e10d 100644 --- a/website/common/locales/fr/pets.json +++ b/website/common/locales/fr/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Vous ne possédez pas cette monture.", "feedPet": "Donner cette <%= text %> à votre <%= name %> ?", "raisedPet": "Votre <%= pet %> a bien grandi !", - "petName": "bébé <%= egg(locale) %> <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> <%= potion(locale) %>", + "petName": "bébé <%= egg %> <%= potion %>", + "mountName": "<%= mount %> <%= potion %>", "keyToPets": "Clé du chenil des familiers", "keyToPetsDesc": "Libère tous les familiers standards pour vous puissiez les collectionner à nouveau. (Les familiers rares et de quêtes ne sont pas affectés.)", "keyToMounts": "Clé du chenil des montures", diff --git a/website/common/locales/he/content.json b/website/common/locales/he/content.json index a51040a6cd..07a4ce0e15 100644 --- a/website/common/locales/he/content.json +++ b/website/common/locales/he/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "ולוצירפטור", "questEggVelociraptorMountText": "ולוצירפטור", "questEggVelociraptorAdjective": "פיקח", - "eggNotes": "מצא שיקוי הבקעה לשפוך על ביצה זו, והיא תהפוך ל<%= eggText(locale) %> <%= eggAdjective(locale) %>.", + "eggNotes": "מצא שיקוי הבקעה לשפוך על ביצה זו, והיא תהפוך ל<%= eggText %> <%= eggAdjective %>.", "hatchingPotionBase": "רגיל", "hatchingPotionWhite": "לבן", "hatchingPotionDesert": "מדברי", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "זוהר-בחושך", "hatchingPotionFrost": "כפור", "hatchingPotionIcySnow": "שלג קרחי", - "hatchingPotionNotes": "שפוך שיקוי זה על הביצה, והיא תבקע כ <%= potText(locale) %> חיית מחמד.", + "hatchingPotionNotes": "שפוך שיקוי זה על הביצה, והיא תבקע כ <%= potText %> חיית מחמד.", "foodMeat": "בשר", "foodMeatThe": "הבשר", "foodMeatA": "בשר", diff --git a/website/common/locales/he/pets.json b/website/common/locales/he/pets.json index 7653aff553..08ec12c8c2 100644 --- a/website/common/locales/he/pets.json +++ b/website/common/locales/he/pets.json @@ -66,7 +66,7 @@ "mountNotOwned": "חיית רכיבה זו אינה בבעלותך.", "feedPet": "האכילו את <%= name %> ב<%= text %>?", "raisedPet": "ה <%= pet %> שלכם גדל/ה!", - "petName": "<%= potion(locale) %> מ<%= egg(locale) %>", + "petName": "<%= potion %> מ<%= egg %>", "mountName": "", "keyToPets": "מפתח למאורות של חיות המחמד", "keyToPetsDesc": "שחררו את כל חיות המחמד הבסיסיות כדי שתוכלו לאסוף אותם שוב. (חיות מחמד מהרפתקאות וחיות מחמד נדירות לא ישוחררו.)", diff --git a/website/common/locales/hr/content.json b/website/common/locales/hr/content.json index 714063a7d5..65468af62a 100755 --- a/website/common/locales/hr/content.json +++ b/website/common/locales/hr/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "oštroumni", - "eggNotes": "Pronađite napitak za izlijeganje koji ćete izliti na ovo jaje, i ono će se izleći u <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Pronađite napitak za izlijeganje koji ćete izliti na ovo jaje, i ono će se izleći u <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Osnovni", "hatchingPotionWhite": "Bijeli", "hatchingPotionDesert": "Pustinjski", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Svijetleći", "hatchingPotionFrost": "Mrzli", "hatchingPotionIcySnow": "Ledeni snijeg", - "hatchingPotionNotes": "Izlijte ovo na jaje, i ono će se izleći kao <%= potText(locale) %> Ljubimac.", + "hatchingPotionNotes": "Izlijte ovo na jaje, i ono će se izleći kao <%= potText %> Ljubimac.", "foodMeat": "Meso", "foodMeatThe": "Meso", "foodMeatA": "Meso", @@ -373,7 +373,7 @@ "hatchingPotionFungi": "Gljivičasti", "hatchingPotionCryptid": "Kriptidni", "hatchingPotionOpal": "Sedefast", - "wackyPotionNotes": "Izlijte ovo na jaje, i ono će se izleći kao Otkačeni <%= potText(locale) %> Ljubimac.", + "wackyPotionNotes": "Izlijte ovo na jaje, i ono će se izleći kao Otkačeni <%= potText %> Ljubimac.", "wackyPotionAddlNotes": "Ne može se pretvoriti u Jahaću životinju niti koristiti na jajima ljubimaca za pustolovine.", "premiumPotionUnlimitedNotes": "Nije upotrebljivo na jajima ljubimaca pustolovine.", "hatchingPotionOnyx": "Oniksov", diff --git a/website/common/locales/hr/pets.json b/website/common/locales/hr/pets.json index 08ccd1a2f1..6e0481b933 100644 --- a/website/common/locales/hr/pets.json +++ b/website/common/locales/hr/pets.json @@ -55,8 +55,8 @@ "beastAchievement": "Zaslužili ste postignuće \"Gospodar Zvijeri\" jer ste prikupili sve ljubimce!", "beastMasterName": "Gospodar Zvijeri", "mountMasterProgress": "Napredak Gospodara Jahaćih Životinja", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "beastMasterProgress": "Napredak Gospodara Zvijeri", "beastMasterText": "Ova osoba pronašla je svih 90 ljubimaca (a to je jako teško, čestitajte joj)", "mountAchievement": "Zaslužili ste postignuće \"Gospodar Jahaćih Životinja\" za pripitomljivanje svih jahaćih životinja!", diff --git a/website/common/locales/hu/content.json b/website/common/locales/hu/content.json index 52c0f6fc17..5ec5db32ff 100644 --- a/website/common/locales/hu/content.json +++ b/website/common/locales/hu/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "egy okos", - "eggNotes": "Keress egy keltetőfőzetet, és öntsd rá erre a tojásra – így kikel belőle egy <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Keress egy keltetőfőzetet, és öntsd rá erre a tojásra – így kikel belőle egy <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Alap", "hatchingPotionWhite": "Fehér", "hatchingPotionDesert": "Sivatag", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Sötétben világító", "hatchingPotionFrost": "Jég", "hatchingPotionIcySnow": "Jeges hó", - "hatchingPotionNotes": "Öntsd ezt egy tojásra, és egy <%= potText(locale) %> kisállat fog belőle kikelni.", + "hatchingPotionNotes": "Öntsd ezt egy tojásra, és egy <%= potText %> kisállat fog belőle kikelni.", "foodMeat": "Hús", "foodMeatThe": "a hús", "foodMeatA": "Hús", @@ -406,7 +406,7 @@ "hatchingPotionBalloon": "Léggömb", "wackyPotionAddlNotes": "Nem lehet hátassá fejleszteni, és küldetéses kisállat tojásra sem használható.", "hatchingPotionCryptid": "Kriptid", - "wackyPotionNotes": "Öntsd ezt egy tojásra, és egy bolondos <%= potText(locale) %> kisállat fog kikelni belőle.", + "wackyPotionNotes": "Öntsd ezt egy tojásra, és egy bolondos <%= potText %> kisállat fog kikelni belőle.", "questEggPlatypusText": "Kacsacsőrű emlős", "questEggPlatypusAdjective": "egy maximalista", "questEggPlatypusMountText": "Kacsacsőrű emlős", diff --git a/website/common/locales/hu/pets.json b/website/common/locales/hu/pets.json index 3596949a0e..a12341de12 100644 --- a/website/common/locales/hu/pets.json +++ b/website/common/locales/hu/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Nem rendelkezel ezzel a hátassal.", "feedPet": "Megeteted <%= text %> eledellel a(z) <%= name %> kisállatodat?", "raisedPet": "A(z) <%= pet %> megnőtt!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Kulcs a kisállat-kennelekhez", "keyToPetsDesc": "Szabadon engedi az összes alap kisállatot, hogy újra összegyűjthesd őket. (A küldetési és ritka kisállatokra nincs hatással.)", "keyToMounts": "Kulcs a hátas-kennelekhez", diff --git a/website/common/locales/id/content.json b/website/common/locales/id/content.json index ac00d05033..76e2107fd1 100644 --- a/website/common/locales/id/content.json +++ b/website/common/locales/id/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "cerdas", - "eggNotes": "Temukan ramuan penetas untuk dituangkan ke telur ini, dan ia akan menetas menjadi <%= eggText(locale) %> yang <%= eggAdjective(locale) %>.", + "eggNotes": "Temukan ramuan penetas untuk dituangkan ke telur ini, dan ia akan menetas menjadi <%= eggText %> yang <%= eggAdjective %>.", "hatchingPotionBase": "Biasa", "hatchingPotionWhite": "Putih", "hatchingPotionDesert": "Gurun", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Bersinar di Kegelapan", "hatchingPotionFrost": "Beku", "hatchingPotionIcySnow": "Salju Sedingin Es", - "hatchingPotionNotes": "Berikan ini kepada sebuah telur, dan ia akan menetas menjadi binatang peliharaan <%= potText(locale) %>.", + "hatchingPotionNotes": "Berikan ini kepada sebuah telur, dan ia akan menetas menjadi binatang peliharaan <%= potText %>.", "foodMeat": "Daging", "foodMeatThe": "Daging", "foodMeatA": "Daging", diff --git a/website/common/locales/id/pets.json b/website/common/locales/id/pets.json index 2b15dee4cd..6ab10fedcd 100644 --- a/website/common/locales/id/pets.json +++ b/website/common/locales/id/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Kamu tidak memiliki tunggangan ini.", "feedPet": "Beri makan <%= text %> kepada <%= name %>-mu?", "raisedPet": "Kamu membesarkan <%= pet %> milikmu!", - "petName": "<%= egg(locale) %> <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> <%= potion(locale) %>", + "petName": "<%= egg %> <%= potion %>", + "mountName": "<%= mount %> <%= potion %>", "keyToPets": "Kunci Kandang Peliharaan", "keyToPetsDesc": "Lepaskan semua Peliharaan standar sehingga kamu bisa mengumpulkannya lagi. (Peliharaan Misi dan Peliharaan langka tidak terpengaruh.)", "keyToMounts": "Kunci Kandang Tunggangan", diff --git a/website/common/locales/it/content.json b/website/common/locales/it/content.json index f9dbb2c429..68dea94eb9 100644 --- a/website/common/locales/it/content.json +++ b/website/common/locales/it/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "un intelligente", - "eggNotes": "Trova una pozione per far schiudere questo uovo, e nascerà <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Trova una pozione per far schiudere questo uovo, e nascerà <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Base", "hatchingPotionWhite": "Bianco", "hatchingPotionDesert": "Deserto", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Fosforescente", "hatchingPotionFrost": "Gelo", "hatchingPotionIcySnow": "Neve Ghiacciata", - "hatchingPotionNotes": "Versa questa pozione su un uovo, e nascerà un Animale Domestico <%= potText(locale) %>.", + "hatchingPotionNotes": "Versa questa pozione su un uovo, e nascerà un Animale Domestico <%= potText %>.", "foodMeat": "Carne", "foodMeatThe": "la Carne", "foodMeatA": "Carne", @@ -409,6 +409,6 @@ "hatchingPotionOpal": "Opale", "hatchingPotionPinkMarble": "Marmo Rosa", "hatchingPotionTeaShop": "Negozio di Tè", - "wackyPotionNotes": "Versalo su un uovo, e si schiuderà uno Strano <%= potText(locale) %> Animale Domestico.", + "wackyPotionNotes": "Versalo su un uovo, e si schiuderà uno Strano <%= potText %> Animale Domestico.", "wackyPotionAddlNotes": "Non può essere trasformato in Cavalcature né usato su uova di animali domestici ottenuti attraverso una Missione." } diff --git a/website/common/locales/it/pets.json b/website/common/locales/it/pets.json index 16cbfc0617..3f3d118a4c 100644 --- a/website/common/locales/it/pets.json +++ b/website/common/locales/it/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Non possiedi questa cavalcatura.", "feedPet": "Dare da mangiare <%= text %> al tuo <%= name %>?", "raisedPet": "Hai fatto crescere un <%= pet %>!", - "petName": "<%= egg(locale) %> <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> <%= potion(locale) %>", + "petName": "<%= egg %> <%= potion %>", + "mountName": "<%= mount %> <%= potion %>", "keyToPets": "Chiave dell'allevamento degli animali", "keyToPetsDesc": "Libera tutti gli Animali base in modo da poterli collezionare di nuovo (non ha effetto sugli Animali rari e quelli ottenuti dalle missioni.)", "keyToMounts": "Chiave dell'allevamento delle cavalcature", diff --git a/website/common/locales/ja/content.json b/website/common/locales/ja/content.json index 1e394efd2b..5bc6f8afc4 100644 --- a/website/common/locales/ja/content.json +++ b/website/common/locales/ja/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "ヴェロキラプトル", "questEggVelociraptorMountText": "ヴェロキラプトル", "questEggVelociraptorAdjective": "賢い", - "eggNotes": "たまごがえしの薬を見つけて、たまごにかけると、<%= eggAdjective(locale) %> <%= eggText(locale) %>が生まれます。", + "eggNotes": "たまごがえしの薬を見つけて、たまごにかけると、<%= eggAdjective %> <%= eggText %>が生まれます。", "hatchingPotionBase": "普通の", "hatchingPotionWhite": "白い", "hatchingPotionDesert": "砂漠の", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "暗闇で輝く", "hatchingPotionFrost": "霜の", "hatchingPotionIcySnow": "冷たい雪の", - "hatchingPotionNotes": "これをたまごにかけると、<%= potText(locale) %>ペットが生まれます。", + "hatchingPotionNotes": "これをたまごにかけると、<%= potText %>ペットが生まれます。", "foodMeat": "肉", "foodMeatThe": "肉", "foodMeatA": "肉", @@ -404,7 +404,7 @@ "questEggAlpacaMountText": "アルパカ", "questEggAlpacaAdjective": "詰め込みすぎた", "hatchingPotionCryptid": "未確認生物", - "wackyPotionNotes": "これをたまごにかけると、へんてこな<%= potText(locale) %>ペットが生まれます。", + "wackyPotionNotes": "これをたまごにかけると、へんてこな<%= potText %>ペットが生まれます。", "wackyPotionAddlNotes": "乗騎に育てたり、クエストペットのたまごに使ったりできません。", "questEggPlatypusText": "カモノハシ", "questEggPlatypusMountText": "カモノハシ", diff --git a/website/common/locales/ja/pets.json b/website/common/locales/ja/pets.json index e7e6904abe..8ce8a3ca9a 100644 --- a/website/common/locales/ja/pets.json +++ b/website/common/locales/ja/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "この乗騎をもっていません。", "feedPet": "<%= name %>に<%= text %>をやりますか?", "raisedPet": "<%= pet %>を育てた!", - "petName": "<%= potion(locale) %><%= egg(locale) %>", - "mountName": "<%= potion(locale) %><%= mount(locale) %>", + "petName": "<%= potion %><%= egg %>", + "mountName": "<%= potion %><%= mount %>", "keyToPets": "ペット小屋のカギ", "keyToPetsDesc": "すべての基本のペットを逃がして、再び集め直すことに挑戦できます。(クエストペットやレアペットは影響を受けません。)", "keyToMounts": "乗騎小屋のカギ", diff --git a/website/common/locales/ko/content.json b/website/common/locales/ko/content.json index 4159d449c0..0922f6df67 100755 --- a/website/common/locales/ko/content.json +++ b/website/common/locales/ko/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "벨로시랩터", "questEggVelociraptorMountText": "벨로시랩터", "questEggVelociraptorAdjective": "영리한", - "eggNotes": "부화 물약을 찾아서 이 알에 부으면 <%= eggAdjective(locale) %> <%= eggText(locale) %>(으)로 부화합니다.", + "eggNotes": "부화 물약을 찾아서 이 알에 부으면 <%= eggAdjective %> <%= eggText %>(으)로 부화합니다.", "hatchingPotionBase": "기본", "hatchingPotionWhite": "흰", "hatchingPotionDesert": "사막", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "야광", "hatchingPotionFrost": "서리", "hatchingPotionIcySnow": "얼어붙은 눈", - "hatchingPotionNotes": "이것을 알에 부으면 <%= potText(locale) %> 펫으로 부화하게 됩니다.", + "hatchingPotionNotes": "이것을 알에 부으면 <%= potText %> 펫으로 부화하게 됩니다.", "foodMeat": "고기", "foodMeatThe": "고기", "foodMeatA": "고기 한 덩이", diff --git a/website/common/locales/ko/pets.json b/website/common/locales/ko/pets.json index efc7de66d0..b382601923 100644 --- a/website/common/locales/ko/pets.json +++ b/website/common/locales/ko/pets.json @@ -50,8 +50,8 @@ "releasePetsSuccess": "일반 펫이 해금되었습니다!", "releasePetsConfirm": "정말 일반 펫을 방생하겠습니까?", "keyToPets": "펫 사육장의 열쇠", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", + "mountName": "<%= potion %> <%= mount %>", + "petName": "<%= potion %> <%= egg %>", "raisedPet": "<%= pet %>가 성장했습니다!", "feedPet": "<%= name %>에게 <%= text %>를 먹이겠습니까?", "petNotOwned": "이 펫을 가지고 있지 않습니다.", diff --git a/website/common/locales/nl/content.json b/website/common/locales/nl/content.json index 6acb7d3090..f414064a89 100644 --- a/website/common/locales/nl/content.json +++ b/website/common/locales/nl/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "een begaafde", - "eggNotes": "Vind een broeddrankje om over dit ei te gieten en er zal een <%= eggAdjective(locale) %> <%= eggText(locale) %> uit voortkomen.", + "eggNotes": "Vind een broeddrankje om over dit ei te gieten en er zal een <%= eggAdjective %> <%= eggText %> uit voortkomen.", "hatchingPotionBase": "Normale", "hatchingPotionWhite": "Witte", "hatchingPotionDesert": "Woestijnkleurige", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "In het Donker Oplichtend", "hatchingPotionFrost": "Bevroren", "hatchingPotionIcySnow": "IJzige Sneeuw", - "hatchingPotionNotes": "Giet dit over een ei en het zal uitkomen als een <%= potText(locale) %> huisdier.", + "hatchingPotionNotes": "Giet dit over een ei en het zal uitkomen als een <%= potText %> huisdier.", "foodMeat": "Vlees", "foodMeatThe": "het Vlees", "foodMeatA": "Vlees", @@ -376,7 +376,7 @@ "hatchingPotionGingerbread": "Gemberkoek", "hatchingPotionJade": "Jade", "hatchingPotionCryptid": "Cryptid", - "wackyPotionNotes": "Gebruik dit op een ei, en er zal een maf <%= potText(locale) %> huisdier uitkomen.", + "wackyPotionNotes": "Gebruik dit op een ei, en er zal een maf <%= potText %> huisdier uitkomen.", "hatchingPotionOpal": "Opaal", "questEggRaccoonMountText": "Wasbeer", "questEggRaccoonAdjective": "een vraatzuchtige", diff --git a/website/common/locales/nl/pets.json b/website/common/locales/nl/pets.json index 61b2d0691c..28b9c43fff 100644 --- a/website/common/locales/nl/pets.json +++ b/website/common/locales/nl/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Je bezit dit rijdier niet.", "feedPet": "Voer <%= text %> aan je <%= name %>?", "raisedPet": "Je hebt je <%= pet %> laten opgroeien!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Sleutel van de Huisdierenkennels", "keyToPetsDesc": "Laat al je standaard huisdieren vrij zodat je ze weer kan verzamelen. (Huisdieren van queesten en zeldzame huisdieren worden niet beïnvloed.)", "keyToMounts": "Sleutel van de Rijdierkennels", diff --git a/website/common/locales/pl/content.json b/website/common/locales/pl/content.json index d11471bde5..713f248f4d 100644 --- a/website/common/locales/pl/content.json +++ b/website/common/locales/pl/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Welociraptorek", "questEggVelociraptorMountText": "Welociraptor", "questEggVelociraptorAdjective": "sprytny", - "eggNotes": "Znajdź eliksir wyklucia i wylej go na to jajo, a wykluje się z niego <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Znajdź eliksir wyklucia i wylej go na to jajo, a wykluje się z niego <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Zwyczajny", "hatchingPotionWhite": "Biały", "hatchingPotionDesert": "Pustynny", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Lśniący w ciemności", "hatchingPotionFrost": "Mroźny", "hatchingPotionIcySnow": "Lodowato-Śniegowy", - "hatchingPotionNotes": "Wylej eliksir na jajko, a wykluje się z niego <%= potText(locale) %>.", + "hatchingPotionNotes": "Wylej eliksir na jajko, a wykluje się z niego <%= potText %>.", "foodMeat": "Mięso", "foodMeatThe": "Mięso", "foodMeatA": "Mięso", @@ -408,7 +408,7 @@ "hatchingPotionJade": "Jadeitowy", "hatchingPotionFungi": "Grzybowy", "hatchingPotionCryptid": "Kryptydowy", - "wackyPotionNotes": "Wylej ten eliksir na jajko, a wykluje się z niego Zwariowany <%= potText(locale) %>.", + "wackyPotionNotes": "Wylej ten eliksir na jajko, a wykluje się z niego Zwariowany <%= potText %>.", "wackyPotionAddlNotes": "Nie można go oswoić na Wierzchowca ani używać na jajach Chowańców z Misji.", "hatchingPotionOpal": "Opalowy" } diff --git a/website/common/locales/pl/pets.json b/website/common/locales/pl/pets.json index ae29bd340c..c52f981f51 100644 --- a/website/common/locales/pl/pets.json +++ b/website/common/locales/pl/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Nie posiadasz tego wierzchowca.", "feedPet": "Nakarmić <%= text %> twojego <%= name %>?", "raisedPet": "Wyhodowałeś <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Klucz do Zagród Chowańców", "keyToPetsDesc": "Wypuść wszystkie zwyczajne Chowańce by móc je znów zebrać. (Nie dotyczy rzadkich Chowańców i tych z misji.)", "keyToMounts": "Klucze do Zagród Wierzchowców", diff --git a/website/common/locales/pt/content.json b/website/common/locales/pt/content.json index 5fc9542f91..5a4e8d9962 100644 --- a/website/common/locales/pt/content.json +++ b/website/common/locales/pt/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "a clever", - "eggNotes": "Ache uma poção de eclosão para usar nesse ovo e ele irá eclodir em um <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Ache uma poção de eclosão para usar nesse ovo e ele irá eclodir em um <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Básico/a", "hatchingPotionWhite": "Branco/a", "hatchingPotionDesert": "do Deserto", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Fluorescente", "hatchingPotionFrost": "Geada", "hatchingPotionIcySnow": "Neve Gelada", - "hatchingPotionNotes": "Utilize isto num ovo, e ele chocará como uma mascote <%= potText(locale) %>.", + "hatchingPotionNotes": "Utilize isto num ovo, e ele chocará como uma mascote <%= potText %>.", "foodMeat": "Carne", "foodMeatThe": "Carne", "foodMeatA": "Carne", diff --git a/website/common/locales/pt/pets.json b/website/common/locales/pt/pets.json index ba1d878732..b16c41b900 100644 --- a/website/common/locales/pt/pets.json +++ b/website/common/locales/pt/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Não tens esta montada.", "feedPet": "Alimentar o(a) <%= name %> com <%= text %>?", "raisedPet": "Criaste o(a) <%= pet %>!", - "petName": "<%= egg(locale) %> <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> <%= potion(locale) %>", + "petName": "<%= egg %> <%= potion %>", + "mountName": "<%= mount %> <%= potion %>", "keyToPets": "Chave das Casotas dos Animais de Estimação", "keyToPetsDesc": "Liberta todos os teus Animais de Estimação comuns para os poderes coleccionar de novo. (Animais de Estimação de Missão e Animais de Estimação raros não são afectados.)", "keyToMounts": "Chave das Casotas das Montadas", diff --git a/website/common/locales/pt_BR/content.json b/website/common/locales/pt_BR/content.json index 88b8a74a2a..4a463133cd 100644 --- a/website/common/locales/pt_BR/content.json +++ b/website/common/locales/pt_BR/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "um inteligente", - "eggNotes": "Ache uma poção de eclosão e use-a neste ovo e ele chocará como <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Ache uma poção de eclosão e use-a neste ovo e ele chocará como <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": " ", "hatchingPotionWhite": "das Neves", "hatchingPotionDesert": "do Deserto", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "que Brilha-no-Escuro", "hatchingPotionFrost": "da Geada", "hatchingPotionIcySnow": "do Gelo de Nevasca", - "hatchingPotionNotes": "Use-a em um ovo e ele chocará como um Mascote <%= potText(locale) %>.", + "hatchingPotionNotes": "Use-a em um ovo e ele chocará como um Mascote <%= potText %>.", "foodMeat": "Carne", "foodMeatThe": "a Carne", "foodMeatA": "Carne", @@ -409,6 +409,6 @@ "questEggAlpacaText": "Alpaca", "questEggAlpacaMountText": "Alpaca", "questEggAlpacaAdjective": "Um superlotado", - "wackyPotionNotes": "Despeje isso em um ovo e ele chocará como um animal de estimação Maluco <%= potText(locale) %>.", + "wackyPotionNotes": "Despeje isso em um ovo e ele chocará como um animal de estimação Maluco <%= potText %>.", "wackyPotionAddlNotes": "Não pode ser convertido a Montaria ou usado em Ovos de Mascotes de missão." } diff --git a/website/common/locales/pt_BR/pets.json b/website/common/locales/pt_BR/pets.json index d93740d306..06f93a7337 100644 --- a/website/common/locales/pt_BR/pets.json +++ b/website/common/locales/pt_BR/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Você não possui essa montaria.", "feedPet": "Alimentar <%= text %> para seu/sua <%= name %>?", "raisedPet": "Você domou <%= pet %>!", - "petName": "<%= egg(locale) %> <%= potion(locale) %>", - "mountName": "<%= mount(locale) %> <%= potion(locale) %>", + "petName": "<%= egg %> <%= potion %>", + "mountName": "<%= mount %> <%= potion %>", "keyToPets": "Chave dos Canis de Mascotes", "keyToPetsDesc": "Liberte todos os Mascotes Padrão para que você possa colecioná-los novamente (Mascotes de Missões e Mascotes raros não são afetados.)", "keyToMounts": "Chave dos Canis das Montarias", diff --git a/website/common/locales/ro/content.json b/website/common/locales/ro/content.json index b2cdd889da..834bbfbea8 100644 --- a/website/common/locales/ro/content.json +++ b/website/common/locales/ro/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "a clever", - "eggNotes": "Găsește o licoare de eclozat pentru a turna peste acest ou și va ecloza în <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Găsește o licoare de eclozat pentru a turna peste acest ou și va ecloza în <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "de bază", "hatchingPotionWhite": "Alb", "hatchingPotionDesert": "Deșert", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Stralucire-in-intuneric", "hatchingPotionFrost": "Îngheţ", "hatchingPotionIcySnow": "Zăpadă înghețată", - "hatchingPotionNotes": "Toarnă aceasta pe un ou și va ecloza ca un animal de companie <%= potText(locale) %>.", + "hatchingPotionNotes": "Toarnă aceasta pe un ou și va ecloza ca un animal de companie <%= potText %>.", "foodMeat": "Carne", "foodMeatThe": "carnea", "foodMeatA": "Carne", diff --git a/website/common/locales/ro/pets.json b/website/common/locales/ro/pets.json index 4321390b37..784dfbd6fc 100644 --- a/website/common/locales/ro/pets.json +++ b/website/common/locales/ro/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "You do not own this mount.", "feedPet": "Feed <%= text %> to your <%= name %>?", "raisedPet": "You grew your <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Key to the Pet Kennels", "keyToPetsDesc": "Release all standard Pets so you can collect them again. (Quest Pets and rare Pets are not affected.)", "keyToMounts": "Key to the Mount Kennels", diff --git a/website/common/locales/ru/content.json b/website/common/locales/ru/content.json index fb16a02bb4..f83b62735f 100644 --- a/website/common/locales/ru/content.json +++ b/website/common/locales/ru/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Велоцираптор", "questEggVelociraptorMountText": "Велоцираптор", "questEggVelociraptorAdjective": "умный", - "eggNotes": "Найдите инкубационный эликсир, чтобы полить им это яйцо, и из него вылупится <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Найдите инкубационный эликсир, чтобы полить им это яйцо, и из него вылупится <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Обыкновенный", "hatchingPotionWhite": "Белый", "hatchingPotionDesert": "Пустынный", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Светящийся-ночью", "hatchingPotionFrost": "Морозный", "hatchingPotionIcySnow": "Ледяной", - "hatchingPotionNotes": "Полейте его на яйцо и из него вылупится <%= potText(locale) %> Питомец.", + "hatchingPotionNotes": "Полейте его на яйцо и из него вылупится <%= potText %> Питомец.", "foodMeat": "Мясо", "foodMeatThe": "Мясная пища", "foodMeatA": "Мясо", @@ -405,7 +405,7 @@ "questEggOtterAdjective": "коварный", "hatchingPotionJade": "Нефритовый", "hatchingPotionCryptid": "Мифический", - "wackyPotionNotes": "Вылейте это на яйцо, и из него вылупится питомец типа <%= potText(locale) %>.", + "wackyPotionNotes": "Вылейте это на яйцо, и из него вылупится питомец типа <%= potText %>.", "wackyPotionAddlNotes": "Не может быть возвышено до Скакуна или использовано на яйцах Квестовых питомцев.", "questEggPlatypusText": "Утконос", "questEggPlatypusMountText": "Утконос", diff --git a/website/common/locales/ru/pets.json b/website/common/locales/ru/pets.json index ca09d31c33..c7f91f419c 100644 --- a/website/common/locales/ru/pets.json +++ b/website/common/locales/ru/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Вы не являетесь владельцем этого скакуна.", "feedPet": "Скормить <%= text %> питомцу <%= name %>?", "raisedPet": "У вас вырос(ла) <%= pet %>!", - "petName": "<%= potion(locale) %>(-ая) <%= egg(locale) %>", - "mountName": "<%= potion(locale) %>(-ая) <%= mount(locale) %>", + "petName": "<%= potion %>(-ая) <%= egg %>", + "mountName": "<%= potion %>(-ая) <%= mount %>", "keyToPets": "Ключ от питомника", "keyToPetsDesc": "Выпустите всех питомцев, чтобы потом собрать их снова. (Квестовые и редкие питомцы останутся)", "keyToMounts": "Ключ от Вольеров", diff --git a/website/common/locales/sk/content.json b/website/common/locales/sk/content.json index 29fb18af0c..87c322da32 100644 --- a/website/common/locales/sk/content.json +++ b/website/common/locales/sk/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "bystrý", - "eggNotes": "Nájdi liahoxír a vylej ho na toto vajíčko, aby sa z neho vyliahlo zvieratko: <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Nájdi liahoxír a vylej ho na toto vajíčko, aby sa z neho vyliahlo zvieratko: <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Základný", "hatchingPotionWhite": "Biely", "hatchingPotionDesert": "Púštny", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "V tme svietiaci", "hatchingPotionFrost": "Zmrznutý", "hatchingPotionIcySnow": "Ľadový", - "hatchingPotionNotes": "Vylej tento liahoxír na vajíčko a vyliahne sa z neho <%= potText(locale) %> zvieratko.", + "hatchingPotionNotes": "Vylej tento liahoxír na vajíčko a vyliahne sa z neho <%= potText %> zvieratko.", "foodMeat": "Mäso", "foodMeatThe": "Mäso", "foodMeatA": "Mäso", @@ -405,7 +405,7 @@ "questEggAlpacaAdjective": "preťažená", "hatchingPotionBalloon": "Balónový", "hatchingPotionCryptid": "Mýtický", - "wackyPotionNotes": "Vylej tento liahoxír na vajíčko a vyliahne sa z neho šialené <%= potText(locale) %> zvieratko.", + "wackyPotionNotes": "Vylej tento liahoxír na vajíčko a vyliahne sa z neho šialené <%= potText %> zvieratko.", "wackyPotionAddlNotes": "Nemôže byť vycvičené na tátoša alebo použitý na Vajíčka z výprav.", "questEggPlatypusText": "Vtákopysk", "questEggPlatypusMountText": "Vtákopysk", diff --git a/website/common/locales/sk/pets.json b/website/common/locales/sk/pets.json index 82aaba3184..f5a84f3272 100644 --- a/website/common/locales/sk/pets.json +++ b/website/common/locales/sk/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Nevlastníš tohto tátoša.", "feedPet": "Nakŕmiť <%= text %> tvojho/u <%= name %>?", "raisedPet": "Vychoval si svojho/u<%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Kľúč k výbehom zvieratiek", "keyToPetsDesc": "Vypusti všetky štandardné zvieratká aby si ich mohol nazbierať znovu. (Zvieratká z výprav a vzácne zvieratká nebudú ovplyvnené.)", "keyToMounts": "Kľúč k výbehom tátošov", diff --git a/website/common/locales/sr/content.json b/website/common/locales/sr/content.json index 13ea0240b6..c14daed2b3 100644 --- a/website/common/locales/sr/content.json +++ b/website/common/locales/sr/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor", "questEggVelociraptorMountText": "Velociraptor", "questEggVelociraptorAdjective": "a clever", - "eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Običan", "hatchingPotionWhite": "Beli", "hatchingPotionDesert": "Pustinjski", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Glow-in-the-Dark", "hatchingPotionFrost": "Frost", "hatchingPotionIcySnow": "Icy Snow", - "hatchingPotionNotes": "Pospite ovo po jajetu, i iz njega će se izleći <%= potText(locale) %> ljubimac.", + "hatchingPotionNotes": "Pospite ovo po jajetu, i iz njega će se izleći <%= potText %> ljubimac.", "foodMeat": "Meso", "foodMeatThe": "the Meat", "foodMeatA": "Meat", diff --git a/website/common/locales/sr/pets.json b/website/common/locales/sr/pets.json index 41d228e1c3..26a783de8e 100644 --- a/website/common/locales/sr/pets.json +++ b/website/common/locales/sr/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Ne posedujete ovog ljubimca za jahanje.", "feedPet": "Feed <%= text %> to your <%= name %>?", "raisedPet": "You grew your <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Key to the Pet Kennels", "keyToPetsDesc": "Release all standard Pets so you can collect them again. (Quest Pets and rare Pets are not affected.)", "keyToMounts": "Key to the Mount Kennels", diff --git a/website/common/locales/sv/content.json b/website/common/locales/sv/content.json index 98e1bf154a..7c4e83fbc0 100644 --- a/website/common/locales/sv/content.json +++ b/website/common/locales/sv/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velociraptor-husdjur", "questEggVelociraptorMountText": "Ridbar Velociraptor", "questEggVelociraptorAdjective": "en listig", - "eggNotes": "Hitta en kläckningsbrygd och häll på det här ägget så kommer det kläckas till <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Hitta en kläckningsbrygd och häll på det här ägget så kommer det kläckas till <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Normal", "hatchingPotionWhite": "Vit", "hatchingPotionDesert": "Öken", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "självlysande", "hatchingPotionFrost": "Frostig", "hatchingPotionIcySnow": "isig snö", - "hatchingPotionNotes": "Häll det över ett ägg, så kläcks det som Husdjuret <%= potText(locale) %>.", + "hatchingPotionNotes": "Häll det över ett ägg, så kläcks det som Husdjuret <%= potText %>.", "foodMeat": "Kött", "foodMeatThe": "köttet", "foodMeatA": "Kött", diff --git a/website/common/locales/sv/pets.json b/website/common/locales/sv/pets.json index b3a7947915..d31cadc571 100644 --- a/website/common/locales/sv/pets.json +++ b/website/common/locales/sv/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Du äger inte detta riddjur.", "feedPet": "Mata <%= text %> till din <%= name %>?", "raisedPet": "Du födde upp en <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Key to the Pet Kennels", "keyToPetsDesc": "Release all standard Pets so you can collect them again. (Quest Pets and rare Pets are not affected.)", "keyToMounts": "Key to the Mount Kennels", diff --git a/website/common/locales/tr/content.json b/website/common/locales/tr/content.json index e17a10d521..9edb8a8a85 100644 --- a/website/common/locales/tr/content.json +++ b/website/common/locales/tr/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Velosiraptor", "questEggVelociraptorMountText": "Velosiraptor", "questEggVelociraptorAdjective": "Zeki", - "eggNotes": "Bir kuluçka iksiri bulup bu yumurtanın üzerine döktüğünde yumurtadan <%= eggAdjective(locale) %> <%= eggText(locale) %> çıkacak.", + "eggNotes": "Bir kuluçka iksiri bulup bu yumurtanın üzerine döktüğünde yumurtadan <%= eggAdjective %> <%= eggText %> çıkacak.", "hatchingPotionBase": "Sıradan", "hatchingPotionWhite": "Beyaz", "hatchingPotionDesert": "Çorak", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "Karanlıkta Parlayan", "hatchingPotionFrost": "Donuk", "hatchingPotionIcySnow": "Buzlu Kar", - "hatchingPotionNotes": "Bunu yumurtanın üstüne döktüğünde <%= potText(locale) %> türünde bir hayvan çıkacak.", + "hatchingPotionNotes": "Bunu yumurtanın üstüne döktüğünde <%= potText %> türünde bir hayvan çıkacak.", "foodMeat": "Et", "foodMeatThe": "Et", "foodMeatA": "Et", @@ -405,7 +405,7 @@ "questEggAlpacaAdjective": "aşırı dolu", "hatchingPotionBalloon": "Balon", "hatchingPotionCryptid": "Kriptozit", - "wackyPotionNotes": "Bunu bir yumurtanın üstüne dök, bir Çılgın <%= potText(locale) %> olarak yumurtadan çıkacak.", + "wackyPotionNotes": "Bunu bir yumurtanın üstüne dök, bir Çılgın <%= potText %> olarak yumurtadan çıkacak.", "wackyPotionAddlNotes": "Bineklere yükseltilemez veya Görev Evcil Hayvanı yumurtalarında kullanılamaz.", "questEggPlatypusText": "Ornitorenk", "questEggPlatypusMountText": "Ornitorenk", diff --git a/website/common/locales/tr/pets.json b/website/common/locales/tr/pets.json index 9c497cd2e1..6e453af9c9 100644 --- a/website/common/locales/tr/pets.json +++ b/website/common/locales/tr/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "Bu bineğe sahip değilsin.", "feedPet": "<%= name %>, <%= text %> ile beslensin mi?", "raisedPet": "Bir <%= pet %> yetiştirdin!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Hayvan Kulübelerinin Anahtarı", "keyToPetsDesc": "Tekrardan toplamaya başlayabilmek için tüm standart Hayvanları sal. (Görev Hayvanları ve nadir Hayvanlar etkilenmez.)", "keyToMounts": "Binek Kulübelerinin Anahtarı", diff --git a/website/common/locales/uk/content.json b/website/common/locales/uk/content.json index 23421612a4..f1438e4ddb 100644 --- a/website/common/locales/uk/content.json +++ b/website/common/locales/uk/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "Велоцираптор", "questEggVelociraptorMountText": "Велоцираптор", "questEggVelociraptorAdjective": "розумний", - "eggNotes": "Знайдіть інкубаційне зілля, аби вилити на це яйце, і з нього вилупиться <%= eggAdjective(locale) %> <%= eggText(locale) %>.", + "eggNotes": "Знайдіть інкубаційне зілля, аби вилити на це яйце, і з нього вилупиться <%= eggAdjective %> <%= eggText %>.", "hatchingPotionBase": "Звичайний", "hatchingPotionWhite": "Білий", "hatchingPotionDesert": "Пустельний", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "В-темряві-сяючий", "hatchingPotionFrost": "Морозний", "hatchingPotionIcySnow": "Крижаний сніг", - "hatchingPotionNotes": "Вилийте це на яйце, і з нього вилупиться улюбленець, типу \"<%= potText(locale) %>\".", + "hatchingPotionNotes": "Вилийте це на яйце, і з нього вилупиться улюбленець, типу \"<%= potText %>\".", "foodMeat": "М'ясо", "foodMeatThe": "М'ясо", "foodMeatA": "М'ясо", @@ -404,7 +404,7 @@ "questEggOtterMountText": "видра", "questEggOtterAdjective": "підступний", "hatchingPotionCryptid": "Містичний", - "wackyPotionNotes": "Вилийте це на яйце, і з нього вилупиться Дивний улюбленець, типу \"<%= potText(locale) %>\".", + "wackyPotionNotes": "Вилийте це на яйце, і з нього вилупиться Дивний улюбленець, типу \"<%= potText %>\".", "wackyPotionAddlNotes": "Не може бути використано на яйцях з Квестовими улюбленцями.", "hatchingPotionBalloon": "Надувний" } diff --git a/website/common/locales/uk/pets.json b/website/common/locales/uk/pets.json index d1c46d6864..dc7b86b96e 100644 --- a/website/common/locales/uk/pets.json +++ b/website/common/locales/uk/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "У вас немає цього скакуна.", "feedPet": "Згодувати <%= text %> <%= name %>?", "raisedPet": "Ви виростили <%= pet %>!", - "petName": "<%= potion(locale) %> <%= egg(locale) %>", - "mountName": "<%= potion(locale) %> <%= mount(locale) %>", + "petName": "<%= potion %> <%= egg %>", + "mountName": "<%= potion %> <%= mount %>", "keyToPets": "Ключ від розплідника", "keyToPetsDesc": "Звільніть усіх звичайних улюбленців, щоб ви могли знову їх зібрати. (Квестові та рідкісні улюбленці залишаться.)", "keyToMounts": "Ключ від загонів", diff --git a/website/common/locales/zh/content.json b/website/common/locales/zh/content.json index c60c3b8ac7..3b8af658fb 100644 --- a/website/common/locales/zh/content.json +++ b/website/common/locales/zh/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "迅猛龙", "questEggVelociraptorMountText": "迅猛龙", "questEggVelociraptorAdjective": "一只聪明的", - "eggNotes": "将一瓶孵化药水倒在这枚蛋上,它就会孵化出<%= eggAdjective(locale) %><%= eggText(locale) %>。", + "eggNotes": "将一瓶孵化药水倒在这枚蛋上,它就会孵化出<%= eggAdjective %><%= eggText %>。", "hatchingPotionBase": "普通", "hatchingPotionWhite": "白色", "hatchingPotionDesert": "沙漠", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "荧光", "hatchingPotionFrost": "霜", "hatchingPotionIcySnow": "冰雪", - "hatchingPotionNotes": "把它倒在宠物蛋上可以孵化出一只<%= potText(locale) %>宠物。", + "hatchingPotionNotes": "把它倒在宠物蛋上可以孵化出一只<%= potText %>宠物。", "foodMeat": "肉", "foodMeatThe": "肉", "foodMeatA": "肉", @@ -404,7 +404,7 @@ "hatchingPotionCryptid": "神秘生物", "questEggAlpacaText": "羊驼", "questEggAlpacaMountText": "羊驼", - "wackyPotionNotes": "将药水倒在宠物蛋上,就会孵化出一只古怪的<%= potText(locale) %> 宠物。", + "wackyPotionNotes": "将药水倒在宠物蛋上,就会孵化出一只古怪的<%= potText %> 宠物。", "wackyPotionAddlNotes": "无法升级为坐骑或用于副本宠物蛋。", "questEggPlatypusText": "鸭嘴兽", "questEggPlatypusMountText": "鸭嘴兽", diff --git a/website/common/locales/zh/pets.json b/website/common/locales/zh/pets.json index e6a561607e..3b29e1df15 100644 --- a/website/common/locales/zh/pets.json +++ b/website/common/locales/zh/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "你没有这只坐骑。", "feedPet": "要用<%= name %>喂你的<%= text %>吗?", "raisedPet": "你的<%= pet %>长大了!", - "petName": "<%= potion(locale) %><%= egg(locale) %>", - "mountName": "<%= potion(locale) %><%= mount(locale) %>", + "petName": "<%= potion %><%= egg %>", + "mountName": "<%= potion %><%= mount %>", "keyToPets": "宠物栏钥匙", "keyToPetsDesc": "释放所有基础宠物,以便再次收集。(副本宠物和稀有宠物不受影响。)", "keyToMounts": "坐骑栏钥匙", diff --git a/website/common/locales/zh_TW/content.json b/website/common/locales/zh_TW/content.json index 764e8dedfc..9c92496f77 100644 --- a/website/common/locales/zh_TW/content.json +++ b/website/common/locales/zh_TW/content.json @@ -182,7 +182,7 @@ "questEggVelociraptorText": "迅猛龍", "questEggVelociraptorMountText": "迅猛龍", "questEggVelociraptorAdjective": "一隻機靈的", - "eggNotes": "將孵化藥水倒在這顆寵物蛋上,它就能孵化成<%= eggAdjective(locale) %><%= eggText(locale) %>。", + "eggNotes": "將孵化藥水倒在這顆寵物蛋上,它就能孵化成<%= eggAdjective %><%= eggText %>。", "hatchingPotionBase": "普通", "hatchingPotionWhite": "灰白", "hatchingPotionDesert": "沙漠", @@ -211,7 +211,7 @@ "hatchingPotionGlow": "螢光", "hatchingPotionFrost": "冰霜", "hatchingPotionIcySnow": "冰雪", - "hatchingPotionNotes": "將它倒在寵物蛋上即可孵化出一隻<%= potText(locale) %>寵物。", + "hatchingPotionNotes": "將它倒在寵物蛋上即可孵化出一隻<%= potText %>寵物。", "foodMeat": "肉", "foodMeatThe": "肉", "foodMeatA": "肉", diff --git a/website/common/locales/zh_TW/pets.json b/website/common/locales/zh_TW/pets.json index f7eb4413c7..edbafe2551 100644 --- a/website/common/locales/zh_TW/pets.json +++ b/website/common/locales/zh_TW/pets.json @@ -66,8 +66,8 @@ "mountNotOwned": "你不擁有這匹坐騎。", "feedPet": "餵食<%= name %><%= text %>?", "raisedPet": "你養育了你的<%= pet %>!", - "petName": "<%= potion(locale) %><%= egg(locale) %>", - "mountName": "<%= potion(locale) %><%= mount(locale) %>", + "petName": "<%= potion %><%= egg %>", + "mountName": "<%= potion %><%= mount %>", "keyToPets": "寵物之家的鑰匙", "keyToPetsDesc": "釋放所有標準寵物來重新收集牠們。(副本寵物以及稀有寵物將不會被影響。)", "keyToMounts": "坐騎之家的鑰匙", diff --git a/website/common/script/i18n.js b/website/common/script/i18n.js index 782504cf87..4b4dab3e37 100644 --- a/website/common/script/i18n.js +++ b/website/common/script/i18n.js @@ -1,6 +1,11 @@ import isString from 'lodash/isString'; +import isFunction from 'lodash/isFunction'; import clone from 'lodash/clone'; -import template from 'lodash/template'; +import { render } from 'micromustache'; + +function hrender (template, vars) { + return render(template, vars, { tags: ['<%= ', '%>'] }); +} const i18n = { strings: null, @@ -35,12 +40,17 @@ function t (stringName) { } const clonedVars = clone(vars) || {}; + for (const key in clonedVars) { + if (Object.prototype.hasOwnProperty.call(clonedVars, key) && isFunction(clonedVars[key])) { + clonedVars[key] = clonedVars[key](); + } + } clonedVars.locale = locale; if (string) { try { - return template(string)(clonedVars); + return hrender(string, clonedVars); } catch (_error) { return `Error processing the string "${stringName}". Please see Help > Report a Bug.`; } @@ -54,7 +64,7 @@ function t (stringName) { } try { - return template(stringNotFound)({ + return hrender(stringNotFound, { string: stringName, }); } catch (_error) { diff --git a/website/server/controllers/api-v3/i18n.js b/website/server/controllers/api-v3/i18n.js index 8078e16fa5..c8a1231dc8 100644 --- a/website/server/controllers/api-v3/i18n.js +++ b/website/server/controllers/api-v3/i18n.js @@ -1,7 +1,8 @@ import nconf from 'nconf'; import { BROWSER_SCRIPT_CACHE_PATH, - geti18nBrowserScript, + geti18nCoreBrowserScript, + geti18nContentBrowserScript, } from '../../libs/i18n'; const IS_PROD = nconf.get('IS_PROD'); @@ -9,28 +10,56 @@ const IS_PROD = nconf.get('IS_PROD'); const api = {}; /** - * @api {get} /api/v3/i18n/browser-script Returns the i18n JS script. + * @api {get} /api/v3/i18n/core Returns the i18n JS script. * @apiDescription Returns the i18n JS script to make * all the i18n strings available in the browser under window.i18n.strings. * Does not require authentication. * @apiName i18nBrowserScriptGet * @apiGroup i18n */ -api.geti18nBrowserScript = { +api.geti18nCoreBrowserScript = { method: 'GET', - url: '/i18n/browser-script', + url: '/i18n/core', async handler (req, res) { if (IS_PROD) { res.set({ 'Cache-Control': 'private', }); - res.sendFile(`${BROWSER_SCRIPT_CACHE_PATH}${req.language}.js`); + res.sendFile(`${BROWSER_SCRIPT_CACHE_PATH}core/${req.language}.js`); } else { res.set({ 'Content-Type': 'application/javascript', }); - const jsonResString = geti18nBrowserScript(req.language); + const jsonResString = geti18nCoreBrowserScript(req.language); + res.status(200).send(jsonResString); + } + }, +}; + +/** + * @api {get} /api/v3/i18n/content Returns the i18n JS script. + * @apiDescription Returns the i18n JS script to make + * all the i18n strings available in the browser under window.i18n.strings. + * Does not require authentication. + * @apiName i18nBrowserScriptGet + * @apiGroup i18n + */ +api.geti18nContentBrowserScript = { + method: 'GET', + url: '/i18n/content', + async handler (req, res) { + if (IS_PROD) { + res.set({ + 'Cache-Control': 'private', + }); + res.sendFile(`${BROWSER_SCRIPT_CACHE_PATH}content/${req.language}.js`); + } else { + res.set({ + 'Content-Type': 'application/javascript', + }); + + const jsonResString = geti18nContentBrowserScript(req.language); res.status(200).send(jsonResString); } }, diff --git a/website/server/libs/i18n.js b/website/server/libs/i18n.js index 0b88e19307..546227afee 100644 --- a/website/server/libs/i18n.js +++ b/website/server/libs/i18n.js @@ -7,7 +7,8 @@ export const localePath = path.join(__dirname, '../../common/locales/'); export const BROWSER_SCRIPT_CACHE_PATH = path.join(__dirname, '/../../../i18n_cache/'); // Store translations -export const translations = {}; +export const coreTranslations = {}; +export const contentTranslations = {}; // Store MomentJS localization files export const momentLangs = {}; @@ -29,16 +30,32 @@ export const approvedLanguages = [ 'sr', 'sv', 'tr', 'uk', 'zh', 'zh_TW', ]; +const contentFileNames = [ + 'achievements.json', + 'backgrounds.json', + 'content.json', + 'customizations.json', + 'gear.json', + 'questscontent.json', + 'pets.json', + 'spells.json', +]; + function _loadTranslations (locale) { const files = fs.readdirSync(path.join(localePath, locale)); - translations[locale] = {}; + coreTranslations[locale] = {}; + contentTranslations[locale] = {}; files.forEach(file => { if (path.extname(file) !== '.json') return; // We use require to load and parse a JSON file - _.merge(translations[locale], require(path.join(localePath, locale, file))); // eslint-disable-line global-require, import/no-dynamic-require, max-len + if (contentFileNames.includes(file.toLowerCase)) { + _.merge(contentTranslations[locale], require(path.join(localePath, locale, file))); // eslint-disable-line global-require, import/no-dynamic-require, max-len + } else { + _.merge(coreTranslations[locale], require(path.join(localePath, locale, file))); // eslint-disable-line global-require, import/no-dynamic-require, max-len + } }); } @@ -51,18 +68,23 @@ approvedLanguages.forEach(file => { _loadTranslations(file); // Strip empty strings, then merge missing strings from english - translations[file] = _.pickBy(translations[file], string => string !== ''); - _.defaults(translations[file], translations.en); + coreTranslations[file] = _.pickBy(coreTranslations[file], string => string !== ''); + _.defaults(coreTranslations[file], coreTranslations.en); + + // Strip empty strings, then merge missing strings from english + contentTranslations[file] = _.pickBy(contentTranslations[file], string => string !== ''); + _.defaults(contentTranslations[file], contentTranslations.en); }); // Add translations to shared +export const translations = _.merge({}, coreTranslations, contentTranslations); shared.i18n.translations = translations; -export const langCodes = Object.keys(translations); +export const langCodes = Object.keys(coreTranslations); export const availableLanguages = langCodes.map(langCode => ({ code: langCode, - name: translations[langCode].languageName, + name: coreTranslations[langCode].languageName, })); langCodes.forEach(code => { @@ -118,7 +140,7 @@ export const multipleVersionsLanguages = { }, }; -export function geti18nBrowserScript (languageCode) { +export function geti18nCoreBrowserScript (languageCode) { const language = _.find(availableLanguages, { code: languageCode }); return `(function () { @@ -126,8 +148,12 @@ export function geti18nBrowserScript (languageCode) { window['habitica-i18n'] = ${JSON.stringify({ availableLanguages, language, - strings: translations[languageCode], + strings: coreTranslations[languageCode], momentLang: momentLangs[languageCode], })}; })()`; } + +export function geti18nContentBrowserScript (languageCode) { + return JSON.stringify(contentTranslations[languageCode]); +} diff --git a/website/server/middlewares/language.js b/website/server/middlewares/language.js index bb9bbacb0e..dac2b4f4e5 100644 --- a/website/server/middlewares/language.js +++ b/website/server/middlewares/language.js @@ -1,7 +1,7 @@ import { model as User } from '../models/user'; import common from '../../common'; import { - translations, + coreTranslations, } from '../libs/i18n'; import { getLanguageFromUser, @@ -21,7 +21,7 @@ export function attachTranslateFunction (req, res, next) { export function getUserLanguage (req, res, next) { // In case the language is specified in the request url, use intersection if (req.query.lang) { - req.language = translations[req.query.lang] ? req.query.lang : 'en'; + req.language = coreTranslations[req.query.lang] ? req.query.lang : 'en'; return next(); }