mirror of
https://github.com/grocy/grocy.git
synced 2025-10-15 01:37:13 +00:00
Finished migration to use gettext (this now closes #161)
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
//TODO: Missing translations should be automatically added to the source POT file
|
||||
Grocy.Translator = new Translator(Grocy.JsGettextTranslatorStrings);
|
||||
Grocy.Translator = new Translator(Grocy.GettextPo);
|
||||
__t = function(text, ...placeholderValues)
|
||||
{
|
||||
if (Grocy.Mode === "dev")
|
||||
{
|
||||
var text2 = text;
|
||||
Grocy.Api.Post('system/log-missing-localization', { "text": text2 });
|
||||
}
|
||||
|
||||
return Grocy.Translator.__(text, ...placeholderValues)
|
||||
}
|
||||
__n = function(number, singularForm, pluralForm)
|
||||
{
|
||||
return Grocy.Translator.n__(singularForm, pluralForm, number)
|
||||
if (Grocy.Mode === "dev")
|
||||
{
|
||||
var singularForm2 = singularForm;
|
||||
Grocy.Api.Post('system/log-missing-localization', { "text": singularForm2 });
|
||||
}
|
||||
|
||||
return Grocy.Translator.n__(singularForm, pluralForm, number, number)
|
||||
}
|
||||
|
||||
U = function(relativePath)
|
||||
|
Reference in New Issue
Block a user