Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Jormungandr] language: Fix for access and exit path instructions #4092

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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