From: Martin D. <ma...@do...> - 2002-12-08 17:03:28
|
Hi, OK, I've implemented a scheme to allow the language packs to set the locale. As a result, when the user changes their language then all the dates, numbers etc will change to suit the language. This new code will be in the next release (I'm now calling it 1.0.7) .. It's only a few lines in lib/setup.php I've set default locale codes for all current language packs as a string called 'locale' in moodle.php: ar/moodle.php:$string['locale'] = "ar"; ca/moodle.php:$string['locale'] = "ca_ES"; de/moodle.php:$string['locale'] = "de_DE"; en/moodle.php:$string['locale'] = "en_GB"; en_us/moodle.php:$string['locale'] = "en_US"; es_es/moodle.php:$string['locale'] = "es_ES"; es_mx/moodle.php:$string['locale'] = "es_MX"; fi/moodle.php:$string['locale'] = "fi_FI"; fr/moodle.php:$string['locale'] = "fr_FR"; id/moodle.php:$string['locale'] = "id_ID"; it/moodle.php:$string['locale'] = "it_IT"; ja/moodle.php:$string['locale'] = "ja_JP"; no/moodle.php:$string['locale'] = "no_NO"; pt_br/moodle.php:$string['locale'] = "pt_BR"; zh_cn/moodle.php:$string['locale'] = "zh_CN"; (So be aware of the changed file if you're using CVS) These are fairly generic codes that should work on most Unix, Linux and Windows machines, most of the time. The admin can still set the locale code for the main site language if they want to (or they have a funny machine that uses different locale codes). If the user language is the same as the site language, then this admin locale will be used for the user (ie it OVERRIDES the language-pack locale). Since 99% of installations are single-language this should work quite well for any server. Leaving the admin locale blank will make Moodle choose the locale from the current site language file. Please test the new setup and let me know if there's any problems with this scheme. Cheers, Martin -- /* My open-source course management system: http://moodle.com */ |