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

Creating a profile changes the language of Joplin #9960

Closed
JackGruber opened this issue Feb 18, 2024 · 6 comments · Fixed by #10038
Closed

Creating a profile changes the language of Joplin #9960

JackGruber opened this issue Feb 18, 2024 · 6 comments · Fixed by #10038
Labels
bug It's a bug desktop All desktop platforms high High priority issues

Comments

@JackGruber
Copy link
Contributor

JackGruber commented Feb 18, 2024

Operating system

Windows

Joplin version

2.14.14

Desktop version info

Joplin 2.14.14 (prod, win32)

Client ID: 0e33609c84614b3092102ff00887b36e
Sync Version: 3
Profile Version: 45
Keychain Supported: Yes

Revision: ecb6ac3

Current behaviour

  1. Change your Joplin language other than the operating system language
  2. Create a new profile
  3. The language for the new profile is the same as for the operating system
  4. Change back to your original profile
  5. The language has now been changed to that of the operating system here too

Expected behaviour

The language should not be changed automatically when creating a new Joplin profile

Logs

No response

@JackGruber JackGruber added the bug It's a bug label Feb 18, 2024
@laurent22 laurent22 added desktop All desktop platforms high High priority issues v3.0 labels Feb 18, 2024
@roman-r-m
Copy link
Collaborator

We do not assign issues

Repository owner deleted a comment from abansal15 Feb 21, 2024
@HahaBill
Copy link
Contributor

I have the same issue! (macOS Sonoma, 14.3.1). I will try to have a look once I am done with my PR :)

Other contributors and GSoC candidates, feel free to also have a look and solve the issue!

@PrathameshSonje
Copy link

I'm a little confused about what the expected behavior should be,

If I'm not mistaken, the expected behavior is that the language set in the default profile should apply to new profiles by default.

Default profile - Arabic
New profile - ENG (actual behavior)
New Profile - Arabic (expected)

@JackGruber
Copy link
Contributor Author

If the language was changed in the default profile, it should not be changed by creating a new profile to the system default language.

@cagnusmarlsen
Copy link
Contributor

cagnusmarlsen commented Mar 2, 2024

So I looked into this issue and I think I understand what the problem is. When a new profile is created, this line

const locale = shim.detectAndSetLocale(Setting);

in
/packages/lib/BaseApplication.ts sets the locale to the system default language and because locale is a global property (isGlobal: true), it gets changed in the default profile as well as all other profiles. This is what changes the language of the default profile to the system default.

A fix for this would be to not set locale when a new profile is created, and instead create the new profile with the same locale value. This ensures that the language set in the default profile is applied globally to all profiles and a change of languages applies to every profile. I've tested the app with these changes and it seems to be working the way it should be.

I could create a PR with these changes if this seems like the right way to go.

@laurent22
Copy link
Owner

Yes something like this should work @cagnusmarlsen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms high High priority issues
Projects
None yet
6 participants