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

Translation 1.6 ST

Hi !

After looking for it, i decided to do it by myself (in fact, i needed this for my work). So there it is, a french translation for the client side of OsTicket v1.6 (stable). The translation is not perfect but seems pretty good. As i'm a lazy boy, i didn't translate the admin side.

In order to make easy translation into other languages, i created a language.php file where you have to set up the $LANGUAGE variable (and complete the switch).

Then, create a lang_xx.php file (where xx = your country code), based on the existing ones (lang_en.php contains originals texts).

If you want to help others people, maybe you could upload your translated files there, so that everybody will be happy :D
Modified files :
/
index.php
lang_fr.php
lang_en.php
language.php
offline.php
open.php

/include/client
header.inc.php
login.inc.php
thankyou.inc.php
tickets.inc.php
viewticket.inc.php
open.inc.php

/include
class.pagenate.php
class.ticket.php

/images
view_closed_btn.gif
view_open_btn.gif
refresh_btn.gif
If you have any suggestion/question, feel free to write them here !
«1

Comments

  • Develipment

    Hi Wotan,
    I think it's better that we follow talking here, in public for public interest.;)

    I just download your files, and upload them to my directory, replacing all with the previous, so, it's seem to be working correct, but, all the frontend become French, and no more English....
    Where's the switch to choice and turn between a language and other, I mean, where did you create a switch for turn to turn to French from English, because in this case, it's become only French, as I understand...

    and, to translate to other languages, dose it need only to translate the lang_xx.php and upload it, and you have done the work with the rest of you files?

    Regards,

    Sam
  • In order to make easy others translation, i created a language.php file. This file only contains a switch (the php "function" switch) and the variable $LANGUAGE where you can set the language for the client side.

    There is two things you need to do in order to have a spanish version :

    1. as you said, copy the lang_en.php into lang_es.php and translate it into spanish

    2. set the $LANGUAGE variable to ES into the language.php file, and add a case to the switch function in the same file (i don't know your php level, so you can find the modified php file attached with this response)

    Regards,
    language.php_ES_version.zip
    240B
  • Spanish translation

    Thanks Wotan,
    This it's seem to be easy, find in the attachment the lang_es.php file translated to spanish language.
    In the next days, I can organize my team to submit translations to polish, arabic, romanian and mybe to german, also.

    But, the issue still for me in the language.php, because when I fix it as you proposed in the PM, as:
    <?php



    $LANGUAGE="ES";



    switch($LANGUAGE) {

    case "EN":

    require('lang_en.php');

    break;

    case "FR":

    require('lang_fr.php');

    break;

    case "ES":

    require('lang_es.php');

    break;

    default:

    require('lang_en.php');

    }



    ?>


    I have only spanish, and if I change it as it was $LANGUAGE="FR"; it appear to be only in French... but in the frontend I don't see a switcher... I mean, the client need to see a switcher to turn from a language to other, in drop down, or better with flags, or something els, no, or what do you think?

    Regards,
    lang_es.php.zip
    2K
  • Hi,

    I think you're right, it would be better with flags the user could click on in order to translate the client side.

    The fact is that for my work, i only needed it in french. But if you want, and if i have time, i could maybe help you adding this feature.

    Something like that may work :

    1. Find some little flags, and add them to the file header.inc.php
    2. Create a cookie (or something like this) in order to store the client's language (this step is for client that do not log in).
    3. Add a field in the ost_ticket table in order to store the client's language
    4. Find the other files to modify in order to have everything working :) (maybe class.ticket.php, open.php and few others)
  • wotan;16457 said:
    Hi,
    Something like that may work :
    1. Find some little flags, and add them to the file header.inc.php
    2. Create a cookie (or something like this) in order to store the client's language (this step is for client that do not log in).
    3. Add a field in the ost_ticket table in order to store the client's language
    4. Find the other files to modify in order to have everything working :) (maybe class.ticket.php, open.php and few others)

    Hi Wotan,
    I have to say something in advance, I'm not a php developer, so for this I'm asking for a help in this issue, where I can contribute in other issues:rolleyes:.

    For the flags pictures it's the easiest way, because it's more interactive and visible to be selected for a client who don't speak more then his own language. And moreover, our own page are working right now in 10 languages, so I need to add the generic link ./support/ to each footer as support center, and the client should be redirected rather with his cookie, or to the default one as English.
    Or other option, is to redirect from each page, directly to the specific URL for the specific language of the store, but I was trying as ./support/lang_fr.php, or something else, but this url not working, so what could be the eventual solution until we could advance in the switcher?

    If you want I can send you full flags file from all over the world. Sure, for the moment we don't need it, because we're talking about only 3 or 4 languages, but it's for your use, if you want.

    I received this morning from my team the translations to polish and german, and I just send them to other people to review them if all it's ok, in this week I could have ready the files for polish, german, and arabic.

    So, I would appreciate if you have time to advance in this, and eventually, just orient me to appoint to the language url directly until we could advance in the switcher.

    Regards,

    Sam
  • If, in the language.php file, you replace
    $LANGUAGE=\"ES\"


    with

    $LANGUAGE=strtoupper($_GET['lang']);


    You may be able to translate the website with an url like http://xxx.xx/osticket/index.php?lang=es

    This will work on every page, juste add ?lang=es at the end of the link (after the ".php" extension)
  • wotan;16463 said:
    If, in the language.php file, you replace
    $LANGUAGE=\"ES\"


    with

    $LANGUAGE=strtoupper($_GET['lang']);


    You may be able to translate the website with an url like http://xxx.xx/osticket/index.php?lang=es

    This will work on every page, juste add ?lang=es at the end of the link (after the ".php" extension)
    Hi Wotan,
    Thanks again, it's work, so I made my language.php file as the following:

    <?php



    $LANGUAGE=strtoupper($_GET['lang']);



    switch($LANGUAGE) {

    case "EN":

    require('lang_en.php');

    break;

    case "FR":

    require('lang_fr.php');

    break;

    case "ES":

    require('lang_es.php');

    break;
    case "DE":

    require('lang_de.php');

    break;
    case "PL":

    require('lang_pl.php');

    break;
    case "ar":

    require('lang_ar.php');

    break;
    case "ro":

    require('lang_ro.php');

    break;
    case "pt":

    require('lang_pt.php');

    break;

    default:

    require('lang_en.php');

    }



    ?>
    And appoint to each URL with the prefix of it's language, work, perfect....

    So, we could propose un upgrade for this version, when my team conclude me the translations, and submit it, or even, I can put it in our own repository, in dead, we're Hosting services providers, so we have no space, neither bandwidth problems, so we have please for repos...

    I'll come back to you soon with the full translations files...
    Regards,
  • Switcher

    Hi Again Wotan,
    Look what I did here, I got a switcher, not great, but home made, but it's exactly what I'm looking for, and I have already done in our mean site...:D
    Into ./osticket/include/client/header.inc.php I edit all the file as following to add a switcher:

    <?php
    require('language.php');
    $title=($cfg && is_object($cfg))?$cfg->getTitle():'osTicket :: Support Ticket System';
    header("Content-Type: text/html; charset=UTF-8\r\n");
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">



    <?=Format::htmlchars($title)?>







    With this I got eactly a flags just to click, and switch to the desired language...

    What I wanted to add also, in the same line, it's another option, like home, but not for the Support center home, but to come back to the mean Home site, so I add:
    But I'm getting error in the variable :mad:, what do you think?

    Regards,
  • With something like this, everything should be ok.

    <li><a class=\"Ticket Center home\" href=\"http://www.mysite.com\">Come Back to MYSITE.COM</a></li>


    (I just thought that the client will have to click on the flag on each page he will see ... I will try to find a nice way to fix that)
  • wotan;16467 said:
    With something like this, everything should be ok.

    <li><a class=\"Ticket Center home\" href=\"http://www.mysite.com\">Come Back to MYSITE.COM</a></li>


    (I just thought that the client will have to click on the flag on each page he will see ... I will try to find a nice way to fix that)
    Thanks, this one work, but it's true, I didn't test it, it's work getting multilingual only in the front, but just clicking in any option, the client come back to english, and if you click in the flag back, it bring you back to home...:mad:

    Ok, I keep forwarding your news,

    Salut,
  • I think what needs to be done is setting some sort of cookie... it is looking good otherwise!
  • Anyone figure this out.. to maintain the language. There must be some php script to continue in ?lang=es etc. until another language from the menu bar is selected???

    Not the best php coder but I'll keep playing with it...

    Something like the following:

    <div id=\"nav\">
    <ul>

    <?php if ($Language == 'fr') { ?>
    <li>
    <em><a href=\"open.php?lang=fr\">Open Ticket</a></em>
    </li>
    <?php } else { ?>
    <li><a href=\"open.php?lang=en\">Open Ticket</a></li>
    <?php } ?>

    ...


    There has to be some if/else php condition that would tell each link on that page to keep the language in the current selection unless de-selected (changed by the user).

    Thanks,

    Steve
    CampusCom
  • SOLVED :)

    Here's the script:

    <?php
    require('language.php');
    $title=($cfg && is_object($cfg))?$cfg->getTitle():'osTicket :: Support Ticket System';
    header(\"Content-Type: text/html; charset=UTF-8\r\n\");
    $vLang = $_GET['lang'];
    ?>

    ...


    <li><a class=\"my_tickets\" href=\"tickets.php?lang=<?php echo $vLang?>\"><?php echo MY_TICKETS ?></a></li>
    <?}else {?>
    <li><a class=\"ticket_status\" href=\"tickets.php?lang=<?php echo $vLang?>\"><?php echo TICKET_STATUS ?></a></li>
    <?}?>
    <li><a class=\"new_ticket\" href=\"open.php?lang=<?php echo $vLang?>\"><?php echo NEW_TICKET ?></a></li>
    <li><a class=\"home\" href=\"index.php?lang=<?php echo $vLang?>\"><?php echo HOME ?></a></li>

    ...



    I hope that works to make one customizable user interface which can function in multiple languages!!!

    Only thing I can't figure out is how to pass the $vLang when opening a ticket (open.php) or when logging in (login.php).. anyone???

    Cheers.

    Steve
    CampusCom
  • In order to get the language at login, the key is to save this setting with the user.

    The only way the user is saved, is in the ost_ticket table (one line by ticket, always with all the clients informations). So you could maybe add a column that will save the language in the ost_ticket table, and get it back when loging (customising the /include/class.client.php).

    If you add a method getLang() in the class.client.php, it could make it easier for you.

    In order to save the language at opening, you should maybe custom a bit the Ticket class (/include/class.ticket.php) so that the language will be save in the ost_ticket table.

    (Maybe not the best advice, but the first to come in my mind :) )
  • I managed to get it all up and working. It was just a matter of carrying over that variable from page to page.. a bit annoying, but it's now done!

    Thanks so much.

    Hubbard
    CampusCom
  • wotan;16402 said:
    Hi !

    After looking for it, i decided to do it by myself (in fact, i needed this for my work). So there it is, a french translation for the client side of OsTicket v1.6 (stable). The translation is not perfect but seems pretty good. As i'm a lazy boy, i didn't translate the admin side.

    ...

    If you have any suggestion/question, feel free to write them here !
    Hello "Wotan"

    I just downloaded your french version and...it works perfectly!!!
    Great job!

    What would be required to translate everything ? Is it something very labour intensive ?

    GAston
  • Site en francais

    Bonjour,

    Voilà plusieurs jours que j'essaie de traduire mon site mais sans succès :confused: :mad:

    J'ai récupéré ton fichier .zip , je l'ai dézippé et modifié le fichier de conf
    en lang_fr.php

    Peux-tu me donner la liste des fichiers à modifier ?

    Merci.
  • Going further

    hi
    I applied the french patch you provided and it did works perfectly! good job.
    Now i would like to know how to go a little further and translate the admin part too.
    could you just give me direction to what files i should work on to translate the whole thigs....once i did it i will publish it here so we will have a full french version of OST
    Thanks in advance
    regards
  • French Translation

    Hey all,
    I too would love to have a translation of the admin console. This looks to be the best means of providing translations that I've seen posted, and I'm going to be trying to set this all up over the next week. All I need to make OSTicket really useful now is the French translation of the admin side - so I'm looking forward to getting that. I'm currently at a French University, so if there are any changes that need to be made anywhere in this translation to make it really rock-solid, I'm sure I could arrange that over the next few weeks, and I'll post the results here (If there's a desire for that - I haven't yet looked to see how good the translation is).

    All the best.
  • translating the client side only?? if you translate the staff side then you´ll be my hero! ;)
  • I create a project in launchpad to internacionalize this software. Now all 1107 speachs are identified and integrated with launchpad, so anyone can log into launchpad and translate to your language.

    We need all help possible to translate this project to other languages and to test if everything is ok. The project is in launchpad.net/osticketplus. If you find something wrong, please fell free to write to me and i'll fix as son as possible.
  • Dutch

    Dutch - NL
    V1.0 By PCMario.nl

    language.php
    <?php

    $LANGUAGE="NL";

    switch($LANGUAGE) {
    case "EN":
    require('lang_en.php');
    break;
    case "NL":
    require('lang_nl.php');
    break;
    case "FR":
    require('lang_fr.php');
    break;
    default:
    require('lang_en.php');
    }

    ?>
    lang_nl.zip
    2K
  • New update Spanish translation

    I modified lang_es.php I remove some anglicisms and correct few mistakes. I wish it could help you.


    Take it easy.
    lang_es_1_01.php.zip
    3K
  • Hi guys

    Is it possible to receive a polish translation from you? (dzakomo@gmail.com)

    Thanks in advance
  • Problem of charset with french

    Hello,

    I will use osTicket in french.
    I apply the patch of Wotan
    My client interface is now in french but have some charset problems.
    The accents (éèê...) are bad.

    Please, what I need to do for correct this ?

    Thank's for your verry good work.
    Chris
  • Charset problem in french

    Hello,

    I have apply the french patch of Wotan, but have some charset problems.

    In header.inc.php I changed charset=UTF-8 by charset=iso-8859-1
    It's OK in index.php
    I have bad charset in ticket.php and some charset problem in e-mail and in scp/tickets.php, the memo of the ticket is cut.

    Have someone the same problem and a solution to fix this ?

    Best Regards
    Chris
  • Charset problem in french

    Hello,

    I found the solution...

    Don't change the charset in the file header.inc.php, leave in UTF-8.

    In french :

    En ajoutant la ligne suivante dans votre fichier .htaccess du dossier /support (dossier racine de osTicket); pour afficher votre site en UTF-8 par exemple celle-là:

    php_value default_charset utf-8

    Cela spécifie le character set retourné en HTTP par le header HTTP "Content-type:"


    Pour agir au niveau de PHP, dans ce même fichier il faut ajouter la ligne
    php_value mbstring.internal_encoding UTF-8 qui spécifie l'encodage interne utilisé par PHP.

    I hope this answer can help someone...
  • France phone number

    Hello,

    When creating a ticket, phone number format is not France. I would like to change it. I know the file is "class.format" but when I try to change the phone function, it does not work :mad:

    Could you help me?
  • To install this, all i have to do is decompress osticket_1.6_frv1.01.zip and replace the fily on my webserver. and make sure FR is type in the language.php but when i do that and try to access my osticket frontpage, it send me to osticket/setup/, why? how do i fic this.
  • In order to have the phone number in french format, i modified the include/class.format.php this way :

    	function phone($phone) {

    $stripped= preg_replace(\"/[^0-9]/\", \"\", $phone);
    if(strlen($stripped) == 7)
    return preg_replace(\"/([0-9]{3})([0-9]{4})/\", \"$1-$2\",$stripped);
    elseif(strlen($stripped) == 10)
    //return preg_replace(\"/([0-9]{3})([0-9]{3})([0-9]{4})/\", \"($1) $2-$3\",$stripped);
    return preg_replace(\"/([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/\", \"$1 $2 $3 $4 $5\",$stripped);
    else
    return $phone;
    }
Sign In or Register to comment.