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

switch language #82

Open
conky77 opened this issue Oct 26, 2024 · 9 comments
Open

switch language #82

conky77 opened this issue Oct 26, 2024 · 9 comments
Labels
probably fixed? the issue/feature appears to be fixed/implemented, but there still may be issues

Comments

@conky77
Copy link
Contributor

conky77 commented Oct 26, 2024

I tried N++ 8.7.1 and 8.1 Json Tool.
I tried to switch to English from n++ setting, but the menu is still in Italian.
Nothing changes closing N++
Another plugin HTML tag should change the language, but it doesn't

Notepad++ v8.7.1 (64-bit)
Build time : Oct 25 2024 - 04:07:21
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Home (64-bit)
OS Version : 23H2
OS Build : 22631.4317
Current ANSI codepage : 1252
Plugins :
ComparePlus (1.2)
DSpellCheck (1.5)
ERPHelper (1.1.2)
HexEditor (0.9.12)
HTMLTag (1.5)
JsonTools (8.1)
mimeTools (3.1)
MultiReplace (4.0.0.19)
NppConverter (4.6)
NppExport (0.4)
NPPJSONViewer (2.0.8)
NppMenuSearch (0.9.6)
NppPluginOpenHost (1.1)
PoorMansTSqlFormatterNppPlugin (1.6.13.31508)
SQLinFormNpp64 (6.24.7.15)
XMLTools (3.1.1.13)

@molsonkiko
Copy link
Owner

@conky77

Do you mean that JsonTools doesn't immediately change language to match Notepad++ when the user changes the Notepad++ language to Italian (or to English from Italian). If so, that is expected behavior, as described in the README. JsonTools only translates itself once at startup; it doesn't currently listen to the notification from Notepad++ when it changes language. I didn't add that capability because I felt it was too much of - an increase to the codebase for a change that would not matter most of the time.

If what you mean is that JsonTools doesn't translate itself at all, even at startup, that is a serious bug and I will address it ASAP.

@conky77
Copy link
Contributor Author

conky77 commented Oct 28, 2024

@molsonkiko
I confirm that JsonTools doesn't change the menu language at all.
I also tried to execute N++ in administrative mode, but the menu doesn't load the new language at startup. I also tried (with n++ in Italian) to uninstall, clean any files, and reinstall the plugin, but I always got the same result: at startup, the language is always in Italian

Notepad++ v8.7 (64-bit)
Build time : Sep 17 2024 - 17:06:31
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Home (64-bit)
OS Version : 23H2
OS Build : 22631.4317
Current ANSI codepage : 1252
Plugins :
ComparePlus (1.2)
DSpellCheck (1.5)
ERPHelper (1.1.2)
HexEditor (0.9.12)
HTMLTag (1.5)
JsonTools (8.1)
mimeTools (3.1)
MultiReplace (4.0.0.19)
NppConverter (4.6)
NppExport (0.4)
NPPJSONViewer (2.0.8)
NppMenuSearch (0.9.6)
NppPluginOpenHost (1.1)
PoorMansTSqlFormatterNppPlugin (1.6.13.31508)
SQLinFormNpp64 (6.24.7.15)
XMLTools (3.1.1.13)

@molsonkiko
Copy link
Owner

@conky77
I'm guessing that your Windows culture is Italian. If the Notepad++ language is unknown, English, or not supported, JsonTools checks the user's culture and uses that to set its language if the culture has a supported language.

To check your culture, open PowerShell and enter "get-culture". JsonTools uses italian.json5 if the first word of the culture name is Italian.

I designed JsonTools this way because I thought that some users might not have NPP translated to their native language, and this was the best way I could think of to infer the user's native language independently of NPP. If you think this is a bad idea, I can remove that code. I could also come up with an alternative way for the user to choose their language, but that would almost certainly be more complicated than the current system.

@conky77
Copy link
Contributor Author

conky77 commented Oct 28, 2024

@molsonkiko
yes, the get-culture returns it-IT
In my opinion, it should always be possible to use the English version (for example because someone doesn't like the translation, or because I'm using another computer/remote desktop ). Json tools should only check the n++ language. If json tool doesn't have the translation, the English should be shown

molsonkiko added a commit that referenced this issue Nov 5, 2024
Ignore the Windows culture of the user to address #82.
@molsonkiko
Copy link
Owner

@conky77

My latest commit should fix this issue. Follow these instructions to download the binary from that commit and see if you're satisfied.

If you don't say you're unsatisfied, I will assume that the issue is fixed by that commit, and I will close this issue about a week after the next release of JsonTools becomes available on the plugin manager.

@molsonkiko molsonkiko added the probably fixed? the issue/feature appears to be fixed/implemented, but there still may be issues label Nov 5, 2024
@conky77
Copy link
Contributor Author

conky77 commented Nov 8, 2024

@conky77

My latest commit should fix this issue. Follow these instructions to download the binary from that commit and see if you're satisfied.

If you don't say you're unsatisfied, I will assume that the issue is fixed by that commit, and I will close this issue about a week after the next release of JsonTools becomes available on the plugin manager.

I tried it and the language of the menu is ok, but the language of message box seems to follow the language of culture.

the language of menù follows the language of N++

  • culture: Italian, N++: Italian, Jsontools:Italian
  • culture: Italian, N++: English, Jsontools:English
  • culture: Italian, N++: Spanish, Jsontools:English
  • culture: Italian, N++: Spanish Argentina, Jsontools:English
  • culture: Italian, N++: Venetian, Jsontools:English

With n++ in English, culture Italian, the language of buttons is in Italian
immagine

Notepad++ v8.7 (64-bit)
Build time : Sep 17 2024 - 17:06:31
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Home (64-bit)
OS Version : 23H2
OS Build : 22631.4391
Current ANSI codepage : 1252
Plugins :
ComparePlus (1.2)
DSpellCheck (1.5)
ERPHelper (1.1.2)
HexEditor (0.9.12)
HTMLTag (1.5)
JsonTools (8.1.0.15)
mimeTools (3.1)
MultiReplace (4.0.0.19)
NppConverter (4.6)
NppExport (0.4)
NPPJSONViewer (2.0.8)
NppMenuSearch (0.9.6)
NppPluginOpenHost (1.1)
PoorMansTSqlFormatterNppPlugin (1.6.13.31508)
SQLinFormNpp64 (6.24.7.15)
XMLTools (3.1.1.13)

@molsonkiko
Copy link
Owner

With n++ in English, culture Italian, message box buttons are in Italian

C# doesn't offer a reasonably easy way to customize the language of message box buttons, so they just follow the user's culture. I don't think this is a serious enough issue to justify writing hacky low-level code instead of the more compact System.Windows.Forms.MessageBox.Show API that I've been using.

@conky77
Copy link
Contributor Author

conky77 commented Nov 9, 2024

Ok, since it is hard to change the language of the message box, for me this issue is fixed.

@molsonkiko
Copy link
Owner

JsonTools version 8.2, incorporating a fix for this issue, is now live. I will soon submit a PR to include v8.2 in the plugins manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
probably fixed? the issue/feature appears to be fixed/implemented, but there still may be issues
Projects
None yet
Development

No branches or pull requests

2 participants