If you don't know how 'zh_TW.utf8' comes from read How Do Unix Locales Work?
First take a look at my Unix and shell's version:
ubuntu@domU-1:~$ cat /etc/issue
Ubuntu 10.04.4 LTS
ubuntu@domU-1:~$ bash -version
GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)
Take a look at my Joomla version
Amazon The following is information shown by going to Site -> System Information.
|PHP Built On||Linux ip-10-1-2-3 4.5.6-7-ec2 #18-Ubuntu SMP Mon Oct 18 21:00:20 UTC 2010 i686|
|Web Server||Apache/2.2.14 (Ubuntu)|
|WebServer to PHP Interface||apache2handler|
|Joomla! Version||Joomla! 2.5.4 Stable [ Ember ] 2-April-2012 14:00 GMT|
|Joomla! Platform Version||Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT|
|User Agent||Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19|
As you can see I use Joomla 2.5.4, but this tutorial applies to every previous version of Joomla. If not let me know!
See if the desired locale is available on your system
First you need to know if the locale you want to set is available on your system. Please read How Do Unix Locales Work? if you don't know how to do it.
Find the place where you'd like to set the locale. Usually this place is prior to your view that is supposed to use the locale so that it can display the characters correctly.
For example if I am to set the locale to 'zh_TW.utf8' in 'pbbooking' component, a popular appointment component, then I add the following in the entry PHP script of the component which is components/com_pbbooking/views/pbbooking/view.html.php:
defined( '_JEXEC' ) or die( 'Restricted access' ); setlocale(LC_ALL, 'zh_TW.utf8');That's it. Easy right?
If you have any questions let me know and I will do my best to help you!