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

[resources] Select default resource if there are no exact language+region or default language match #4577

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

terrakok
Copy link
Collaborator

@terrakok terrakok commented Apr 5, 2024

We need to filter by language and region together because there is slightly different logic:

  1. if there is the exact match language+region then use it
  2. if there is the language WITHOUT region match then use it
  3. in other cases use items WITHOUT language and region qualifiers at all

Given resources:
values
values-en-rUS
values-de

Filter results:
"en" -> values
"en-US" -> values-en-rUS
"en-GB" -> values
"de-IT" -> values-de

fixes #4571

…gion or default language match

Given resources:
values
values-en-rUS
values-de

Filter results:
"en" -> values
"en-US" -> values-en-rUS
"en-GB" -> values
"de-IT" -> values-de
@terrakok terrakok requested a review from pjBooms April 5, 2024 10:40
@terrakok terrakok merged commit 2bb6ec5 into master Apr 5, 2024
@terrakok terrakok deleted the k.tskh/issue-4571 branch April 5, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stringResource filters the default when getting the resource path
2 participants