-
Notifications
You must be signed in to change notification settings - Fork 64
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
[BUG] g11n-java-client - ComponentService.getMessages is not retrieving "matchedLocale" properly #781
Comments
@lyiyu66 , FYI. Please review. |
Does this mean that it's impossible to get translation of fr-CA when both fr and fr-CA are supported? |
Expected behavior For the expected behavior, is it a typo "fr-FR"on there should have been NO call to VIP service for fr_FR in step #4 above anymore because it matches "fr"? Should be fr-CA? In current behavior, when user requests fr-CA, client will send a http request with fr-CA to service. I think it is correct and expected behavior. For the locale that can't be found in cache, client should send out the request to fetch from service even data has been cached initially since below possible scenarios:
|
Suggest solution:
Refer to suggestion on the PR. I think this also can resolve issue #754 |
No, fr-CA will be queried from service because it is supported. |
Yes, it was a typo. |
Yes, you got it! :) This issue and associated solution is is for 1.1 above. Number 1.2 will be resolved in issue 754. I decided to split up issue 754 because the initial PR was too big..code reviewers were having a hard time. Regarding your following comment:
The list of supported locales is in cache with an expiry logic. When it expires, it will be fetched again from the service so any missing locale or newly added locale will be included then. |
Describe the bug
ComponentService.getMessages is not retrieving "matchedLocale" from cache properly.
To Reproduce
Expected behavior
Because cache has been initialized at app start up, there should have been NO call to VIP service for fr_CA in step #4 above anymore because it matches "fr". CacheService.getCacheOfComponent should have immediately returned the messages of "fr" locale from client-side cache.
The text was updated successfully, but these errors were encountered: