jdmonin / JSettlers2

Java Settlers project home, downloads, and GPLv3 source code. To download the latest version as a JAR, see https://github.com/jdmonin/JSettlers2/releases/latest .
http://nand.net/jsettlers/
GNU General Public License v3.0
160 stars 63 forks source link

PL language translation; question on utf-8 support for resource files #99

Closed kotc closed 2 years ago

kotc commented 2 years ago

since i've started translating resources to PL language, i've noticed that only iso-8859-1 is supported. since support for java 1.5 is dropped, maybe it's a good time to support utf-8 encoded ones? for 1.6-1.8 there will need to be few workarounds applied to resource reader, but should be doable according to: https://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle

jdmonin commented 2 years ago

That's great news about the translation, thanks for looking into that!

Java's properties file encoding is a weird historical leftover, for sure.

Most java-aware IDEs will let you edit in whatever encoding you want, and escape the characters to iso-8859-1 when you save; Eclipse is fine, for example.

I read a bunch about it when I was starting jsettlers internationalization, and even made a quirky editor (in the jsettlers source tree) that shows original and target languages side-by-side and takes care of encoding when you save.

There's more discussion at https://github.com/jdmonin/JSettlers2/blob/main/doc/Readme.developer.md#internationalization-i18n

Because most java IDEs expect iso-8859-1 by default, this is more of an annoyance than a blocker; so I'm hesitant to change the encoding until our minimum version is higher down the line.

kotc commented 2 years ago

for now i've made the translation without language specific characters, it's usable as it is. will post the files once i've tested it enough

jdmonin commented 2 years ago

Great, thank you!

If you want to add language-specific characters later, I think there's nothing in the current setup that blocks it. If you're curious about my side-by-side translation editor, I have screenshots at https://nand.net/jsettlers/devel/i18n/ .

kotc commented 2 years ago

thanks, i'm checking it. first things that jump at me: 1/ no antialias (fixable with cmdline params) 2/ unintuitive, while source and dest are obvious, choosing the right load button isnt. but at least there aren't many of them to figure it out. eventually i chose open src+dst one 3/ editing long descriptions (for example scenarios) is hard due to long lines and no ability to quickly scroll 4/ characters seem to be applied correctly, which is good

kotc commented 2 years ago

ok, scratch 3. double clicking opens a nice editor

kotc commented 2 years ago

as promised, Polish translation, has few rough edges due to grammar, but should work pretty well. i didnt want to create new ticket so just pasting here: jsettlers2-pl-translation.zip

jdmonin commented 2 years ago

This is a really thorough translation. I'm sure it took a bunch of your time, and I'm very grateful. It's merged; thank you so much!

For the game option dialogs and scenarios, are the leading numbers to arrange the sort order correctly for the language? If so, I wonder if it would make sense for the code to look for and hide the [00] prefix parts (but still use them to sort).

jdmonin commented 2 years ago

Thanks too for the feedback on the language editor.

kotc commented 2 years ago

yeah, i had to add numbers, otherwise they would be out of my muscle-memory order. also, not every character was accepted in scenario names (thats why 00 instead of [00])

kotc commented 2 years ago

since there are few translations already, it might be a good idea to add language selector on main menu

jdmonin commented 2 years ago

Sounds good, thanks! I'll try to take a look at hiding the sorting prefix soon

jdmonin commented 2 years ago

This was released as part of v2.6.00. Thanks again!