Skip to content

Commit

Permalink
Update translation process
Browse files Browse the repository at this point in the history
Document automation, add missing strings and Fix #4
  • Loading branch information
nlehuby committed Sep 16, 2020
1 parent 82e91ae commit 2fab4e0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
6 changes: 5 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"Search": "Search",
"Town": "Town",
"Examples": "Examples",
"with fare and schedules": "with fare and schedules",
"on-demand bus": "on-demand bus",
"night bus": "night bus",
"with images and wikipedia": "with images and wikipedia",
"Search routes": "Search routes",
"Line number": "Line number",
"Operator / Network": "Operator / Network",
Expand Down Expand Up @@ -50,7 +54,7 @@
"On demand conditions": "On demand conditions",
"This line has on demand services.": "This line has on demand services.",
"This line is on demand.": "This line is on demand.",
"This line has 'hail and ride' sections.": "This line has 'hail and ride' sections.",
"There are some sections on this route with no fixed stops, where you can get on or off the vehicle anywhere along the road by giving a sign to the driver": "There are some sections on this route with no fixed stops, where you can get on or off the vehicle anywhere along the road by giving a sign to the driver",
"External links": "External links",
"See the timetable on vianavigo.com": "See the timetable on vianavigo.com",
"Compare open data and OpenStreetMap": "Compare open data and OpenStreetMap",
Expand Down
9 changes: 3 additions & 6 deletions i18n/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
TODO
- transifex push on merge on master
- transifex pull when translation is complete

## Principles

Do not modify `lang.json` files in this repo. Translations happen on [Transifex](https://www.transifex.com/jungle-bus/unroll) only.
Expand All @@ -17,8 +13,9 @@ Client-side, on load:
When new messages are added into the code:
- add them into `en.json` file
- use `i18n_message['translation_key']` into the code
- push `en.json` file to Transifex on merge on master branch (automatically done by travis) // TODO

The `en.json` file is automatically sync with Transifex on merge on master branch

When the translations are updated:
- pull `lang.json` from Transifex
- check if `lang` is an available language (from commons.js)
- add `lang` as available language (in `commons.js`) if necessary
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function display_examples(){
"colour":"grey",
"operator":"",
"network":"",
"comment": "with fare and schedules",
"comment": i18n_messages["with fare and schedules"],
"name":"bus 37: Gare Sud↔Yopougon Camp Militaire",
},
{
Expand All @@ -55,7 +55,7 @@ function display_examples(){
"colour":"grey",
"operator":"",
"network":"",
"comment": "on-demand bus",
"comment": i18n_messages["on-demand bus"],
"name":"Bus Filéo Saint-Pathus : Roissypole ↔ Saint-Pathus"
},
{
Expand All @@ -65,7 +65,7 @@ function display_examples(){
"colour":"#F78F4B",
"operator":"",
"network":"",
"comment": "night bus",
"comment": i18n_messages["night bus"],
"name":"Noctilien N24: Gare de Sartrouville ↔ Châtelet "
},
{
Expand All @@ -75,7 +75,7 @@ function display_examples(){
"colour":"#75c695",
"operator":"",
"network":"",
"comment": "with images and wikipedia",
"comment": i18n_messages["with images and wikipedia"],
"name":"Paris Métro line 6",
},
]
Expand Down
2 changes: 1 addition & 1 deletion route.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ function get_and_display_on_demand_info(relation_id, tags){
var title = i18n_messages["This line is on demand."];
}
else if (tags['hail_and_ride'] === 'partial' || tags['hail_and_ride'] === 'yes') {
var title = i18n_messages["This line has 'hail and ride' sections."];
var title = i18n_messages["There are some sections on this route with no fixed stops, where you can get on or off the vehicle anywhere along the road by giving a sign to the driver"];
} else {
return
}
Expand Down

0 comments on commit 2fab4e0

Please sign in to comment.