Ticket #44047

S3_1 msys2: Client localization not working

Open Date: 2022-03-07 22:07 Last Update: 2022-03-14 15:19

5 - Medium
5 - Medium


S3_1 on a msys2 environment I'm testing (i.e. not current official environment 211115, but unreleased 220220), with minimal freeciv patch to take that environment to use: gtk3.22- and qt-clients show English text even when Finnish should be used. However, most(?) strings coming from the server that the very client has forked, are in Finnish. sdl2-client correctly shows translations.

I'll try to make a build with the 211115 msys2 environment soon (tomorrow?) to make sure that this is not a regression in the environment. That's important to know so we can either go forward with the environment update or not.

Ticket History (3/16 Histories)

2022-03-07 22:07 Updated by: cazfi
  • New Ticket "S3_1 msys2: Client localization not working" created
2022-03-07 22:47 Updated by: cazfi

Experimenting in the directory where 'make install' installed freeciv, before it was packaged to the installer; localization works for freeciv-server, freeciv-manual, and freeciv-ruleup, i.e., in programs that don't have gui at all. It does not work for the client or modpack installer, not even when run with '--help' -parameter that prints to terminal (and does not launch gui at all)

2022-03-08 06:54 Updated by: cazfi

On a build with --enable-fcmp=gtk3,cli , localization works for cli modpack installer, does not work for gtk3 one. I then experimented by copying mpcli.c over mpgui_gtk3.c. From that build also "gtk3" modpack installer worked -> the problem is not in the different compiler commandline parameters (including list of libraries to link against).

2022-03-08 21:13 Updated by: cazfi

Futher experimenting by adding original mpgui_gtk3.c code back to see when it breaks, it seems to be that adding any gtk function call anywhere (i.e. there's no need for the function to get called before there should be translated text coming out) breaks it. I think the only explanation for that is that code being dependant on gtk causes linking stage to actually link gtk3 (and its dependencies!) in, and then the problem is caused by some global initialization in those libraries.

Qt-client and ruledit are an interesting pair. Qt-client suffers from the problem, but ruledit does not.

2022-03-08 22:38 Updated by: cazfi

We've always known that using relative path for the locale path is a bad thing, but that has been something that we've had to do in Windows as it's not know at the build time where the user will install freeciv. (from autools pov we do sane 'make install', but then files are copied from that installation location to somewhere else and expected to work there)

To see if that was now causing the trouble, I did a simple test of hardcoding get_locale_dir() to return the absolute path to the location where I have the translations - and they started to work.

Still don't know what exactly why linking against gtk causes such a change in behavior - I had already confirmed that getcwd() gave expected directory in every phase of the translation setup and test.

2022-03-08 23:21 Updated by: cazfi
  • Milestone Update from (None) to 3.1.0
  • Component Update from (None) to General

I'm targeting this fix to S3_1 at this time. It's not needed in S3_0 yet, and it's going to be somewhat risky change. It's likely that we have to backport this to S3_0 during its lifetime, though.

2022-03-09 02:04 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
2022-03-11 03:06 Updated by: cazfi

- S3_0 version attached. It's dependency also to #43921, so need to go in soon.

This does not affect the fact that review period for S3_1 & master patch has already passed.

2022-03-11 07:08 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed
2022-03-11 07:08 Updated by: cazfi
  • Status Update from Closed to Open
  • Resolution Update from Fixed to Accepted

master & S3_1 pushed, S3_0 still in review.

2022-03-11 09:01 Updated by: cazfi
  • Resolution Update from Accepted to None

Fix for #44070 need to be rolled in to the S3_0 patch.

2022-03-12 18:43 Updated by: cazfi
  • Resolution Update from None to Accepted

- New S3_0 version with unistd.h include fix included

2022-03-14 15:19 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed


You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login