Fix incorrect locale value in argv.json #171750
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref #169114
With this change, if the locale value needs to be trimmed, the trimmed locale value gets saved to argv.json instead of the untrimmed one.
For example, let's say platform.locale is "fr-ca", and that we are going through the flow of recommending a language pack. In this case, we first try to search for an extension with the query "tag:lp-fr-ca", which returns no results, so we trim the locale to "fr" and try again. Searching "tag:lp-fr" returns a result, and so we install and download that language pack if the user presses the accept button. However, previous to this commit, the value "fr-ca" gets saved in argv.json rather than "fr".