Italian language

106 views
Skip to first unread message

Luca Santaniello

unread,
Apr 20, 2011, 4:45:26 AM4/20/11
to OpenTripPlanner Developers
Hi all,

I want translate OTP in italian language. How can I do it? Exist
language properties file? Where is it?

Thanks in advance

Luca

Frank

unread,
Apr 20, 2011, 9:26:10 AM4/20/11
to OpenTripPlanner Developers
Hi Luca,

You question about localizing into Italian made me re-look at the OTP
code. I'm going to be checking in some changes later today once I
test, which should make localizing a bit more complete, as well as
easier to configure.

Anyway, as a start, take a look at the files in opentripplanner
\opentripplanner-webapp\src\main\webapp\js\otp\locale\. If you copy
English.js over to Italian.js, and localize that, you will be 90%
there. There are some other strings floating around in the code, that
a localized version of this version of English will not catch. One of
my changes (mentioned above) will be to add a few new entries to
English.js (and the other current localizations). Another change is
getting config.js to be the place where localization is configured
(the way the code is now, it's not obvious that that's the place where
these decisions should be made). I'll reply back to this thread once
I'm done.

BTW, thanks for working on Italian...it will be great if you can share
that work with OTP.

Take care,
Frank



On Apr 20, 1:45 am, Luca Santaniello <luca.santaniello...@gmail.com>
wrote:

Luca Santaniello

unread,
Apr 21, 2011, 5:40:52 AM4/21/11
to OpenTripPlanner Developers
Thanks for reply Frank,

I will translate English.js and will send it to you.

Thank you

Luca

Luca Santaniello

unread,
Apr 21, 2011, 6:54:35 AM4/21/11
to OpenTripPlanner Developers
Then I created Italian.js in locale dir, what I must configure for
active Italian language file?

Thanks

Frank Purcell

unread,
Apr 21, 2011, 10:47:25 AM4/21/11
to opentripp...@googlegroups.com
Hey Luca,

I checked in a few changes , so if you haven't already, svn update to get the latest code (rev 1286) from trunk.   

Here's what to do get the Italian localized version of OTP:
  1. Do a diff of the latest version of English.js to your Italian.js file (and add any new entries to your Italian.js).
      NOTE: I added two new sections to English.js:  otp.locale.English.config and otp.locale.English.tripPlanner.link (also updated Spanish.js with these sections as a test of the localization).  These new localizations replace all the hard-coded English strings that were in the previous version of file config.js. 
  2. Edit index.html to include your new Italian.js file.
  3. At the top of config.js, there's a place to specify the language, set it to otp.locale.Italian.

NOTE: the code localization needs a bit more work on trip itinerary results.  There are hard-coded English strings in js/otp/planner/Templates.js that has to be changed to accept key/value pairs from js/locale/<Language>.js. 

Let me know how it goes, and feel free to send Italian.js to me and I'll add it to svn.  (And if you end up localizing any part of Templates.js, send it along too, and I'll incorporate your changes).

Take care,
Frank

Luca Santaniello

unread,
Apr 22, 2011, 3:05:06 AM4/22/11
to OpenTripPlanner Developers
Thanks, I test my language and I will send to you.

Frank Purcell

unread,
Apr 22, 2011, 5:00:01 AM4/22/11
to opentripp...@googlegroups.com
Sounds good, Luca. I just checked in a final set of changes 5 minutes
ago to org.locale.English and Spanish (version 1292). Please see all
the new key / value pairs entries in 'directions', 'instructions' and
'labels' (among others). BTW, eclipse has a pretty decent diff for
comparing two files...

Gerardo Carrieri

unread,
Mar 7, 2012, 8:49:23 AM3/7/12
to opentripp...@googlegroups.com
Hi Frank,
I'm a Luca's friend ;)

I traslated 2 localizations, italian (updated) and german, how can I send them to you?

Ciao,
Gerardo
Reply all
Reply to author
Forward
0 new messages