mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-22 13:48:24 +00:00
Merge pull request #460 from negue/fullTranslation
add a locale var to all translations
This commit is contained in:
commit
419b6bf611
2 changed files with 6 additions and 3 deletions
|
|
@ -72,7 +72,7 @@
|
|||
"questEggTRexText": "Tyrannosaur",
|
||||
"questEggTRexAdjective": "tiny-armed",
|
||||
|
||||
"eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into a <%= eggAdjective() %> <%= eggText() %>.",
|
||||
"eggNotes": "Find a hatching potion to pour on this egg, and it will hatch into a <%= eggAdjective(locale) %> <%= eggText(locale) %>.",
|
||||
|
||||
"hatchingPotionBase": "Base",
|
||||
"hatchingPotionWhite": "White",
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
"hatchingPotionCottonCandyBlue": "Cotton Candy Blue",
|
||||
"hatchingPotionGolden": "Golden",
|
||||
|
||||
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText() %> pet.",
|
||||
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> pet.",
|
||||
|
||||
"foodMeat": "Meat",
|
||||
"foodMilk": "Milk",
|
||||
|
|
|
|||
|
|
@ -15,10 +15,13 @@ module.exports =
|
|||
|
||||
locale = 'en' if (!locale? or (!module.exports.strings and !module.exports.translations[locale]))
|
||||
string = if (!module.exports.strings) then module.exports.translations[locale][stringName] else module.exports.strings[stringName]
|
||||
|
||||
clonedVars = _.clone(vars) or {};
|
||||
clonedVars.locale = locale;
|
||||
|
||||
if string
|
||||
try
|
||||
_.template(string, (vars or {}))
|
||||
_.template(string, (clonedVars))
|
||||
catch e
|
||||
'Error processing string. Please report to http://github.com/HabitRPG/habitrpg.'
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue