Menu

Edit and activate language file

Help
Stefan
2014-04-24
2021-10-05
  • Stefan

    Stefan - 2014-04-24

    Hi,

    I want to edit the dutch language file and I think I have to edit file php-addressbook-nl.po in the translations map but whatever I do think change is not displayed in my browser. Maybe I missed something but how do I activate this language file so that my changes are active.

     
  • Kevin

    Kevin - 2014-04-25

    Hi:

    ::::::::::: Force/Change Language ::::::::::::::::

    1-. Go to "include/translation.inc.php" and edit:

    $choose_lang = false;
    if(getPref('lang') != NULL) {
    $lang = getPref('lang');
    } else {
    if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
    $lang = $trans->getBestAcceptLang($_SERVER['HTTP_ACCEPT_LANGUAGE']);
    } else {
    $lang = $trans->getBestAcceptLang(array());
    }
    }


    Change "$choose_lang = false" for "$choose_lang = true" and coment lines 25->34
    Like this:


    $choose_lang = true;
    // if(getPref('lang') != NULL) {
    // $lang = getPref('lang');
    //} else {
    // if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
    // $lang = $trans->getBestAcceptLang($_SERVER['HTTP_ACCEPT_LANGUAGE']);
    // } else {
    // $lang = $trans->getBestAcceptLang(array());
    // }
    //}


    2-. Go to "config/config.php" and add this:

    $lang = "nl"; // change language

    -----------------------END-------------------------

    Works for me. I hope help you.
    regards.
    Kevin.

     

    Last edit: Kevin 2014-04-25
    • Stefan

      Stefan - 2014-04-28

      Hi Kevin,

      Thank you very much for your answer but while the pages are in dutch now I still do not see the adjustments I have made in the php-addressbook-nl.po file. Am I editing the wrong file here?

      Regards,

      Stefan

       
  • Kevin

    Kevin - 2014-04-28

    Hi. I was testing and is a bit "complicated" but not impossible.

    1 - Download and install "Poedit - translations editor" --- http://poedit.net/download.php
    2 - Open with poedit "translations/php-addressbook-nl.po" (or whatever you want to edit).
    3 - Make the changes you want and save the file.
    4 - When you save the file... a ".mo" file is generated in the "translations" folder, copy the file in "translations\LOCAL\nl\LC_MESSAGES" ---- REPLACE.

    I hope help you.
    Regards,
    Kevin.

     

    Last edit: Kevin 2014-04-28
    • Stefan

      Stefan - 2014-04-29

      Hi Kevin,

      You are a lifesaver :)! I followed your instructions and it works like a charm thank you very much!

      Regards,

      Stefan

       
  • Kevin

    Kevin - 2014-04-29

    Happy to help :)

    Regards.
    Kevin.

     
  • Nelson Costa

    Nelson Costa - 2017-05-29

    Thanks Kevin :P

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.