Thanks to visit codestin.com
Credit goes to github.com

Skip to content

zh_Hans translation won't load #429

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

Closed
hosiet opened this issue Oct 1, 2020 · 10 comments
Closed

zh_Hans translation won't load #429

hosiet opened this issue Oct 1, 2020 · 10 comments
Assignees
Labels

Comments

@hosiet
Copy link
Contributor

hosiet commented Oct 1, 2020

I see that ksnip v1.7.3 and git HEAD versions are all providing ksnip_zh_Hans.qm. However on a Linux system with zh_CN.UTF-8 locale (aka Chinese (China) locale), ksnip interface are all showing in English. The terminal output is like:

Unable to find any translation files for ksnip.
Unable to find any translation files for kImageAnnotator.

After making a symlink from ksnip_zh_Hans.qm to ksnip_zh_CN.qm, this problem disappears and ksnip is showing in translated strings.

The full locale output on my system is:

% locale
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
@hosiet
Copy link
Contributor Author

hosiet commented Oct 1, 2020

The same bug happens when I am running ksnip.exe on Windows platform.

After renaming ksnip_zh_Hans.qm to ksnip_zh_CN.qm, the Windows build is properly showing the translated strings.

System information: Windows 10 x64 v19041 with Simplified Chinese environment

@DamirPorobic
Copy link
Member

This was added by a user, not sure why it's Hans and not CN. Is there a specific dialect called Hans or is it basically the same? I'm asking because we could do two things, either rename or copy it from ksnip_zh_Hans.qm to ksnip_zh_CN.qm. If there is no difference in the language then probably renaming is the way to go.

@hosiet
Copy link
Contributor Author

hosiet commented Oct 1, 2020

Ideally Qt should recognize zh_Hans on systems that use Simplified Chinese (no matter zh_CN or zh_SG). Maybe we need to review the translation loader code of ksnip (or look into how Qt handles it in reality).

@hosiet
Copy link
Contributor Author

hosiet commented Oct 1, 2020

If we want a very quick fix, simply rename all zh_Hans to zh_CN. The only downside is that this will only mean to support Simplified Chinese users from China mainland but not of other countries/regions (for example, Simplified Chinese users from Singapore).

@DamirPorobic
Copy link
Member

There is nothing special with loading the translations, it's basically done by Qt, the only thing that we do is tell Qt in what directory to look for the translations.

Isn't it better in this case to create a copy of zh_Hans and rename it to zh_CN? Would that work for China mainland and other countries/regions?

@hosiet
Copy link
Contributor Author

hosiet commented Oct 1, 2020

As long as a zh_CN file exist, it should work for Chinese (China) users. Whether there is an extra copy of zh_Hans file does not matter. I am not sure for other countries/regions.

@DamirPorobic
Copy link
Member

Ok, just copying the translation files doesn't work, weblate complains about duplicate translations files pointing to same language

image

Now I have renamed it from zh_Hans to zh_CN, can youtest again with continuous build?

@hosiet
Copy link
Contributor Author

hosiet commented Oct 2, 2020

Hi,

After renaming the ksnip part is working. However we still have kImageAnnotator_zh_Hans.qm and this part should be fixed as well.

@DamirPorobic
Copy link
Member

I have renamed it there too. On the next push on the ksnip repo we should see the change.

@DamirPorobic
Copy link
Member

I assume this is working now. Let me now if you have still issues and we will reopen it.

@DamirPorobic DamirPorobic self-assigned this Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants