-
Notifications
You must be signed in to change notification settings - Fork 126
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] Harmonize multilanguage parameters in navitia #4084
Conversation
source/jormungandr/jormungandr/street_network/tests/handimap_test.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need navitia-configurator PR too to change asgard_language to language
https://github.com/hove-io/navitia-configurator/blob/fbf8cb3e8b3e0691a03b122c1cdc5fd75c099642/coverages.py#L86
and how to switch ? hard manual sync or smooth with retro-compatibility?
The new parameter language in navitia as well as attribute in the database has a default value 'french'. |
c6de984
to
ef62ebf
Compare
class Languages(Enum): | ||
french = "fr-FR" | ||
english = "en-EN" | ||
LANGUAGE_TRANSFORMATION_LIST = {"en-US": "en-EN", "en-GB": "en-EN", "fr-FR": "fr-FR"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated in another comment, this "en-EN" language tag was a documentation error on our side (Handimap).
You can safely replace it with a more conventional en-US
without any risk (en-US
is our default, and already used used as fallback for any unknown language tag like en-EN
).
Sorry for that documentation fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated in another comment, this "en-EN" language tag was a documentation error on our side (Handimap). You can safely replace it with a more conventional
en-US
without any risk (en-US
is our default, and already used used as fallback for any unknown language tag likeen-EN
). Sorry for that documentation fail.
Hi @jthiard will it be possible to put the link of the DOC Hadimap as I don't have other than https://dev.keolis-rennes.handimap.fr/docs/ and it give mes [ fr-FR, en-EN ] as language ?
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kadhikari sure, we have two urls :
- https://dev.keolis-rennes.handimap.fr/docs/ : our staging instance
- https://keolis-rennes.handimap.fr/docs/ our prod instance
At this time the two use the same version since there is no future version in staging yet.
If you still see en-EN
on https://dev.keolis-rennes.handimap.fr/docs/ it may be your browser cache. You can try https://keolis-rennes.handimap.fr/docs/ which may be not cached on your side.
I just changed the webserver config to send "no cache" headers for our openAPI file to avoid this cache problem in the future.
source/jormungandr/jormungandr/street_network/tests/handimap_test.py
Outdated
Show resolved
Hide resolved
@@ -585,7 +585,7 @@ def _build_fallback( | |||
car_park_crowfly_duration = None | |||
via_pt_access = None | |||
via_poi_access = None | |||
language = request.get('_asgard_language', "english_us") | |||
language = request.get('language', "en-US") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for https://github.com/hove-io/navitia/pull/4084/files#diff-1db49300dbe77e5d5ef58deb0ebd54793fd7851c5f9a3b238ebd4091567bf5caR133 and https://github.com/hove-io/navitia/pull/4084/files#diff-3307dc8a614b49809e0d0843ff12386f70537d2f093790b1d2872d6fd89ab70eR352:
Here you don't "respect" the default value of the coverage, no?
I think you should default to None and have asgard-connector deal with the default(coverage) value in a single place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nearly impossible to have language = None, and it arrives default language in navitia before using connector street_network will be fr-FR
Since instance is absent here, no way to get instance.language !
source/jormungandr/jormungandr/street_network/tests/handimap_test.py
Outdated
Show resolved
Hide resolved
ef62ebf
to
35ad492
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs 68.4% Coverage The version of Java (11.0.14.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
The followings are some details:
language
is provided in request, using the value configured in the coverage (default value for coverage = fr-FR)fr-FR
Note: The existing attribute asgard_language should be deleted once the next release is deployed to all the platforms.
For more details: https://navitia.atlassian.net/browse/NAV-2152