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

Add a translation file of Mandarin Chinese #136

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

Tigerfyj
Copy link

No description provided.

@xxxserxxx xxxserxxx merged commit e59e918 into xxxserxxx:master Jun 16, 2020
@xxxserxxx
Copy link
Owner

@Tigerfyj It may take a bit for this to show up as I haven't yet finished or merged the translation code. Thank you for the contribution, though! There's no top-to-bottom nor right-to-left support in termui -- will these translations make any sense for end users if they're horizontal left-to-right?

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 16, 2020 via email

@xxxserxxx
Copy link
Owner

@Tigerfyj , there's a branch called i18n, which contains the code for the translations. It is fairly complete in terms of the list of translation strings. If you're able to, would you pull and build that branch and test the translations in the UI? And if you are able to fill in the other translations, that'd be a huge help!

LANG=zh_CN go run ./cmd/gotop

works for me, and I can see the Chinese, but I'm not able to verify that it's correct.

I am considering removing the errors from translation, as it will make debugging more difficult for me when users report errors; therefore, you can leave the errors untranslated.

Thanks for your help with the Mandarin!

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 19, 2020 via email

@xxxserxxx
Copy link
Owner

Hm. I don't know about the suffix; I'll have to check that. I wouldn't be surprised if that's an issue. However, the translation that you did didn't have the widget labels in it yet, so if you check the zh_CN file, you'll see a lot of English. However, if you run LANG=zh_CN go run ./cmd/gotop -h you should see Mandarin, since what was in the toml and what you did translate was the help text. Let me know if you still see only English, and in the meantime I'll check on the suffix question. Thanks!

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 20, 2020 via email

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 20, 2020 via email

@xxxserxxx
Copy link
Owner

I saw that issue with the help text; it was caused by the refactoring for the translation, and I'll track it down before I release -- I think it affects English as well.

Can you point to the line that contains the misspelling? Thanks.

@xxxserxxx
Copy link
Owner

@Tigerfyj Help text issue is resolved in branch i18n. I also moved some more hard-coded strings from code to the translation file. Sorry about the constantly changing contents. I'm adding more of the hard-coded strings as translations as we speak -- most are error messages.

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 21, 2020 via email

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 21, 2020 via email

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 21, 2020 via email

@xxxserxxx
Copy link
Owner

The typo is at line 88 in 'en_US.toml' file.

That's correct. conffile = conf file

I just saw the 'list' & 'write' of [args] were changed back to English

That was a merge error when I was copying new tags around. Thanks for catching that!

Some error messages are for users, as they may reflect user errors, such as bad command line arguments, or syntax errors in the config file or in a layout. I'm now leaning toward translating the error messages and including an error number on each so that if someone gives me an error.log I can easily find out which error it is.

  1. If the "LANG" is empty, the program exists with the following message:

Hm. That's an issue with the underlying localization library, cloudfoundry-attic/jibber_jabber. I'll see what I can do about that.

@xxxserxxx
Copy link
Owner

xxxserxxx commented Jun 21, 2020

@Tigerfyj , list and write were accidentally reverted; I've corrected this. Thanks for noticing the issue when the locale is missing; it's been addressed and pushed.

The hyphen (-) is not a literal hyphen; it's a result of how gizak/termui is drawing non-ASCII glyphs -- the dash is actually the box border showing through. I notice that on my laptop, all of the Chinese character glyphs are spaced out a bit. Is this usual, or are they usually more tightly drawn together? For example, when I dump out the rendered screen, I get a space between each glyph -- literally:

切 换 进 程 组 

However, no spaces exist in the translation file. This will require a bit more digging.

Edit 1

Note to self: it's not the lingo library; it's termui. C.f. gizak/termui#10

@Tigerfyj
Copy link
Author

Tigerfyj commented Jun 22, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants