google / comprehensive-rust

This is the Rust course used by the Android team at Google. It provides you the material to quickly teach Rust.
https://google.github.io/comprehensive-rust/
Apache License 2.0
27.6k stars 1.64k forks source link

Chinese (Simplified) translation #324

Closed hilbert-yaa closed 5 months ago

hilbert-yaa commented 1 year ago

Hi Martin @mgeisler ! I've had a conversation with you via email about this translation a week ago. I'm working on this issue rn.

Edit by @mgeisler: See https://github.com/google/comprehensive-rust/issues/324#issuecomment-1562626220 below for instructions.

mgeisler commented 1 year ago

For reference: https://github.com/KaiserY/trpl-zh-cn.

hilbert-yaa commented 1 year ago

Sounds great. I'm currently taking this project as a reference.

kiwiwarmnfuzzy commented 1 year ago

Hey @mgeisler: I saw that there's a machine-translated version by running the i18n script, could you run the script for the zh_CN locale for us?

(I think Hilbert had a similar script but we noticed some off-by-one errors..., so just wanted to see if these errors are specific to zh_CN locale.)

Thanks!

mgeisler commented 1 year ago

Hi @kiwiwarmnfuzzy, the script it here: https://github.com/google/comprehensive-rust/pull/291. I asked the other translators, and they tell me that they haven't seen the same off-by-one errors.

Here is the output from a fresh run of that script: zh_CN.zip.

hilbert-yaa commented 1 year ago

Hi @kiwiwarmnfuzzy, the script it here: #291. I asked the other translators, and they tell me that they haven't seen the same off-by-one errors.

Here is the output from a fresh run of that script: zh_CN.zip.

Oh no worries I wasn't using your script. And thanks this output looks good - we can start from here.

mgeisler commented 1 year ago

Oh no worries I wasn't using your script.

Great to hear that!

mgeisler commented 1 year ago

Hi there, just a small note: please rename the file to zh-CN.po so that the translation will eventually appear under .../zh-CN/. The _ to - change should give us the right kind of language tag and this is the style we used for the Brazilian Portuguese translation in #381.

mgeisler commented 1 year ago

From reading https://developers.google.com/search/docs/specialty/international/localized-versions, I'm thinking we should name the Simplified Chinese translation zh-Hans like @taotieren does in #436.

hilbert-yaa commented 1 year ago

From reading https://developers.google.com/search/docs/specialty/international/localized-versions, I'm thinking we should name the Simplified Chinese translation zh-Hans like @taotieren does in #436.

Got it. I've been occupied by my COVID and ISCA rebuttal lately. Will work on this from the coming week.

mgeisler commented 1 year ago

Got it. I've been occupied by my COVID and ISCA rebuttal lately.

Ugh, sorry to hear that! I had COVID myself last year and it was not fun at all... Good luck with the conference! :slightly_smiling_face:

hilbert-yaa commented 1 year ago

Got it. I've been occupied by my COVID and ISCA rebuttal lately.

Ugh, sorry to hear that! I had COVID myself last year and it was not fun at all... Good luck with the conference! slightly_smiling_face

Thanks for the kind words :)

est7 commented 1 year ago

@Hilbert-Yaa any update? can't wait to see it

xusiwei commented 1 year ago

I think called Chinese Simplified is better. Can you post the WIP repo URL in this issuse?

kiwiwarmnfuzzy commented 1 year ago

@xusiwei Thanks for reaching out!

I think called Chinese Simplified is better.

Could you explain a little why 'Chinese Simplified' is better? Is the difference between Mandarin v.s. Simplified about speaking v.s. writing? (I'm not very experienced in internationalization and various terminologies, so I'm mildly curious.)

Can you post the WIP repo URL in this issuse?

325 is the latest PR that I'm aware of. This Google Doc has all the pointers.

mgeisler commented 1 year ago

I think called Chinese Simplified is better.

Hi @xusiwei, I tried looking this up and from what I can understand, you're right: we should call the translation "Chinese (Simplified)" since we're referring to the script. Google Translate uses "Chinese (Simplified)" so that's why I'm suggesting this variation.

mgeisler commented 1 year ago

To everybody here (@est7, @xusiwei, @kiwiwarmnfuzzy, ...): could someone generate a nearly-empty po/zh-Hans.po file to get the translation kicked off? We've done that recently for #653 and #652 :smile:

It would be awesome to get this started so that people can have an easier time contributing follow-up translations.

markx commented 1 year ago

Hi @mgeisler, just saw your email and I think this is very exciting! I was going to go through the course anyway so I'd love to help with at least some parts of this translation.

mgeisler commented 1 year ago

Hi @mgeisler, just saw your email and I think this is very exciting! I was going to go through the course anyway so I'd love to help with at least some parts of this translation.

Hey @markx, that's excellent! Please start by putting up a PR to create the PO file, see our translation instructions for how to do this.

HangDu1995 commented 1 year ago

Hi @mgeisler, I saw your email too. I can also help with the translation!

jzpin commented 1 year ago

Hi @mgeisler I would like to help. How many people are needed for the Chinese translation? I was wondering how to avoid duplicate work?

jzpin commented 1 year ago

To create the po file for Chinese, should we use zh-HANS or zh-CN for simplified Chinese? To give some context, see discussion here for Chinese variants. To me, maybe zh-CN makes more sense here, if we really want to consider the differences of usage at different regions.

Doris-Ge commented 1 year ago

Hi @mgeisler, I'm Doris. I'd like to help! How should I coordinate with other volunteers?

caott0503 commented 1 year ago

Hi @mgeisler, I'm Luke and I saw your email. I'd like to help with the translations! How should I participate in this?

dav11b commented 1 year ago

hey @mgeisler, My name's David and I'm also happy to help!

YifangZ09 commented 1 year ago

Hi. This is Yifang and I'm glad to help :)

mgeisler commented 1 year ago

To create the po file for Chinese, should we use zh-HANS or zh-CN for simplified Chinese? To give some context, see discussion here for Chinese variants.

Thanks for the link โ€” I've also been trying to read up on this!

As written above and in your link, zh-Hans and zh-Hant are the recommended region neutral ways of denoting the Chinese written in einer simplified or traditional script. That's my current understanding and it matches how Google Translate has just two options

To me, maybe zh-CN makes more sense here, if we really want to consider the differences of usage at different regions.

This is something I cannot judge. My guy feeling would be to start with simplified and traditional translations โ€” but that's just because I can see the difference even if I cannot read the scripts ๐Ÿ™‚

Do you think the Rust community is large enough to have regional differences show up so that we should have CN, TW HK and SG translations?

mgeisler commented 1 year ago

Wow, thank you so much for the many positive replies! You're all amazing! :relaxed:

Many have asked me (via emails or via chat) what the next steps will be. I propose the following:

  1. First, we get the zh-CN.po file commited via #676 (@jzpin is on that).
  2. After that, use this spreadsheet to coordinate.
    • I've added everybody who expressed interest above โ€” please add yourself!
    • Pick a file from the second sheet and add your Github username next to it to claim it.
      • Change the state to "In progress" and
      • Add today's date to the last change column.
    • The spreadsheet is editable by everybody (both inside and outside of Google) so you can add/remove things, comment on it and generally update it to suit your needs.

Please send small PRs! I suggest translating the titles in the SUMMARY.md file as you translate the content itself, but that will naturally lead to contention on that file. Perhaps you want to instead agree upfront about the wording for the titles? Our discussions would be a good place to do this.

See #683 for a just-started discussion about where to coordinate a translation table. You might want to create a similar table โ€” in the spreadsheet, in the PO file directly, or in a discussion post.

Let me know if I've forgotten something or can help in any other way!

mgeisler commented 1 year ago

If there are people here who actually wanted to work on a Chinese (Traditional) translation, then please see the newly created #684!

jzpin commented 1 year ago

I only have experiences on zh-CN and zh-TW. Translation between zh-CN and zh-TW is nontrivial. For example, the word software is translated to zh-CN as ่ฝฏไปถ and the direct translation from simplified Chinese to the traditional Chinese is ่ปŸไปถ. But the correct translation is ่ปŸ้ซ”. Both ่ปŸไปถ and ่ปŸ้ซ” are in traditional Chinese. I am not sure if there are such differences in other regions like HK or SG.

Given all that, I agree to use zh-Hans and zh-Hant in this case, as we are most likely to have only two translations in the end. I just want to remind other participants to be aware of the issue.

sylxjtu commented 1 year ago

Hi, I saw your post in misc-pek, glad to help with translation, added myself in the spreadsheet. :smiley:

mgeisler commented 1 year ago

All: please assign a file to yourself in the spreadsheet and send a few small PRs to get started.

See https://github.com/google/comprehensive-rust/issues/324#issuecomment-1562626220 for my proposed next steps โ€” I hope you can self-organize and come up with guidelines for a consistent vocabulary.

gryffindor-rr commented 1 year ago

Hi @mgeisler, I saw your email to misc-pek. I can also help with the translation!

mgeisler commented 1 year ago

Thanks @gryffindor-rr, please see instructions above.

Thanks @sylxjtu for making the first PR with translated strings! :tada: @suetfei, you should be able to review this after accepting the invite to work on the repository.

mgeisler commented 1 year ago

Wow, you've opened an amazing amount of PRs! That's amazing to see! :tada: We now have @suetfei, @wnghl, @anlunx, and @kongy as reviewers for Chinese (Simplified) so I hope you won't have to wait long to get them merged.

When the first day has been translated, then we can start publishing the translation as part of the normal flow. Eventually, we will link it from the translations page and include it in the language picker in the top-right of every page. I suggest we do this when we have the first two days translated โ€” we can put the translation into a new "Under construction" section on the page. Suggestions welcome :slightly_smiling_face:

Daydreamer-riri commented 1 year ago

Great! I will also help with this matter.

jzpin commented 1 year ago

Hi contributors, Two quick questions, (1) the work list is divided by files, but how do you locate the target file in the .po file? (2) I tried the Poedit to modify the translation and it turns out it will modify a lot of the formatting in the file which are not my parts. While I checked PR from other people, they only modified necessary lines. How to handle this?

wnghl commented 1 year ago

@jzpin I've also met these two problems before, here's my solution for these: (1) In po file, all text will have a filename above, just like this:

image

or we can use text search of text editor(Ctrl + F) to find the related position. The file hierarchy is related to the hierarchy of the document category. So when we need to translate chaptor of 'Hello World', just open the chapter in https://google.github.io/comprehensive-rust/hello-world.html, then search "Let us jump into the simplest possible" in the po file. (2) I found that poedit would automatically format the po file, and it will even change the metadata 'Language' from 'zh-Hans' to 'zh_CN'. I don't find where to close the feature, so now I switch to VSCode + gettext plugin to edit the po file:

image image

I will execute the command MDBOOK_BOOK__LANGUAGE=zh-Hans mdbook serve -d book/zh-Hans to ensure the file format and display effect is ok.

jzpin commented 1 year ago

Thanks @wnghl ! This is very helpful.

mgeisler commented 1 year ago

Hi all, thank you very much for the incredible work done here! Let me know if you want to show the in-progress translation already under the Incomplete Translations heading?

I've talked more with people at Google about the naming of the translation and it turns out I was wrong in recommending zh-Hans here. Like @jzpin said above, the vocabulary is different in different regions even if they use the same script.

So I will like us to rename the po/zh-Hans.po file to po/zh-CN.po. @wnghl, can you make a PR for that? Git should be able to merge the in-flight changes fine even after renaming the file.

wnghl commented 1 year ago

Hi all, thank you very much for the incredible work done here! Let me know if you want to show the in-progress translation already under the Incomplete Translations heading?

I've talked more with people at Google about the naming of the translation and it turns out I was wrong in recommending zh-Hans here. Like @jzpin said above, the vocabulary is different in different regions even if they use the same script.

So I will like us to rename the po/zh-Hans.po file to po/zh-CN.po. @wnghl, can you make a PR for that? Git should be able to merge the in-flight changes fine even after renaming the file.

Hi @mgeisler , we have created the pr of renaming and it is already merged

mgeisler commented 1 year ago

Hi @mgeisler , we have created the pr of renaming and it is already merged

Thanks! I guess this issue should be opened again or did you want to create a new one?

wnghl commented 1 year ago

closed this as not plannedWon't fix, can't repro, duplicate, stale

Hi @mgeisler, I think it's okay to reopen this. I'm sorry for inadvertently closing this issue due to my unfamiliarity with GitHub operations.

emmafu2022 commented 1 year ago

Hi @mgeisler , I missed your first email and just saw your 2nd email today. I am happy to help as well.

mgeisler commented 1 year ago

Hi @mgeisler , I missed your first email and just saw your 2nd email today. I am happy to help as well.

Hi @emmafu2022, that's excellent! Thanks a lot! Please see https://github.com/google/comprehensive-rust/issues/324#issuecomment-1562626220 for instructions. We have a lot of reviewers now (and people are very much welcome to review even without being listed in the CODEOWNERS file), so I suggest you get the tooling setup and pick a file to translate :slightly_smiling_face:

Start small and send a few PRs small to get things going!

xusiwei commented 1 year ago

@mgeisler I'm glad to help review some translations. btws, I have about ten years of bare metal development experience and six years of Android development experience, so I think I can help review bare metal and Android related translations.

mgeisler commented 1 year ago

@mgeisler I'm glad to help review some translations. btws, I have about ten years of bare metal development experience and six years of Android development experience, so I think I can help review bare metal and Android related translations.

Excellent, thanks for joining the project! You should be able to review any of the outstanding PRs. You should be able to add comments already. That will be helpful to the PR author so that problems can be spotted quickly.

You can probably not approve the PRs, but we have a handful of dedicated reviewers already so I guess we're covered on that front? Let me know what you all think here.

xusiwei commented 1 year ago

You can probably not approve the PRs, but we have a handful of dedicated reviewers already so I guess we're covered on that front? Let me know what you all think here.

As a part time task, I cannot review incoming PR as soon as possible, so it's looks good for me.

mgeisler commented 1 year ago

As a part time task, I cannot review incoming PR as soon as possible, so it's looks good for me.

Ah, that's great to hear!

We currently have 5 people signed up as code owners for the zh-CN.po file. My intuition is that it's not useful to email, say, 10 people on every PR โ€” I think that will lead to either duplicate work, or lead to a diffusion where everybody thinks someone else will review the PRs. I don't think this is happening right now, you've all done a superb job at reviewing the 30+ PRs so far! :star_struck:

On the other hand, I don't want to discourage anybody from helping out! So I'll keep approving code owners until someone tells me to stop :smile:

superwhd commented 1 year ago

Hi contributors,

Any suggestions on which Chinese translation of the Rust language book we should use as the reference? Previously Martin mentioned https://kaisery.github.io/trpl-zh-cn/ but I also saw other folks suggesting https://rustwiki.org/zh-CN/book/. These two books do have differences in translating terms like 'shadowing' (้š่— vs ้ฎ่”ฝ).

Which Chinese translation of the Rust language book would you suggest as the reference? Please share your thoughts so that we can stick to one as the reference.

mgeisler commented 1 year ago

Hey all, I've sent more chapters to our localization team and will be putting up more PRs soon. Thanks for all the help in reviewing this!