Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[MOD] Multilanguage Support

145679

Comments

  • The "Autoresponse sent to user, if enabled, on new ticket." is the title for all templates is a bug in the unmodified osticket too when I test - I have filled an issue at Github.

    scp/pwreset.php is missing translation

    scp/settings.php?t=pages is still missing translations
  • Fixed those two pages.
  • Thank you.

    After the last changes pwreset.php is not working.
    From the Apache log I get:
    PHP Parse error: syntax error, unexpected '.' in /var/www/vhosts/osticket/scp/pwreset.php on line 45
  • fixed, sorry, forgot to remove the dot
  • Ok - worked when I just removed the .

    This part of the pwreset.php is still missing translation:

    A confirmation email has been sent

    A password reset email was sent to the email on file for your account. Follow the link in the email to reset your password.

    Login (button)

    It's actually in ./include/staff/pwreset.sent.php
  • Added wrappers to those too
  • Hallo,

    danke für diese super notwendige Erweiterung von osTicket und die Anpassung an die neue Version 1.7.1.

    Ich hab nun folgendes Problem, wobei ich aber nicht genau weiss ob es an diesem Mod hier für liegt:

    Bei meiner Installation funktioniert das 'Antwort-Trennzeichen' nicht. Das hab ich aktiviert in den Admineinstellungen, aber trotzdem wird beim Antworten auf einem Ticket der Text der E-Mail nicht abgeschnitten.

    Kann das an dem Mod liegen oder ist das ein anderes Problem?

    Danke für die Info.
  • How to update

    from
    osticket_1.7-stable_multilanguage_V6
    to
    osticket_1.7.1-stable_ml_V7

    I need help. pls!!! :o
  • Hey, just follow this:
    http://osticket.com/wiki/Upgrade_and_Migration

    But remember... BACKUP FIRST! :D
  • PapiMigas;45016 said:
    Hey, just follow this:
    http://osticket.com/wiki/Upgrade_and_Migration

    But remember... BACKUP FIRST! :D
    Thx, this works perfect! :D
  • @spoh
    Ich denke nicht, dass es etwas mit der mod zu tun hat. Sicher sein kann ich mir leider nicht. Ich habe keinen Mailserver zur Hand mit dem ich das testen könnte. Die derzeit modifizierte Version ist 1.7.1.1. Ich werde Sie in Kürze auf 1.7.1.3 aktualisieren. Vielleicht wird das Abhilfe schaffen.
  • Danke für die Info. Leider habe ich es bis jetzt auch nicht geschafft osTicket nochmals ohne Mod zu installieren, um zu schauen ob es da funktioniert. Aber vielleicht komm ich heute Abend dazu...
  • PT Language

    Papimigas,

    Maybe you can help me...
    I downloaded your 1.7 stable Portugal zip;
    I had installed via cpanel the latest automatic release 1.7 via softaculous;
    What is the best way to merge it with your version?
    If I upload all your content to my online installation, what files would I change to make it correspond to online db settings?
    Thanks
  • When a user is creating a Ticket, they get de mail "New Ticket Auto-Response" in de mail is a link to view the ticket online with the variable "%{ticket.client_link}"

    The problem is that the link is to long for the email and that the link is cut in to 2 lines, because of that the link doesn't directly work. The user need to select the 2 lines en copy and paste it in the browser.

    example link:
    The variable %{ticket.client_link} =
    "http://ticket.mydomain.nl/view.php?t=692968&e=henk@mydomain.nl&a=6397
    8921684c92a3c56723f30d7d4717

    instead:
    "http://ticket.mydomain.nl/view.php?t=692968&e=henk@mydomain.nl&a=63978921684c92a3c56723f30d7d4717"

    We use osticket_1.7-stable_multilanguage_V6

    How can we fix this. Does anybody have a solutions?

    Tia

    Henk
  • 1.7.1.4 released

    If you are not started with 1.7.1.3 yet as you wrote you should use 1.7.1.4 that have been released.
  • @EICT-W
    Please try a different email-client to ensure whether the error lies within osticket or not.

    @olest, spoh
    done porting to 1.7.1.4
  • Is there any repository where we can find other translation .mo file?
    I am looking for a french version of messages .po and I am pretty sure that someone already did it.

    Thanks for that excellent work
    D
  • Template title missing translation after fix

    With this fix to 1.7.1.4 translation is missing:
    https://github.com/greezybacon/osTicket-1.7/commit/7ed4461064ef435391b966fdfe174841627476a6

    UPDATE:
    Change line 74 in tpl.inc.php from:

    <?php echo Format::htmlchars($nfo['desc']); ?>

    or

    <?php echo Format::htmlchars($tpl['desc']); ?>

    to:

    <?php echo __(Format::htmlchars($tpl['desc'])); ?>

  • Hello,

    At first testlang.php outputs this:

    Your browser preferred language is: 'nb-no'
    The following folder will be used to translate your osticket: 'en'


    then i create a redirect in */en/: and testlang.php outputs this:

    Your browser preferred language is: 'nb-no'
    using the redirect file include/locale/en/redirect
    redirecting to 'nb-no'
    The following folder will be used to translate your osticket: 'nb-no'


    Copy of gettext-confiig

    <?php
    //Multilanguage Support
    //To add additional languages add a folder with your language code to 'include/locale' (for example 'de-de'), create the folder 'LC_MESSAGES' inside it and create your
    //'messages.po' file inside 'LC_MESSAGES'. With the example of de-de the full path to 'messages.po' should look like 'include/locale/de-de/LC_MESSAGES/messages.po'.
    //In case you don't know your language code (or to be more precise: the one your browser prefers), open the php page: 'testlang.php'

    //the language detection first checks if a language folder, that has the same name as the preferred broser language exists
    //if that is the case it checks whether it should redirect to another language folder or not
    //if that isn't the case it tries to split the language code to its short version and does the same checks
    //it doesn't check the sanity of the redirect file, so make sure the content is valid

    //to redirect a language code to a different one, create a folder inside 'include/locale' that represents the language code you want to redirect and then create a file called 'redirect' in it.
    //the content of 'redirect' has to be the language code it should redirect to.
    //Example:
    //you want to redirect the language code 'de-de' to the code 'de'
    //create a folder inside 'include/locale' called 'de-de'. then create the file 'redirect' in it. the path to this redirect should now look like 'include/locale/de-de/redirect'.
    //now open the redirect file you've created, type de in the first line and save it


    $use_php_gettext=false; //Set this to false to disable php_gettext

    //In some cases if you use the gettext extension it'll not translate. Usually that happens on linux side.
    //You'll then have to determine what languagecodes your OS supports by typing 'locale -a' in a terminal.
    //Set the $encoding variable to one of the following '.utf8', '.UTF8', '.UTF-8'
    //Which one of those depends on what the 'locale -a' returned for you.
    $encoding='.utf8';

    require_once(INCLUDE_DIR.'locale/lang.php');

    if($use_php_gettext==true&&function_exists('mb_detect_encoding'))
    {
    require_once(INCLUDE_DIR.'gettext.inc');
    }
    $language=getDefaultLanguage(); //if you want to use just one static language replace the call to getDefaultLanguage() with your language code (for example 'de-de')

    //get the first and second part of the language code
    if(strpos($language,'_')!==false)
    {
    $language=substr($language,0,strpos($language,'_'));
    $lang_dialect=substr($language,strpos($language,'_'));
    }
    elseif(strpos($language,'-')!==false)
    {
    $language=substr($language,0,strpos($language,'-'));
    $lang_dialect=substr($language,strpos($language,'-'));
    }
    if(!isset($lang_dialect))
    {
    $lang_dialect=$language;
    }

    $tmplangcode=$language.'-'.strtolower($lang_dialect);
    if(!file_exists(INCLUDE_DIR.'locale/'.$tmplangcode)||!is_dir(INCLUDE_DIR.'locale/'.$tmplangcode))
    {
    $tmplangcode=$language.'_'.strtolower($lang_dialect);
    if(!file_exists(INCLUDE_DIR.'locale/'.$tmplangcode)||!is_dir(INCLUDE_DIR.'locale/'.$tmplangcode))
    {
    $tmplangcode=$language.'_'.strtoupper($lang_dialect);
    if(!file_exists(INCLUDE_DIR.'locale/'.$tmplangcode)||!is_dir(INCLUDE_DIR.'locale/'.$tmplangcode))
    {
    $tmplangcode=$language.'-'.strtoupper($lang_dialect);
    if(!file_exists(INCLUDE_DIR.'locale/'.$tmplangcode)||!is_dir(INCLUDE_DIR.'locale/'.$tmplangcode))
    {
    if(!file_exists(INCLUDE_DIR.'locale/'.$language)||!is_dir(INCLUDE_DIR.'locale/'.$language)) //check short langcode
    {
    $language=''; //set as default
    }
    }
    else
    {
    $language=$tmplangcode;
    }
    }
    else
    {
    $language=$tmplangcode;
    }
    }
    else
    {
    $language=$tmplangcode;
    }
    }
    else
    {
    $language=$tmplangcode;
    }
    //check if a redirect file is in there
    if(file_exists(INCLUDE_DIR.'locale/'.$language.'/redirect'))
    {
    $f = fopen(INCLUDE_DIR.'locale/'.$language.'/redirect','r');
    if($f!==false)
    {
    $line = fgets($f);
    if(strlen($line)>=2) //safety check
    {
    $language=$line; //redirect language
    }
    fclose($f);
    }
    }
    $language=trim($language);

    // gettext setup
    $domain = 'messages';
    if(extension_loaded('gettext')&&$use_php_gettext==false)
    {
    putenv('LC_ALL=' . $language);
    setlocale(LC_ALL, $language.$encoding);
    bindtextdomain($domain, INCLUDE_DIR.'locale');
    textdomain($domain);
    if(!function_exists('__'))
    {
    function __($text){return _($text);}
    }
    }
    else if($use_php_gettext==true&&function_exists('mb_detect_encoding'))
    {
    T_setlocale(LC_ALL, $language);
    // Set the text domain as 'messages'
    T_bindtextdomain($domain, INCLUDE_DIR.'locale');
    T_bind_textdomain_codeset($domain, 'UTF-8');
    T_textdomain($domain);
    }
    else
    {
    if(!function_exists('__'))
    {
    function __($text){return $text;} //fallback definition: in case the gettext extension wasn't loaded osticket should at least work in english
    }
    }
    ?>



    GetText Support enabled and

    mbstring

    Multibyte Support enabled
    Multibyte string engine libmbfl
    HTTP input encoding translation disabled
    libmbfl version 1.3.2

    local -a outputs this:

    no_NO
    no_NO.iso88591
    no_NO.utf8


    But still no translation from english into norwegian.

    Translation is located here:
    https://www.transifex.com/projects/p/osticket-mod-multilanguage-s/
  • You need to create a folder named "no" with a file named "redirect" in it.
    File "redirect" should have the line "no_NO" in it.

    Inside "no_NO" you should have "LC_MESSAGES" folder with messages.po and messages.mo in it.
  • Hi

    If you need like me to have a dynamic language detection then you will have the problem of the landing page, offline page and thank-you page which have been set in the db. Therefore, when users select his prefered language, site pages are not translated dynamically.

    I have set the following solution (maybe not the best but it works )

    first create how many site pages as needed. I personally created new Landing fr, offline fr, thank-you fr, which have respectively id 5, 6, 7 (see in db table "ost_page").

    then I set the following modification

    /* in gettext-conf.php */
    //$language=getDefaultLanguage();

    function setCodeVariableLanguage($locale) {
    global $CodeLanguage;
    global $CodeCountry;

    // extract the country code and the language code
    $split = explode(\"_\",$locale);
    $CodeLanguage = $split[0];
    $CodeCountry = strtolower($split[1]);
    }

    $language=getSelectedLanguage(); //
    setCodeVariableLanguage($language); // set global $CodeLanguage and $CodeCountry


    getSelectedLanguage() is a function that get user selected language from $_session, if none from cookies, if none from default define one.

    $CodeLanguage will contain "en","de" or "fr",...
    then we just needd to be sure that the correct page is loaded


    /* in class.config.php */

    function getLandingPageId() {
    global $CodeLanguage;
    return $this->get('landing_page_id'.'_'.$CodeLanguage);
    }

    function getOfflinePageId() {
    global $CodeLanguage;
    return $this->get('offline_page_id'.'_'.$CodeLanguage);
    }

    function getThankYouPageId() {
    global $CodeLanguage;
    return $this->get('thank-you_page_id'.'_'.$CodeLanguage);
    }


    then new entries have to be created in ost_config table.


    INSERT INTO `ost_config` (`namespace`,`key`,`value`,`updated`)
    VALUES (\"core\", \"landing_page_id_fr\", 5, NOW())



    Hope it can help somebody.

    D
  • Status of ticket in print not translated

    When printing a ticket the status (open/closed) is not translated.

    FIX:
    change line 125 in include/class.pdf.php
    from:
    $this->Cell($c, 7, $ticket->getStatus(), 1, 0, 'L', true);
    to:
    $this->Cell($c, 7, __($ticket->getStatus()), 1, 0, 'L', true);

    In same file there is a general bug:
    https://github.com/osTicket/osTicket-1.7/issues/756
  • Thane;45339 said:
    @EICT-W
    Please try a different email-client to ensure whether the error lies within osticket or not.

    @olest, spoh
    done porting to 1.7.1.4
    I did try other email clients as well same result
  • edited October 2013
    @olest
    porting done, thanks for your help

    @EICT-W
    There was a change in the mailer class in the new release. Your bug with the links may be fixed.

    @yanadhorn
    Please check if that site is served with utf-8 encoding. There are some issues if the server sends osticket sites with something other than utf-8. Does it affect all forms or just a specific one?
  • edited October 2013
    Danke schoen Thane, fuer Ihre besonders gut Arbeit.

    I'm add updated source file message.po (English) compatibility with osticket_1.7.2-stable_ml_V9
    https://www.transifex.com/projects/p...ltilanguage-s/
  • edited October 2013
    I think I found a bug, when adding a knowledge base page appears at the end of this command line was not closed!



    not find the file to change

    version osticket 1.7.2 multilanguage v9
  • edited January 2014
    Hi!

    Do you plan to update to 1.7.4? Can we help doing this?

    Sweeny
  • Download link is not working http://thane.dyndns.org/osticket_1.7.2-stable_ml_V10.zip

    Can you provide us with an new link please

    Thanks
  • Hi all,

    Any mirror for this MOD Plzzzzzzzzzzzzzz ?! :(
    Link is not working anymore...

    Tks a million.

    ./Fred
Sign In or Register to comment.