ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Pagination - Multi language

July 05, 2011 8:53am

Subscribe [3]
  • #1 / Jul 05, 2011 8:53am

    Neil Evans

    1403 posts

    http://ellislab.com/expressionengine/user-guide/modules/channel/pagination_page.html#var_pagination_links

    The words “next” and “last” are all automagically delivered by the string. Is there anyway to translate these, or disable them and just display the numbers? I’ll keep digging…

  • #2 / Jul 05, 2011 9:42am

    Neil Evans

    1403 posts

    OKay… well kind of scrap this - it is because the language files for french are not up to date and missing large amounts of variables and of the way the cookie needs to be set to define the language, and some browsers (chrome) just not playing nice. FF works fine.

    In short, EE and multilanguage is not nice. I am going to need to modify the core EE_Lang.php file to adhere to a global variable / config item i define - can someone please point me toward the docs for how to reference config items from within core files?

    To explain - i am going to modify the core language file to first check config, then cookie, etc. So if i define xxx language in the index file, it will be strictly set without being reliant on cookies, etc.
    Thanks, N

  • #3 / Jul 05, 2011 10:23am

    Neil Evans

    1403 posts

    no worries… in /fr/index.php i define:

    $assign_to_config['global_vars'] = array(    'language'         => 'french', 
                                                     'language_code' => 'fr'); // This array must be associative

    and then in /core/EE_lang.php i add an extra check against the global variable i set above before the cookie for:

    // ##############################################################
                // IMPORTANT - ADDED GLOBAL VARIABLE LANGUAGE CHECK…
                // ##############################################################
                if (isset($EE->config->_global_vars['language']))
                {
                    $this->user_lang = $EE->config->_global_vars['language'];
                }
                //if ($EE->input->cookie('language'))
                // ##############################################################
                elseif ($EE->input->cookie('language'))
                {
                    $this->user_lang = $EE->input->cookie('language');
                }
                elseif ($EE->config->item('deft_lang') != '')
                {
                    $this->user_lang = $EE->config->item('deft_lang');
                }
                else
                {
                    $this->user_lang = 'english';
                }

    forced language selection in the in the index.php file - done.
    If only you could define the default language in the index.php file - i tried but it does not seem to let me override it…

  • #4 / Jul 06, 2011 3:37am

    John Henry Donovan

    12339 posts

    Hi nevsie,

    There is a config variable called deft_lang which may work for you. Untested

    $assign_to_config['deft_lang']  = 'french';

    Moving to Community Help to keep discussion open

  • #5 / Jul 06, 2011 7:11am

    Neil Evans

    1403 posts

    and is that anywhere within documentation so i can read up on it?
    or can you point me somewhere? Thanks, N

  • #6 / Mar 09, 2013 1:41pm

    David Rousseau

    39 posts

    Thanks nevsie, did the tweak to the EE_Lang.php file.  I hate to hack files… but I’ve try all other way around, and none worked correctly.

    Definitely, this should be something within the core functions of EE.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases