CodeIgniter Forums
Codeigniter calendar language problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Codeigniter calendar language problem (/showthread.php?tid=53637)



Codeigniter calendar language problem - El Forum - 08-01-2012

[eluser]lucas123[/eluser]
I'm trying to get the calendar in CodeIgniter to print month names in Polish.

In config.php I have this line:
Code:
$config ['language'] = 'polish';
In autoload.php I have this line:
Code:
$autoload ['language'] = array ('calendar');
In my controller:
Code:
$this->lang->load('calendar', 'polish');

So here I am trying to print the date:
Code:
echo mdate('%F');

The result is: August

Month names are printed in English, which is wrong, I want it in Polish. I have calendar_lang.php in Polish.

Any advice on how I solve this?
Please help...


Codeigniter calendar language problem - El Forum - 08-01-2012

[eluser]PhilTem[/eluser]
Code:
setlocale('pl_PL');

because your server will probably be set to english-locale


Codeigniter calendar language problem - El Forum - 08-02-2012

[eluser]lucas123[/eluser]
Thanks. I use
Code:
setlocale('pl_PL');
but the function mdate(); doesn't work with setlocale() so I used strftime() but now I have problem with encoding because I don't have polish characters. Display text is in "ISO-8859-2" I need "UTF-8"?


Codeigniter calendar language problem - El Forum - 08-02-2012

[eluser]Aken[/eluser]
Make sure you have the appropriate headers and/or meta data for displaying UTF-8 characters on the web. You might also need to wrap the results in utf8_encode(), but I would verify the former first.


Codeigniter calendar language problem - El Forum - 08-03-2012

[eluser]lucas123[/eluser]
Headers are ok. I do that and now is ok:
Code:
setlocale(LC_TIME, "polish");
echo iconv("ISO-8859-2","UTF-8",strftime('%B'));
Thanks for help