site language problem

edited September 2014 in Modules
As i want to use "en" instead of "english" in url and i want to use english backend admin with front end pages in localized language. I am not able to utilize the language abilities of fuel CMS. so i did a quick trick. I setted a global variable called site_lang. Then when i building url, i use <?php echo site_url().$site_lang;?> in various view files.

Although this solutions works fine for custom build pages, it does not work on dynamic pages build at the backend. In the "location" field, i have to manually put "en/home".

How can i automate this part, so i am not enforced to input "en/", but just "home" in the location field?

Comments

  • edited 8:42AM
    What values do you have for your $config['languages'] in your FUEL config?
  • edited 8:42AM
    english=>"English"
  • edited 8:42AM
    You can change it to "en" => "English", but the first one listed in the languages config is considered the default which means that it won't automatically be appended to the URI.
  • edited 8:42AM
    so there is no way to automate this part, at the moment? may i know which function in the system handling the routing part for these dynamic pages? maybe i can modify the function to include the language
  • edited 8:42AM
    Are you seeing a language dropdown when you create a page in the CMS (you need to have more then one for it to appear)?
  • edited 8:42AM
    yes i tried to use the language module, but i dont think it fits my needs at the moment, as the backend need to remain as english...only front end to be appear as other languages.
  • edited 8:42AM
    The language dropdown under the Pages module is for the front end only. If you specify multiple languages in your config, then a dropdown should appear when creating/editing a page. You can change this when creating/editing a page to associate variables to different language versions of the page. Then on the front end you can access the pages with the URI segment like http://mysite.com/{language}/my_page
  • edited September 2014
    i set

    // languages for pages. The key is saved to the page variables
    $config['languages'] = array(
    'en' => 'English',
    );

    // append the current language value to the site URL automatically
    $config['add_language_to_site_url'] = TRUE;


    but i noticed that when i creating page at the backend, if i dont put "en/page1" to the location field and putting "page1" instead. The page can only be access at localhost/cms/page1, the en language is not automatically appended to url.

    how to make it auto appending
  • edited 8:42AM
    You'll need to have more then one language in the $config['languages'] array for that to kick in.
Sign In or Register to comment.