Tíquete #44047

S3_1 msys2: Client localization not working

: 2022-03-07 22:07 Última Atualização: 2022-03-14 15:19

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
3

Details

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
Comentário

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
Comentário

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
Comentário

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
Comentário

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
  • Marco Update from (Nenhum) to 3.1.0 (fechado)
  • Componente Update from (Nenhum) to General
Comentário

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
  • Dono Update from (Nenhum) to cazfi
  • Resolução Update from Nenhum to Accepted
2022-03-11 03:06 Updated by: cazfi
Comentário

- 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
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed
2022-03-11 07:08 Updated by: cazfi
  • Estado Update from Fechado to Aberto
  • Resolução Update from Fixed to Accepted
Comentário

master & S3_1 pushed, S3_0 still in review.

2022-03-11 09:01 Updated by: cazfi
  • Resolução Update from Accepted to Nenhum
Comentário

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

2022-03-12 18:43 Updated by: cazfi
  • Resolução Update from Nenhum to Accepted
Comentário

- New S3_0 version with unistd.h include fix included

2022-03-14 15:19 Updated by: cazfi
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Login