mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Check for missing localization strings also client side (dev mode only)
This commit is contained in:
parent
4aee175105
commit
c048f403e6
@ -236,6 +236,11 @@ Grocy.Api.Get("system/localization-strings?v=" + Grocy.Version + "&language=" +
|
||||
function(response)
|
||||
{
|
||||
Grocy.Translator = new Translator(response);
|
||||
|
||||
if (Grocy.Mode === "dev")
|
||||
{
|
||||
Grocy.LocalizationStrings = response.messages[""];
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@ -247,8 +252,11 @@ __t = function(text, ...placeholderValues)
|
||||
if (Grocy.Mode === "dev")
|
||||
{
|
||||
var text2 = text;
|
||||
if (Grocy.LocalizationStrings && !Grocy.LocalizationStrings.hasOwnProperty(text2))
|
||||
{
|
||||
Grocy.Api.Post('system/log-missing-localization', { "text": text2 });
|
||||
}
|
||||
}
|
||||
|
||||
return Grocy.Translator.__(text, ...placeholderValues)
|
||||
}
|
||||
@ -257,8 +265,11 @@ __n = function(number, singularForm, pluralForm)
|
||||
if (Grocy.Mode === "dev")
|
||||
{
|
||||
var singularForm2 = singularForm;
|
||||
if (Grocy.LocalizationStrings && !Grocy.LocalizationStrings.hasOwnProperty(singularForm2))
|
||||
{
|
||||
Grocy.Api.Post('system/log-missing-localization', { "text": singularForm2 });
|
||||
}
|
||||
}
|
||||
|
||||
return Grocy.Translator.n__(singularForm, pluralForm, number, number)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user