groupoffice icon indicating copy to clipboard operation
groupoffice copied to clipboard

Translation - dontFallBack

Open michalcharvat opened this issue 2 years ago • 7 comments

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.

michalcharvat avatar Mar 16 '22 10:03 michalcharvat

I don't understand why you have to pass it all the time? It's actually never used in the standard code base.

mschering avatar Mar 17 '22 07:03 mschering

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".

michalcharvat avatar Mar 17 '22 18:03 michalcharvat

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.

mschering avatar Mar 17 '22 20:03 mschering

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 :)

michalcharvat avatar Mar 21 '22 22:03 michalcharvat

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.

mschering avatar Mar 22 '22 07:03 mschering

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

michalcharvat avatar Mar 29 '22 21:03 michalcharvat

I think this modifcation would lead to problems as we rely on fallbacks everywhere.

mschering avatar Jul 19 '22 08:07 mschering