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.

Override system variables in templates with php code ?

March 13, 2012 11:13am

Subscribe [2]
  • #1 / Mar 13, 2012 11:13am

    Stig Endresen

    6 posts

    Greetings.

    I am building a website with EE 2.4.0 and I found myself spending too much time with one issue.

    While using the channel:calendar the system variables it defaults to english. Like lang:weekday_abrev set weekdays to short in english. My question should be something like; Can I re-define the weekday_abrev array to different language in the template to avoid hacking the system file for calendar ?

    Regards

    Stig Endresen
    NiXN

  • #2 / Mar 14, 2012 11:55am

    glenndavisgroup

    436 posts

    I don’t know if this the correct way of doing this so please make sure you backup your EE system, website, and database as this might cause problems and I’m not sure if it will work correctly. The file you want to change is located here:

    /system/expressionengine/language/english/core_lang.php

    If you are going to change the language I would recommend making a duplicate copy of the /system/expressionengine/language/english/ folder and call it “french” for example. Then open “/system/expressionengine/language/french/core_lang.php” file or what ever language you called it and apply the translation changes you want to make to it.

    Once you are done applying your translation changes go to the CP under “Admin > General Configuration” and set the field for “Default Language” to the language you called the folder from above.

    Now I think this will change the values you want to the language of your preference. I have not tested any of this so please be careful when doing this so you don’t break your CP and website. I would recommend trying this on a dev/staging EE installation in case anything goes wrong. I hope this helps.

    Mike

  • #3 / Mar 14, 2012 1:06pm

    glenndavisgroup

    436 posts

    You can also edit all the language files using the CP under “Tools > Utilities > Translation Utility”. There you can click on a file like the “core_lang.php” and change any of the values to what ever you want. Make sure you have write permissions on the /system/expressionengine/language/english/ folder.

    Mike

  • #4 / Mar 17, 2012 11:05am

    Stig Endresen

    6 posts

    Thank you, Mike.

    This seem to me as the solution. But for others reading this I would like to add that it is important to copy the files from codeignitor/language/english into a folder with same name as chosen in expressionengine/language/<language>. If not you will get error messages.

    /se

  • #5 / Mar 17, 2012 11:09am

    Stig Endresen

    6 posts

    Obs. ../system/.. path correction 😊

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

ExpressionEngine News!

#eecms, #events, #releases