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

Fix: Correct load os language for MessageFormatExtensions #15441

Conversation

XTorLukas
Copy link
Contributor

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. The default language for MessageFormatExtensions is loaded as the default OS language

@XTorLukas
Copy link
Contributor Author

This is a quick solution, but it would be good to do this when starting the application, because when I delete Local > Packages, the default language is not set to os, but here you would need to test if the language can be used within the application, or set the default 'en'

@yaira2 yaira2 requested a review from 0x5bfa May 22, 2024 01:32
// Add default language
var osDefaultLanguage = new AppLanguageItem(CultureInfo.InstalledUICulture.Name);
if (AppLanguages.Select(language => language.LanguageName.Contains(osDefaultLanguage.LanguageName)).Any())
AppLanguages[0].LanguagID = osDefaultLanguage.LanguagID;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to make any changes here, it should be possible to handle everything from the format extension class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for the change to GeneralViewModel.cs was to store the language name, thus avoiding string.Empty, but this is also addressed in a future helper class

Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise

src/Files.App/Extensions/MessageFormatExtensions.cs Outdated Show resolved Hide resolved
src/Files.App/ViewModels/Settings/GeneralViewModel.cs Outdated Show resolved Hide resolved
@XTorLukas
Copy link
Contributor Author

XTorLukas commented May 22, 2024

although I hadn't planned to finish it today I have a helper class ready, but then this fix will be unnecessary
#15443

Co-authored-by: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
@yaira2 yaira2 closed this May 22, 2024
@XTorLukas XTorLukas deleted the xtorlukas/Fix-CorrectDefaultApplicationLanguage branch May 22, 2024 16:43
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.

Bug: Not correct Default system language load for MessageFormatExtensions
3 participants