olivierperez / o80-i18n

PHP i18n (internationalization) system.
Apache License 2.0
12 stars 5 forks source link

production: use default key if no translation available #7

Open bagage opened 8 years ago

bagage commented 8 years ago

Instead of returning [missing key: $KEY], at least in production code, could it be possible to return $KEY instead? In case of missing translations, having mixed languages is (I believe) OK and quite common but having some debug statements instead is quite unnatural for end users.

olivierperez commented 8 years ago

Hi,

Having an ugly text when there is no translation is a choice. At development time, the developers/testers clearly see that there is something missing. If we replace it by the key, the user may think it is the right word when it is not.

bagage commented 8 years ago

Absolutely, and I do agree with that. But I am talking about production code here, where some translations might be missing anyway (because you cannot force translators to do all translations before going to production).

olivierperez commented 8 years ago

Actually, you can tell translators to translate all keys :smiley:, by not release an not-translated language by example.

By the way, I understand your position. If you want to propose a Pull Resquest for this feature it's OK.

It should be disabled by default, and have to be configurable like this :

Are you fine with it?

bagage commented 8 years ago

What do you mean by "by word" and by "by key"? For instance __("Comment", "Add another comment") should return, for French:

olivierperez commented 8 years ago

Yes for the "by key", "another sentence picked from French keys" is what I meant.

Actually it was just an idea. I prefer the mode "original" for my projects.