For now, I've only added supporting for shifting from new-locale to update-locale and vice-versa when --locale argument is provided. My thinking here is that since both the commands support creating/updating multiple locales, what if the user enters a non-existing locale after updating multiple locales? User may expect the generated PR to contain both updated and newly created locales, but I've not handled that case here.
This PR adds two new commands new-locale and update-locale following the specifications listed in issue #78.
Locale comparisons
For locale comparions, I've used RegionInfo Class (reference: https://learn.microsoft.com/en-us/dotnet/api/system.globalization.regioninfo?view=net-7.0&redirectedfrom=MSDN). The benefit here is that it validates the locale format and also treats locales such as
en-US
,en-USA
,en-us
etc as same which prevents duplicate locales added in the manifest.### Command flow shiftFor now, I've only added supporting for shifting from new-locale to update-locale and vice-versa when--locale
argument is provided. My thinking here is that since both the commands support creating/updating multiple locales, what if the user enters a non-existing locale after updating multiple locales? User may expect the generated PR to contain both updated and newly created locales, but I've not handled that case here.Let me know if I should add the ability to prompt for flow change whenever an invalid locale is input by the user (or only the first time user inputs an invalid locale?).Removed (see https://github.com/microsoft/winget-create/pull/480#discussion_r1418146150)Microsoft Reviewers: Open in CodeFlow