Skip to content

Add support for caching based on Locale #1356

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

Merged
merged 9 commits into from
Dec 2, 2021

Conversation

ianwallen
Copy link
Contributor

Add support for caching based on Locale. - Fixed #1354

@bnasslahsen
Copy link
Collaborator

@ianwallen,

Thank you @ianwallen for your efforts.
Tests are still failing for your PR.

Once corrected, i will proceed with the merge.

@ianwallen
Copy link
Contributor Author

Finally got it working - sorry for all the commits - I was having problems running all the test on my local system.

@bnasslahsen bnasslahsen merged commit 979ddec into springdoc:master Dec 2, 2021
@ianwallen
Copy link
Contributor Author

@bnasslahsen
I should point out that the cache that I implemented is based on the locale language only.
Looking at the following, this morning it seems like the messages files can get more complicated that simply using "en" or "fr"

https://sites.google.com/site/openjdklocale/design-notes/resource-bundle-lookup-order

So if someone is using different message files for en_US and en_UK, they would both be using the same "en" language cache so it would just load the first occurrence into the cache map.

I was originally going to use the Locale in the map however I was not sure if the Locale would work correctly during the lookup and after finding the following it seems like it could get more complicated that I wanted to go.

http://www.java2s.com/Code/Java/Collections-Data-Structure/MapusingLocaleobjectsaskeys.htm

Not sure if you want to leave it as is or flag this as a future enhancement?

@ianwallen ianwallen deleted the 1354_unit_test_170 branch December 2, 2021 11:24
@bnasslahsen
Copy link
Collaborator

@ianwallen,

I would say that if you feel confident about this enhancement, you can submit another PR.
I guess, this new PR should be easier than the original one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for caching based on Locale.
2 participants