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

Addons: Date shows sign for german umlauts #6450

Closed
bunnybot opened this issue May 9, 2024 · 4 comments
Closed

Addons: Date shows sign for german umlauts #6450

bunnybot opened this issue May 9, 2024 · 4 comments
Labels
bug Something isn't working internationalization Translation system, string fixes, RTL support ui User interface
Milestone

Comments

@bunnybot
Copy link

bunnybot commented May 9, 2024

frankystoneMirrored from Codeberg
Created on Thu May 09 10:49:54 CEST 2024 by frankystone


The month name of the date shows a sign for german umlauts:

wrong_encoding.png

The description shows the umlauts correct, e.g. in "Lagerhäusern" or "unterstützt".

To reproduce

  1. Scroll the list of addons
  2. The Months of the date line with an Umlaut shows unexpected sign

Expected behavior
Show the umlaut. I guess it should show "März" instead of "M?r".

Version:

  • OS: archlinux
  • Widelands Version: 1.2 Release
  • Enabled Add-Ons:

For reference:

$:> locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE=C
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
@bunnybot bunnybot added bug Something isn't working addon Problems and requests related to add-ons internationalization Translation system, string fixes, RTL support ui User interface and removed addon Problems and requests related to add-ons labels May 9, 2024
@bunnybot
Copy link
Author

bunnybot commented May 9, 2024

NordfrieseMirrored from Codeberg
On Thu May 09 11:13:31 CEST 2024, Benedikt Straub (Nordfriese) wrote:


Interesting, it works for me in Low German:

grafik

$ locale
LANG=nds_DE
LANGUAGE=
LC_CTYPE="nds_DE"
LC_NUMERIC="nds_DE"
LC_TIME="nds_DE"
LC_COLLATE="nds_DE"
LC_MONETARY="nds_DE"
LC_MESSAGES="nds_DE"
LC_PAPER="nds_DE"
LC_NAME="nds_DE"
LC_ADDRESS="nds_DE"
LC_TELEPHONE="nds_DE"
LC_MEASUREMENT="nds_DE"
LC_IDENTIFICATION="nds_DE"
LC_ALL=

On my previous system, where I had Low German as primary and German as secondary language, it didn't work at all and showed up in English. std::locale is weird…

std::string time_string(const std::time_t& time) {
	std::ostringstream oss("");
	try {
		oss.imbue(std::locale(i18n::get_locale()));
	} catch (...) {
		// silently ignore
	}
	oss << std::put_time(std::localtime(&time), "%c");
	return oss.str();
}

@bunnybot
Copy link
Author

bunnybot commented May 9, 2024

frankystoneMirrored from Codeberg
On Thu May 09 14:23:58 CEST 2024, frankystone wrote:


Don't know why but i had set the language to "Deutsch" in the widelands options. If i set it to "Try System language" all is fine.

The difference is probably the UTF-8 encoding:

With language set to "Deutsch" and restart widelands:

[00:00:00.000 real] WARNING: No locale translations found in /home/kaputtnik/Quellcode/widelands-repo/widelands/data/locale
[00:00:00.000 real] INFO: selected language: de
[00:00:00.001 real] INFO: using locale de_DE
[00:00:00.058 real] INFO: Adding directory: /home/kaputtnik/Quellcode/widelands-repo/widelands/data
[00:00:00.059 real] INFO: selected language: de
[00:00:00.059 real] INFO: using locale de_DE
[00:00:00.062 real] INFO: Byte order: little-endian

With setting language to System language and restarting widelands:

[00:00:00.000 real] WARNING: No locale translations found in /home/kaputtnik/Quellcode/widelands-repo/widelands/data/locale
[00:00:00.000 real] INFO: selected language: (system language)
[00:00:00.000 real] INFO: using locale de_DE.UTF-8
[00:00:00.058 real] INFO: Adding directory: /home/kaputtnik/Quellcode/widelands-repo/widelands/data
[00:00:00.058 real] INFO: selected language: (system language)
[00:00:00.058 real] INFO: using locale de_DE.UTF-8
[00:00:00.061 real] INFO: Byte order: little-endian

According to the output the encoding with UTF-8 is missing when using "Language=Deutsch"

@bunnybot
Copy link
Author

bunnybot commented May 9, 2024

NordfrieseMirrored from Codeberg
On Thu May 09 15:13:28 CEST 2024, Benedikt Straub (Nordfriese) wrote:


What is the behaviour with #6411?

In master I get the date in correct Low German with locale Try System Language, in English with locale Low German, and in correct German with locale German.

In #6411 I get the date in correct Low German with locale Try System Language, and in English with both locale Low German and locale German.

None of these cases show the bug.

@bunnybot
Copy link
Author

bunnybot commented May 9, 2024

frankystoneMirrored from Codeberg
On Thu May 09 15:47:03 CEST 2024, frankystone wrote:


What is the behaviour with #6411?

With this all is shown correct, regardless if i use "Deutsch" or "Try System language" :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internationalization Translation system, string fixes, RTL support ui User interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants