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 lang tests #5292

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Fix lang tests #5292

wants to merge 7 commits into from

Conversation

toaster
Copy link
Member

@toaster toaster commented Dec 1, 2024

Description:

Fixes a bug in the lang tests for AddTranslations on systems without English system locale.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls
Copy link

Coverage Status

coverage: 60.015% (+0.003%) from 60.012%
when pulling 4abab4b on toaster:bugfix/lang_tests
into e8be3f6 on fyne-io:develop.

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Thanks for this. I have two questions inline because I'm not sure of the change

@@ -203,7 +203,5 @@ func updateLocalizer() {
fyne.LogError("Failed to load user locales", err)
all = []string{"en"}
}
str := closestSupportedLocale(all).LanguageString()
setupLang(str)
localizer = i18n.NewLocalizer(bundle, str)
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this was superfluous?
The intention was that it would replace whatever previous configuration was set up...

Copy link
Member Author

Choose a reason for hiding this comment

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

setupLang does the exact same thing, see https://github.com/fyne-io/fyne/blob/develop/lang/lang.go#L196

Copy link
Member

Choose a reason for hiding this comment

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

Excellent, sorry for missing that - I was on my mobile

lang/lang_test.go Show resolved Hide resolved
Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

👍

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.

3 participants