Hi,
I'd like to display the dates in format %A, %d.%m.%Y so that the day names would be in my language (Estonian; Pühapäev instead of Sunday, esmaspäev instead of Monday etc). I also read some threads about language issues here. I tested my host server also with list_locales.php and additionally checked the gettext function and how the day name is displayed by this file. Results:
Http Accept Languages:
Key 1.0-et
code et
coef 1.0
morecode
fullcode et
Supported locales:
And gettext + day name:
Gettext: Yes
Sunday
Is there any way to give my language at least to the day name in frontend? As I understand, there are no supported locales at all although Http Accept Language is Estonian. And gettext is available.
Comments
Just an empty folder? It didn't help. Only change I see is the error message above the option "Estonian" in admin side where I can choose preferred languages:
Warning: file_get_contents(/.../zp-core/locale/EE/LC_MESSAGES/zenphoto.po) [function.file-get-contents]: failed to open stream: No such file or directory in /.../zp-core/admin-options.php on line 625
As I mentioned, the server told me that the only "Http Accept Language" is Estonian (et) and there is no supported locales!
Maybe the empty folder should be et_EE (and line 58 in functions-i18n.php as well)? And I should choose the Http accept language?
For mimicing et_EE locale files (=translation files which do not cover the months names!) is not possible with an empty folder. Our script of course expects actual translation files to be there, thus the warning.
The only idea I have would be to create empty translations files to mimic them being there. Please see the translation tutorial for that. You can't duplicate and rename any of the existing ones as then you would of course get those translations.
For example Joomla translation files are working well in my host server despite there is no et-EE support.
Zenphoto does two things in dealing with local languages.
First, it uses gettext() calls for all text so that localization can be made from the .mo & .po files are required for this stage. But incomplete (empty?) files can work to an extent. Of course, only text strings for which there are translations will display in the local language. Others will display in English.
Second, Zenphoto sets the "locale" via a setLocale() function call to tell PHP and the Server what language (locale) is to be used. Certain strings, particularly the Date strings are produced by the PHP runtime and are based on this locale setting.
Setting the locale can fail if the server does not support the desired locale. If you select the language from the back-end you should see an error message about the failure. The automatic setting of locale, such as from the HTTP Accept Language of the browser may happen in places where the error message display does not go to the browser.
If the locale setting fails, the language will not be available. There is a define at the beginning of functions-i18n.php for `DEBUG_LOCALE`. Setting this to the value `true` will produce debug log records which may help in diagnosing locale issues.