maptool icon indicating copy to clipboard operation
maptool copied to clipboard

Localization setting does not work in 1.8

Open Tdue21 opened this issue 3 years ago • 13 comments

Describe the bug I set the application to English in the Preferences and restart, but much of the UI is still in Danish (my Windows locale). The Danish translation is not complete, hence "much of the UI ... "

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Preferences'
  2. Click on 'Startup'
  3. Set language to something other than default locale and restart application.
  4. Start application and observe that default locale is still in effect.

Expected behavior The configured locale should be observed.

Screenshots If applicable, add screenshots to help explain your problem.

MapTool Info

  • Version: 1.8
  • Install: New/Upgrade (Side-by-side install with 1.7).

Desktop (please complete the following information):

  • OS: Windows 10 Home
  • Version 2004 (Build 19041.450)

Additional context

==== MapTool Information ====
MapTool Version: 1.8.0-beta.2
MapTool Home...: C:\Users\thoma\.maptool-rptools
MapTool Install: C:\Users\thoma\AppData\Local\MapTool 1.8\app
Max mem avail..: 3 GB
Max mem used...: 503 MB
Custom Property: -DMAPTOOL_DATADIR=.maptool-rptools

==== Java Information ====
Java Home......: C:\Users\thoma\AppData\Local\MapTool 1.8\runtime
Java Vendor....: Azul Systems, Inc.
Java Version...: 14.0.2
Java Parameters: 
  -Djava.library.path=C:\Users\thoma\AppData\Local\MapTool 1.8\app;C:\Users\thoma\AppData\Local\MapTool 1.8
  -Djava.launcher.path=C:\Users\thoma\AppData\Local\MapTool 1.8
  -Dsentry.environment=Production
  -Dfile.encoding=UTF-8
  --add-opens=javafx.web/javafx.scene.web=ALL-UNNAMED
  --add-opens=javafx.web/com.sun.webkit=ALL-UNNAMED
  -XX:+ShowCodeDetailsInExceptionMessages
  -Xss8M


==== OS Information ====
OS Name........: Windows 10
OS Version.....: 10.0
OS Architecture: amd64
Processor......: AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD
PATH...........: C:\Users\thoma\AppData\Local\MapTool 1.8\app;C:\Users\thoma\AppData\Local\MapTool 1.8
Number of Procs: 4

==== User Information ====
User Name: thoma
User Home: C:\Users\thoma
User Dir.: C:\Users\thoma\AppData\Local\MapTool 1.8

==== Network Interfaces ====
Display Name..: Software Loopback Interface 1
Interface Name: lo
Address...: 127.0.0.1
Address...: 0:0:0:0:0:0:0:1

Display Name..: Realtek PCIe GbE Family Controller
Interface Name: eth4
Address...: 192.168.0.150

Host Address...: 192.168.0.150
Default Gateway: 192.168.0.1

==== Locale Information ====
Country.: Denmark
Language: Danish
Locale..: Danish (Denmark)
Variant.: 

==== Encoding Information ====
Default Locale:   da_DK
Default Charset:  UTF-8
file.encoding:    UTF-8
sun.jnu.encoding: Cp1252
Default Encoding: UTF8

==== Display Information ====
Number of Displays: 1
Display 1: 1920x1080(32)

==== Internet Gateway Devices ====
	No IGDs Found!

Tdue21 avatar Sep 09 '20 06:09 Tdue21

Did you get any other prompts after changing the language and restarting MT?

You should be able to force English short term by editing the config file (MapTool.cfg) in the install directory under app. Change the language line to: -Duser.language=en

Make sure the maptool.cfg file in your home dir under .maptool-rptools\config\ has the same setting.

Phergus avatar Sep 09 '20 13:09 Phergus

For the record, I was able to change it to Spanish and then French via preferences but when I tried to change it back to English I got a warning that the config file under app was in use by another process on startup.

Phergus avatar Sep 09 '20 13:09 Phergus

Ok, this is a bit strange, although I am pretty sure those nice big brains that maintain the code can figure it out 😀 If I change the language to French, everything seems to translate nicely. If I change it to English, some stuff, like the main menu are in Danish. The problem is, of course, that the Danish translation is nowhere finished, so I have no idea what is English because the localization works, and what is English because it has not been translated yet.

So, I am pretty sure that there is an issue when translating between default language (English) and current culture (Danish in my case). Languages that are neither works fine. I think I have seen this before somewhere else, but I cannot remember for the life of me ;)

Tdue21 avatar Sep 12 '20 15:09 Tdue21

If it is any help at all, there is no language line in neither MapTool.cfg file btw. I am assuming the -Duser.language goes into JavaOptions?

Tdue21 avatar Sep 12 '20 15:09 Tdue21

That worked btw ;)

Tdue21 avatar Sep 12 '20 15:09 Tdue21

Yes, it goes under [JavaOptions]. Without the entry the defaults to your locale. You can put the line in specify the locale you want.

Phergus avatar Sep 13 '20 01:09 Phergus

@Phergus IIRC the original code for this "removed" the language code if it was set to the "default" of english. But of course, removing the line then makes it default to your default language of course.

I thought i removed that behavior but there could still be some logic that "no choice" == english == no jvm parameter?

If we don't we probably need a "OS setting" in there as well as english and the "OS Setting" (or some better name) would remove the JVM option all together?

JamzTheMan avatar Sep 13 '20 02:09 JamzTheMan

Hm. Looks like the same issue as #2179

Tdue21 avatar Sep 15 '20 13:09 Tdue21

Changes from the switch to the new packager has resulted in changes to how the startup config for the 1.8 release is handled. Changes to locale will need to be made manually initially. Moving to 1.9 release.

Phergus avatar Feb 07 '21 16:02 Phergus

Note that with 1.8.3+ that you can't set the language via preferences but must modify the config file directly. If the move to Java 16 for MT 1.9 allows us to once again modify the config file this can be revisited.

Phergus avatar Apr 16 '21 20:04 Phergus

Just for reference:

Startup Config for MT 1.8.* and 1.9.0

Locate the MapTool.cfg file under the app directory in your MapTool install directory. The following are examples. You shouldn't need to change any of them excepting language for those in different locales.

Under [JavaOptions] you can add/set the following: -Xmx4G - set max heap to 4G -Xms1G - set min heap to 1G -Xss10M - set stack size to 10M -Dsun.java2d.d3d=false - disable Direct3D. Set to true to disable. -Dsun.java2d.opengl=true - enable OpenGL. Default is false. -Djavafx.macosx.embedded=false - initialize AWT before JFX (MacOS only). Default is false. -Duser.language=en - set MT local to English. Without this line MT will default to the users locale as set in the operating system.

Phergus avatar Apr 23 '21 22:04 Phergus

As the change to Java 16 packager didn't improve things deferring this till after MT 1.9.0.

Phergus avatar May 22 '21 15:05 Phergus

This is still an issue as of 1.11.4. Thought I'd let you know :) If it is not solvable, then I would suggest that the section explaining on the Startup tab, should be expanded with maybe a couple of examples.

Tdue21 avatar Dec 26 '21 08:12 Tdue21