Skip to content

Commit

Permalink
Merge pull request #4092 from hove-io/fix_multilanguage_in_utils
Browse files Browse the repository at this point in the history
Correction for access and exit path instructions
  • Loading branch information
Krishna Prasad ADHIKARI authored Aug 18, 2023
2 parents eb4d8ae + d3b46ea commit e89215a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,22 @@ def _extend_with_car_park(

def get_enter_instruction_words(lan):
instructions = {
"english_us": u"Then enter {} via {}.",
"french": u"Accédez à {} via {}.",
"spanish": u"Acceso a {} vía {}.",
"italian": u"Accesso alla {} via {}.",
"en-US": u"Then enter {} via {}.",
"fr-FR": u"Accédez à {} via {}.",
"es-ES": u"Acceso a {} vía {}.",
"it-IT": u"Accesso alla {} via {}.",
}
return instructions.get(lan, instructions["english_us"])
return instructions.get(lan, instructions["en-US"])


def get_exit_instruction_words(lan):
instructions = {
"english_us": u"Exit {} via {}.",
"french": u"Sortez de {} via {}.",
"spanish": u"Salida {} vía {}.",
"italian": u"Uscita {} via {}.",
"en-US": u"Exit {} via {}.",
"fr-FR": u"Sortez de {} via {}.",
"es-ES": u"Salida {} vía {}.",
"it-IT": u"Uscita {} via {}.",
}
return instructions.get(lan, instructions["english_us"])
return instructions.get(lan, instructions["en-US"])


def append_path_item_with_access_point(path_items, stop_point, access_point, language):
Expand Down
4 changes: 2 additions & 2 deletions source/jormungandr/tests/routing_tests_experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,9 @@ def test_path_instructions(self):
assert pt_journey
assert len(pt_journey['sections'][0]['vias']) == 1
path = pt_journey['sections'][0]['path'][-1]
assert path['instruction'] == "Then enter stop_point:stopB (Condom) via access_point:B1."
assert path['instruction'] == "Accédez à stop_point:stopB (Condom) via access_point:B1."
path = pt_journey['sections'][2]['path'][0]
assert path['instruction'] == "Exit stop_point:stopA (Condom) via access_point:A2."
assert path['instruction'] == "Sortez de stop_point:stopA (Condom) via access_point:A2."

# Verify some path instructions managed by jormungandr in English as default language
query = journey_basic_query + "&_access_points=true&language=ja-JP"
Expand Down

0 comments on commit e89215a

Please sign in to comment.