Closed helmo closed 5 years ago
I appreciate the idea and agree that a translation of error messages would be nice. However, there is one annoying thing about the gettext()
implementation in Roundcube:
In case it does not find a matching translation, it puts the text in square brackets:
So as long as the most common error messages are not translated, wrapping messages by gettext()
will probably not be helpful.
Are brackets so bad? I don't think it out weighs the possibility to translate. (a chicken/egg thing, the common errors will probably get translated after it's possible)
As with any new translation strings, we could add a copy of the English string in each language file.
I have now found a solution that tackles brackets for untranslated texts:
Instead of directly calling gettext
with SOAP error messages, we first check if a translation exists using text_exists
. If this is the case, it is fetched using gettext
, otherwise the original string is shown.
It may be hard to include every possible error in the translation files.... but would be nice to add a few common ones.
Would you be interested in this? The same change would have to be added in more catch blocks.