任务单 #44047

S3_1 msys2: Client localization not working

开放日期: 2022-03-07 22:07 最后更新: 2022-03-14 15:19

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
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.

任务单历史 (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
  • 里程碑 Update from (无) to 3.1.0 (关闭)
  • 组件 Update from (无) 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
  • 属主 Update from (无) to cazfi
  • 处理结果 Update from 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
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed
2022-03-11 07:08 Updated by: cazfi
  • 状态 Update from 关闭 to 开启
  • 处理结果 Update from Fixed to Accepted
评论

master & S3_1 pushed, S3_0 still in review.

2022-03-11 09:01 Updated by: cazfi
  • 处理结果 Update from Accepted to
评论

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

2022-03-12 18:43 Updated by: cazfi
  • 处理结果 Update from to Accepted
评论

- New S3_0 version with unistd.h include fix included

2022-03-14 15:19 Updated by: cazfi
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed

编辑

Please login to add comment to this ticket » 登录名