Locales

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Locales

Post by cmb » Fri Jul 05, 2013 6:38 pm

I have implemented a minimal locale handling (r695). There is a new language setting $tx['locale']['all'] (for lack of a better name; might be useful, if the locale handling will sometimes be extended, however). If it is empty, setlocale() will not be called, so the default locale of the server (more exactly the user running PHP) will be used. If it has a value, setlocale() is called directly after reading the language file; if it fails, no error message is given. The system check reports whether the default locale is in use, or otherwise whether the locale is available.

I made no attempt to make it easier for users to find the right locale. It seems, that mostly relying on the default locale should be enough (at least for single language installations). Furthermore the core of CMSimple_XH doesn't use any locale dependent stuff (CMIIW). This new handling is primarily meant to unify the handling of locales in plugins, and we have to see if plugin authors will use it, i.e. remove their own setlocale() calls.

I suggest to make the following recommendation for plugin developers:
  • try to avoid locale dependent functionality
  • otherwise rely on the correct setting in the core (at least where it is available)
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Locales

Post by cmb » Fri Sep 13, 2013 10:16 pm

I just stumbled upon https://bugs.php.net/bug.php?id=65230--interesting comments. :)
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply