Multi-Language support

44 views
Skip to first unread message

Vicente Pérez

unread,
Mar 21, 2020, 7:40:16 PM3/21/20
to onebusaway-developers
Hi,

I was working with the fork of master brach, and I could add multi languange support and unit (km/miles) acording to the locale. If some is interest, please let me know.

Best regads.
Vicente

Wojciech Kulesza

unread,
Mar 23, 2020, 5:31:08 AM3/23/20
to onebusaway-developers
Hi,
definitely of interest to us. Which part do you mean, as mobile apps already support that? Was working with Aaron to get that support in OBA iOS already.

Vicente Pérez

unread,
Mar 23, 2020, 8:05:52 AM3/23/20
to onebusaway...@googlegroups.com
Cześć Wojciech, 

I was working on the Web, specifically completing what was not translated, add the translation into JavaScript part (popup, routmap and sidebar) and to get the information of real time some specific language and unit. 

We will do some work in ios, the first approach was to translate what was needed. 

Best regards 
Vicente 

--
You received this message because you are subscribed to the Google Groups "onebusaway-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onebusaway-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/onebusaway-developers/452cd4c5-2b14-411d-9171-a0645b529730%40googlegroups.com.

Vicente Pérez

unread,
Mar 25, 2020, 4:03:12 PM3/25/20
to onebusaway-developers
By the way. Take a look at https://github.com/vsperez/onebusaway-application-modules/tree/buscity to see  the changes. 

Metodi Milchev

unread,
Jun 7, 2020, 9:18:31 AM6/7/20
to onebusaway-developers
Hi Vicente,

I am interested in multi language support and displaying distance in kilometers instead of miles.
I deployed OBA v.2.0.0 modules (transit-data-federation, api, acta-enterprise and admin) on Debian.
There is a problem with displaying non-English characters (not all, but some) in the popups (InfoWindow).
when I changed the stopTerm in onebusaway-enterprise.properties with non-English charactesrs it is
not displaying correctly on the Stop popup with arrivals.
Other problems I have when tracking a Vehicle - the non-English characters from the GTFS info are not displaying well.

Do you have an idea how this issue can be fixed?
Or, do you have binaries of your version I can deploy and check if they are working? :)

Thanks!

Vicente Pérez

unread,
Jun 7, 2020, 6:42:14 PM6/7/20
to onebusaway...@googlegroups.com
Hi Milchev, 

Today I commit some few changes in order to work better.  I am not expert on struts, so there might be some way to improve the language support, but I am using html encoding like "&aacute;" for texts  and s:property  with escape="false" or <oba:message key='key' />. 

Some tips:

- I deployed a lot of translation in package.properties in resources of enterprise-webapp module, you should just translate that and it should be working.
- I add a map for getting the values in JS. You can use getValueFor('key');
- In the javascript use html instead of text function. For instance suggestions.find("h2").html(getValueFor("did.you.mean")) instead of suggestions.find("h2").text(getValueFor("did.you.mean"))
- I change the method getPresentableDistance of org.onebusaway.presentation.impl.realtime.PresentationServiceImpl class. This is the method that handles the presentation results. I add the parameter Locale. There the unit is asked in its corresponding bundle. For  instance  if package_es.properties contains unit=metric, it will be shown in  mks system, otherwise Imperial. So you might have en_UK with metric and  en_US with imperial.
- I changed in my branch the map.js to acta project to work faster and I am using mainly OSM, even though I tried to keep compatibility with gmaps. 

By the way, the branch I'm using is buscity (https://github.com/vsperez/onebusaway-application-modules). There is other change that you might want to avoid. I add city aggrupation. 

Hope it helps.
Best regards





--
You received this message because you are subscribed to the Google Groups "onebusaway-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onebusaway-devel...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages