You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if messageToTranslate is a string, search it in the translations (already implemented)
if messageToTranslate is an Object, it must have the format:
{
"message": "bla bla bla",
"args": [1, 2, "bla"]
}
In this case, the message key will be searched for in translations. If the text contains %1, %2, %3, etc., they will be replaced from the args array with the argument in the array at position i-1. %N where N > args.length will be ignored (i.e. not replaced at all)
The text was updated successfully, but these errors were encountered:
Enhance the
translate
function as follows:messageToTranslate
is astring
, search it in the translations (already implemented)messageToTranslate
is anObject
, it must have the format:In this case, the message key will be searched for in translations. If the text contains
%1
,%2
,%3
, etc., they will be replaced from theargs
array with the argument in the array at positioni-1
.%N
whereN > args.length
will be ignored (i.e. not replaced at all)The text was updated successfully, but these errors were encountered: