User avatar
Bjorn_Andersson
GpsGate
Posts: 462
Joined: Wed Jun 28, 2006 5:20 pm
Location: Sweden
Contact: Website

GUIDE: Translate Reports

Thu Sep 15, 2011 7:57 pm

Use the Localization editor to translate reports
http://gpsgate.com/blogComment/localization_editor




below is outdated information (do not use):

This guide applies to you running GpsGate Server 3.0 with reporting plugin version 3.0.0.3052 or newer.

Please read the general guide about translating GpsGate Server found here:
topic.asp?TOPIC_ID=6880

Case:
Translating TR1000X family reports which includes (TR1000 trip & Idle (Detailed) and TR1001 Trip & Idel (Daily) to Españiol.
One exception though; I don't speak español so all phrases are translated to 'hola España' [:)]

How it works:
1. A file with the translation must be placed in '\IIS\Resources\Languages'. The name of the file should follow the naming convetion. [report family].[language name].lang (e.g: TR1000X.espanol.lang)
<font color="red">2.</font id="red"> The lng="Español" attribute must match the language in use.
<font color="green">3.</font id="green"> The module name must match the name of the report definition to translate. In this example we will have two modules named TR1000 Trip & Idle (Detailed) and TR1001 Trip & Idle (Daily)
4. The english texts will be used as phrase keys.

Example
1. Create a file named TR1000X.espanol.lang with the content found below.
2. Make sure it is saved using utf8 encoding. (More info in the general translation guide)
3. Place it in '\IIS\Resource\Language' directory.
4. Go to SiteAdmin -> Settings -> Localization and press the 'Rescan languages and measurement' button.
5. You should now have spanish version of TS1000X reports.

File content:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<Language <font color="red">lng="Español"</font id="red"> enablecache="true">
  <MetaData>
    <Translator>Björn Andersson</Translator>
    <DateTranslated>2011-09-14</DateTranslated>
  </MetaData>
  <Translation>
    <Version value="3.0.0.0">
      <Modules>
        <font color="green"><Module name="TR1000 Trip & Idle (Detailed)"></font id="green">
          <Server>
            <Phrase key="Start Time">hola España</Phrase>
            <Phrase key="TR1000 Trip & Idle (Detailed)">hola España</Phrase>
            <Phrase key="Shows the time and duration of all trips and idles for vehicles within the selected period. Periods of being offline (when a tracker is not sending data to the server) are excluded from the report.">hola España</Phrase>
            <Phrase key="Period Start:">hola España</Phrase>
            <Phrase key="Period End:">hola España</Phrase>
            <Phrase key="Total Vehicles:">hola España</Phrase>
            <Phrase key="Total Duration Trip:">hola España</Phrase>
            <Phrase key="Total Duration Idle:">hola España</Phrase>
            <Phrase key="Total Distance:">hola España</Phrase>
            <Phrase key="* Idle = Time a vehicle is online and while standing still.">hola España</Phrase>
            <Phrase key="* Trip = Time that a vehicle is online and moving.">hola España</Phrase>
            <Phrase key="Stop Time">hola España</Phrase>
            <Phrase key="Duration">hola España</Phrase>
            <Phrase key="Start Address">hola España</Phrase>
            <Phrase key="Stop Address">hola España</Phrase>
            <Phrase key="Distance (GPS)">hola España</Phrase>
            <Phrase key="Max Speed">hola España</Phrase>
            <Phrase key="Avg Speed">hola España</Phrase>
            <Phrase key="Trip/Idle*">hola España</Phrase>
            <Phrase key="run">hola España</Phrase>
            <Phrase key="idle">hola España</Phrase>
          </Server>
        </Module>
        <font color="green"><Module name="TR1001 Trip & Idle (Daily)"></font id="green">
          <Server>
            <Phrase key="TR1001 Trip & Idle (Daily)">hola España</Phrase>
            <Phrase key="Date">hola Españaa</Phrase>
            <Phrase key="Trips and idles, by vehicle">hola España</Phrase>
            <Phrase key="Period Start:">hola España</Phrase>
            <Phrase key="Period End:">hola España</Phrase>
            <Phrase key="Total Vehicles:">hola España</Phrase>
            <Phrase key="Total Distance:">hola España</Phrase>
            <Phrase key="Total Duration Trip:">hola España</Phrase>
            <Phrase key="Total Duration Idle:">hola España</Phrase>
            <Phrase key="Total Trips:">hola España</Phrase>
            <Phrase key="Total Idles:">hola España</Phrase>
            <Phrase key="* Duration Idle = Time a vehicle is online and while standing still.">hola España</Phrase>
            <Phrase key="* Duration Trip = Time that a vehicle is online and moving.">hola España</Phrase>
            <Phrase key="Date">hola España</Phrase>
            <Phrase key="Start Time">hola España</Phrase>
            <Phrase key="Stop Time">hola España</Phrase>
            <Phrase key="Total Distance (GPS)">hola España</Phrase>
            <Phrase key="Max Speed">hola España</Phrase>
            <Phrase key="Duration Idle*">hola España</Phrase>
            <Phrase key="Duration Trip*">hola España</Phrase>
            <Phrase key="Idle (%)">hola España</Phrase>
          </Server>
        </Module>
      </Modules>
    </Version>
  </Translation>
</Language>

User avatar
Bjorn_Andersson
GpsGate
Posts: 462
Joined: Wed Jun 28, 2006 5:20 pm
Location: Sweden
Contact: Website

RE: GUIDE: Translate Reports

Fri Sep 16, 2011 1:06 pm

Update: The file content contained '&' character which is a reserved character in XML.
All reserved characters must be escaped, in this case:
'&' is escaped to &

Here is a list of other characters that must be escaped:

Code: Select all

& escapes to: & 
> escapes to: > 
< escapes to: < 
" escapes to: "
' escapes to: &apos;
Regards,
GpsGate Support
Bjorn Andersson

stelazh
Posts: 52
Joined: Tue Sep 27, 2011 2:57 pm

RE: GUIDE: Translate Reports

Mon Mar 05, 2012 3:39 pm

Hello , i have a question :
I have create this 2 report like in example and they are very OK. But i want to translate the other report for example fuel report . I created this file FU1000X.albanian.lang and FU100X.albanian.lang but something is wrong because the report isn't translate. I have rescan language...refresh all ...but still nothing. Can you help me please ?

User avatar
Bjorn_Andersson
GpsGate
Posts: 462
Joined: Wed Jun 28, 2006 5:20 pm
Location: Sweden
Contact: Website

RE: GUIDE: Translate Reports

Tue Mar 06, 2012 6:38 pm

1. Make sure you have a module in the .lang file matching the name of the report definition. (the parts highlighted in green in the guide above)
2. Make sure you have saved the file as utf-8.
3. Check the lng="you language" attribute.
4. Make sure that you have no XML errors in the file.


Regards,
GpsGate Support
Bjorn Andersson

rosol
Posts: 98
Joined: Mon Feb 13, 2012 3:11 pm

RE: GUIDE: Translate Reports

Thu Apr 19, 2012 6:31 pm

Hi,
How can I translate other reports?
Best regards
rosol

rosol
Posts: 98
Joined: Mon Feb 13, 2012 3:11 pm

RE: GUIDE: Translate Reports

Thu Apr 19, 2012 6:33 pm

PS. I don't know any phrase keys to translate...

User avatar
johan
GpsGate
Posts: 15293
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: GUIDE: Translate Reports

Thu Apr 19, 2012 6:37 pm

You follow the guide above. (Read it).

Regards,
Johan

GpsGate Support

rosol
Posts: 98
Joined: Mon Feb 13, 2012 3:11 pm

RE: GUIDE: Translate Reports

Thu Apr 19, 2012 6:56 pm

But I want to translate result HTML with report, for example:
Period: 19 kwietnia 2012 - 19 kwietnia 2012
Car: c8809, c8809
Day Start Stop Total Time Travel Time Idle time Distance Avg Speed Max Speed
Distance 0.0 km Travel time 00h 00m 00s Avg. speed 0.0 km/h Max. speed 0.0 km/h

How to translate that?

kalmangabriel
Posts: 385
Joined: Wed Feb 25, 2009 12:36 am
Location: Romania
Contact: Website Skype

RE: GUIDE: Translate Reports

Fri Apr 20, 2012 6:36 am

@rosol

do you mean the old reports ?
that files are located @ IIS\Reports\DistanceReport and IIS\Reports\EventReport

for example:
make a copy of "WeeklyDetails.English.xslt", rename it as "WeeklyDetails.Polish.xslt"
translate any required string to polish in the new file..

rosol
Posts: 98
Joined: Mon Feb 13, 2012 3:11 pm

RE: GUIDE: Translate Reports

Fri Apr 20, 2012 7:43 pm

THANKS! This is what I was looking for!
:)
Regards

grigor
Posts: 90
Joined: Mon May 14, 2012 6:41 pm
Location: Albania
Contact: Facebook Twitter Skype

RE: GUIDE: Translate Reports

Wed May 16, 2012 1:41 am

hello everyone,
i translated all report that we need and save them TR100X.albanian.lang at "..IIS\Resources\Languages". i got "rescan langage and measurements" and when i execute the report nothing change..how can resolve this problem please?
<font color="red">
<?xml version="1.0" encoding="utf-8"?>
<Language lng="Albanian" enablecache="true">
<MetaData>
<Translator>Björn S.</Translator>
<DateTranslated>2011-09-14</DateTranslated>
</MetaData>
<Translation>
<Version value="3.0.0.0">
<Modules>
<Module name="TR1000 Trip & Idle (Detailed)">
<Server>
<Phrase key="Start Time">Koha e nisjes</Phrase>
<Phrase key="TR1000 Trip & Idle (Detailed)">TR1000 Levizjet & Ndalesat ( Detajuar)</Phrase>
<Phrase key="Shows the time and duration of all trips and idles for vehicles within the selected period. Periods of being offline (when a tracker is not sending data to the server) are excluded from the report.">Tregon kohën dhe kohëzgjatjen e të gjitha udhëtimeve dhe ndalesave për automjete brenda periudhës së zgjedhur. Periudhat e shkëputur (kur automjeti nuk është duke dërguar të dhëna në server) janë të përjashtuar nga raporti.</Phrase>

<Phrase key="Period Start:">Periudha e nisjes</Phrase>
<Phrase key="Period End:">Peirdha e ndalimit</Phrase>
<Phrase key="Total Vehicles:">Totali i makinave</Phrase>
<Phrase key="Total Duration Trip:">Totali i levizjes se makinave</Phrase>
<Phrase key="Total Duration Idle:">Totali i ndalesave te makinave</Phrase>
<Phrase key="Total Distance:">Distanca totale</Phrase>
<Phrase key="* Idle = Time a vehicle is online and while standing still.">Koha e nje automjeti kur qendron online dhe vazhdon te jete e tille</Phrase>
<Phrase key="* Trip = Time that a vehicle is online and moving.">Koha e nje automjeti kur qendron online dhe eshte duke levizur</Phrase>
<Phrase key="Stop Time">Koha e ndalimit</Phrase>
<Phrase key="Duration">Kohezgjatja</Phrase>
<Phrase key="Start Address">Adresa e nisjes</Phrase>
<Phrase key="Stop Address">Adresa e ndalimit</Phrase>
<Phrase key="Distance (GPS)">Distance (GPS)</Phrase>
<Phrase key="Max Speed">Shpejtesi maksimale</Phrase>
<Phrase key="Avg Speed">Shpejtesi mesatare</Phrase>
<Phrase key="Trip/Idle*">Levizje/Ndaluar</Phrase>
<Phrase key="run">Ne levizje</Phrase>
<Phrase key="idle">Ndaluar</Phrase>
</Server>
</Module>
<Module name="TR1001 Trip & Idle (Daily)">
<Server>
<Phrase key="TR1001 Trip & Idle (Daily)">TR1001 Levizje & Ndalesa ( Ditore) </Phrase>
<Phrase key="Date">Data</Phrase>
<Phrase key="Trips and idles, by vehicle">Levizjet dhe ndalesat sipas makines</Phrase>
<Phrase key="Period Start:">Periudha e nisjes</Phrase>
<Phrase key="Period End:">Periudha e ndaleses</Phrase>
<Phrase key="Total Vehicles:">Totali i makinave</Phrase>
<Phrase key="Total Distance:">Distanca totale</Phrase>
<Phrase key="Total Duration Trip:">Kohezgjatja totale e levizjes</Phrase>
<Phrase key="Total Duration Idle:">Kohezgjatja totale e ndalesave</Phrase>
<Phrase key="Total Trips:">Levizjet totale</Phrase>
<Phrase key="Total Idles:">Ndalesat totale</Phrase>
<Phrase key="* Duration Idle = Time a vehicle is online and while standing still.">
*Kohezgjatja e ndalesave= Koha e nje automjeti kur eshte onlie dhe qendron ende i tile</Phrase>
<Phrase key="* Duration Trip = Time that a vehicle is online and moving.">
*Koha e nje automjeti kur qendron online dhe eshte duke levizur</Phrase>
<Phrase key="Date">Data</Phrase>
<Phrase key="Start Time">Koha e nisjes</Phrase>
<Phrase key="Stop Time">Koha e ndalimit</Phrase>
<Phrase key="Total Distance (GPS)">Distanca totale (GPS)</Phrase>
<Phrase key="Max Speed">Shpetesi maksimale</Phrase>
<Phrase key="Duration Idle*">Kohezgjatja e ndalesave</Phrase>
<Phrase key="Duration Trip*">Kohezgjatja e udhetimit</Phrase>
<Phrase key="Idle (%)">Ndaluar (%)</Phrase>
</Server>
</Module>


</Modules>
</Version>
</Translation>
</Language>
</font id="red">

User avatar
Bjorn_Andersson
GpsGate
Posts: 462
Joined: Wed Jun 28, 2006 5:20 pm
Location: Sweden
Contact: Website

RE: GUIDE: Translate Reports

Wed May 16, 2012 12:52 pm

Hi,
Works for me.

Please verify:
1. File is saved with UTF-8 encoding. (Open the file in notepad and click "save as" choose utf-8 encoding in the list left to the save button)
2. That lng="<font color="red">Albanian</font id="red">" is exactly the same as in the main .lang file (even upper/lower cases)
3. Escape all illegal characters see second post in this topic. In your case replace all & with &


If the file contains errors you should find error messages in the log file from IIS. Look for "Error importing language file".

Regards,
GpsGate Support
Bjorn Andersson

grigor
Posts: 90
Joined: Mon May 14, 2012 6:41 pm
Location: Albania
Contact: Facebook Twitter Skype

RE: GUIDE: Translate Reports

Wed May 16, 2012 4:40 pm

hello again,
thanks for the help, i have another question,
the same report translated on one of the application and on the other application could not translated?

piter197
Posts: 832
Joined: Sun Jan 09, 2011 3:32 am

RE: GUIDE: Translate Reports

Sun Jan 27, 2013 12:42 pm

Hi support,

I try to translate TR1003 report and only partially translated.

<?xml version="1.0" encoding="utf-8"?>
<Language lng="Indonesian" enablecache="true">
<MetaData>
<Translator>Piter197</Translator>
<DateTranslated>2013-01-27</DateTranslated>
</MetaData>
<Translation>
<Version value="3.0.0.0">
<Modules>
<Module name="TR1003 Trip & Idle">
<Server>
<Phrase key="Name:">Nama:</Phrase>
<Phrase key="Distance">Jarak</Phrase>
<Phrase key="Distance Report">TR1003 KM Tempuh Kendaraan (Ringkas)</Phrase>
<Phrase key="Period:">Periode:</Phrase>
<Phrase key="Car:">Kendaraan:</Phrase>
<Phrase key="Date:">Tanggal:</Phrase>
<Phrase key="Start">Awal</Phrase>
<Phrase key="End">Akhir</Phrase>
<Phrase key="Duration">Durasi</Phrase>
<Phrase key="Distance">Jarak (GPS)</Phrase>
<Phrase key="Avg Speed">Kecepatan Rerata</Phrase>
<Phrase key="Max Speed">Kecepatan Maks.</Phrase>
<Phrase key="Idle">Diam</Phrase>
<Phrase key="Travel time">Waktu tempuh</Phrase>
</Server>
</Module>
</Modules>
</Version>
</Translation>
</Language>


Only phrases "Distance Report", "Period:" and "Car:" that successfully translated, other else fail to be translated.


Also for SG1001 Signal Report can only be partially translated, phrases "Value" and "Reported" fail to be translated (this is not happening on SG1000 all phrases can be translated).

For SY1000 and SY1001 phrases "devices" fail to be translated. I check in SiteAdmin Report Template it is $count([DeviceId]) devices, how to address this?

Please advice. Thank you.


Best Regards,
piter197

User avatar
Bjorn_Andersson
GpsGate
Posts: 462
Joined: Wed Jun 28, 2006 5:20 pm
Location: Sweden
Contact: Website

RE: GUIDE: Translate Reports

Tue Jan 29, 2013 11:57 am

Hi,
It looks like the TR1003 and SG1001 have spaces at the end of the column titles eg. "Distance " instead of "Distance".
The reporting framework should remove those before trying to look up the translation. This will be fixed to next release.

The second problem only affect TR1003.
Some variables like the distance and duration summary is mixing Text along with expressions (ex: Distance: $SUM([DistanceGps]) in the same cell which makes impossible to translate since the value to translate will be different every time.
To get those values translated the only option is to translate the values directley in the report definition.

Regards,
GpsGate Support
Bjorn Andersson

Return to “GpsGate for Developers”