groupoffice
groupoffice copied to clipboard
Translation - dontFallBack
It would be nice to change default logic - currently you have to always define dontFallBack to false to all translations. I guess there have to be reverse logic. fallback have to be called only when it is necessary.
I don't understand why you have to pass it all the time? It's actually never used in the standard code base.
Without all translation on module layer with this default fallback is the text translated via core locales. You can test it with string "Number" - just remove all files from locales except en.php and switch language to Dutch. The expected output is "Number".
Yes but this is intended. If you translate t("Number") it is first looked up in the module and if it's not there it falls back on the core language so that not every module needs to have duplicate translations.
Not sure if this is good because the module without translations could be also an option. So even if you add there option use English words instead of translation mark, you have to always define at least en.php (even it is not needed) or provide parameter dontFallBack. Not sure if for Dutch but for example Czech translation for Number have 18 different meanings - not always different but similar :)
But it never falls back on English? It falls back on the core translation in your language for common words. It only falls back to the string passed to t() which is mostly english if nothing has been found.
Well when you use english string in t() it is not necessary define translations in en.php :) That is the main reason why the string is translated immediately via fallback
I think this modifcation would lead to problems as we rely on fallbacks everywhere.