Welcome Guest, Not a member yet? Register   Sign In
Change language for calendar
#1

[eluser]Mutsop[/eluser]
Hi,

How is it possible to change the names of the days and months into another language?
I found out in the change logs, they apparenlty implemented this function a few months ago.

Regards
#2

[eluser]Cristian Gilè[/eluser]
Hi Mutsop,

under application/language/yourlanguage folder create a file named calendar_lang.php and within that file assign each line of text to an array called $lang like this:

https://bitbucket.org/ellislab/codeignit...r_lang.php

Cristian Gilè
#3

[eluser]some1ell[/eluser]
It doesn't work Sad where is the source? I still get February instead of Februar
#4

[eluser]InsiteFX[/eluser]
You have to load it
Code:
$this->lang->load('filename', 'language');
// then use:
$this->lang->line('language_key');

InsiteFX
#5

[eluser]some1ell[/eluser]
Sorry..I am very new to this =) can you tell me more...where do I write this or include that? and what about language_key? Sorry =)
#6

[eluser]InsiteFX[/eluser]
This is all in the User Guide!

InsiteFX
#7

[eluser]some1ell[/eluser]
ok, thank you Wink
#8

[eluser]some1ell[/eluser]
still nothing=)

i have a file koledar_lang.php in this folder --> /system/application/language/english

Source of this file is:

Code:
<?php

$lang['cal_jan']        = "Jan";
$lang['cal_feb']        = "Feb";
$lang['cal_mar']        = "Mar";
$lang['cal_apr']        = "Apr";
$lang['cal_may']        = "Maj";
$lang['cal_jun']        = "Jun";
$lang['cal_jul']        = "Jul";
$lang['cal_aug']        = "Avg";
$lang['cal_sep']        = "Sep";
$lang['cal_oct']        = "Okt";
$lang['cal_nov']        = "Nov";
$lang['cal_dec']        = "Dec";
$lang['cal_january']    = "Januar";
$lang['cal_february']   = "Februar";
$lang['cal_march']      = "Marec";
$lang['cal_april']      = "April";
$lang['cal_mayl']       = "Maj";
$lang['cal_june']       = "Junij";
$lang['cal_july']       = "Juli";
$lang['cal_august']     = "Avgust";
$lang['cal_september']  = "September";
$lang['cal_october']    = "Oktober";
$lang['cal_november']   = "November";
$lang['cal_december']   = "December";

I opened application/config/autoload.php and add this line

$autoload['language'] = array('koledar');

Code:
/*
| -------------------------------------------------------------------
|  Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
|    $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file.  For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/

$autoload['language'] = array('koledar');
$autoload['language'] = array();


then I load it in this file welcome.php - located in --> system/application/controllers

I add this line:

Code:
$this->lang->load('koledar', 'english');

'sample' source:

Code:
<?php

class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
        $this->load->model(array('feedbackmodel'));
        $this->lang->load('koledar', 'english');
    }


'Sample' source of file list.php located in --> system/application/views/feedback

Code:
<? extend('templates/master.php') ?>
    <li>
        <div class="feedback-info">
        <p class="title">&lt;?=anchor($item->type.'/v/'.$item->id,$item->title)?&gt;</p>
        <p class="meta">From &lt;?=$item->author_username?&gt; | date &lt;?=date('F j, g:ia',strtotime($item->date_submitted))?&gt; - odgovorov: <strong>&lt;?=$replies_string?&gt;</strong></p>
        </div>

And when I open this page I still get February instead of Februar =)

I really don't know what i am doing wrong=)
Please help Wink Thank you
#9

[eluser]some1ell[/eluser]
Ok....I fix it another way =)

I changed

&lt;?=date('F j, g:ia',strtotime($item->date_submitted))?&gt;
to
&lt;?=date('d M Y, G:iConfused',strtotime($item->date_submitted))?&gt;

it fine for me now Wink

thank you...




Theme © iAndrew 2016 - Forum software by © MyBB