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
Now, whenever i am trying to render this HTML, it will not give me values for keys "title" and "last" because they are not in "name" nameSpace.
So, i need some fallback which look into default nameSpace if key is not found in given nameSpace.
So, I added "found = translate(key);" inside last if condition of "_translate" function and its working fine but its recursive function call. So, it may affect the performance.
Code :
if (found === undefined) {
notfound = applyReplacement(notfound, options);
notfound = applyReuse(notfound, options);
//Added line for namespace fallback...
found = translate(key);
}
The text was updated successfully, but these errors were encountered:
starting from v1.5.11 (release should be this week) you could set option fallbackToDefaultNS = true in init options to turn on this behaviour. (default is false)
I have following JSON for language, Handlebars helper and HTML
JSON for language
Handlebars helper
HTML
var nameSpace = {
ns : 'name'
};
Now, whenever i am trying to render this HTML, it will not give me values for keys "title" and "last" because they are not in "name" nameSpace.
So, i need some fallback which look into default nameSpace if key is not found in given nameSpace.
So, I added "found = translate(key);" inside last if condition of "_translate" function and its working fine but its recursive function call. So, it may affect the performance.
Code :
The text was updated successfully, but these errors were encountered: