Welcome Guest, Not a member yet? Register   Sign In
Codeigniter calendar language problem
#1

[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...
#2

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

because your server will probably be set to english-locale
#3

[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"?
#4

[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.
#5

[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




Theme © iAndrew 2016 - Forum software by © MyBB