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

Chinese translation #77

Open
stone-zeng opened this issue Jul 29, 2020 · 18 comments
Open

Chinese translation #77

stone-zeng opened this issue Jul 29, 2020 · 18 comments
Assignees
Labels
translation Enhancements related to translation

Comments

@stone-zeng
Copy link

stone-zeng commented Jul 29, 2020

Hi!

I'm pleased to contribute a Chinese translation for learnlatex. For better community support, I would like to fork this repo into CTeX-org (see CTeX-org/learnlatex.github.io).

Something need to mention here:

  • Special things for Chinese typesetting need to be added, e.g. the use of ctex, xeCJK etc.
  • Chinese support packages may rely on the system font, and I'm afraid that overleaf can't provide sufficient support (due to copyright).
  • Personally I work with simplified chinese only, and probably the traditional chinese version should be considered as another translation.
    • A related issue: should I use zh or zh-CN or zh-hans or some else?
@davidcarlisle
Copy link
Member

Hi thanks, you may also be interested in the discussion at

#72 (comment)

on whether to translate the examples or leave them in English.

In either case support will be needed for the language-specific examples.

On your bullet points

  • Currently Overleaf is texlive 2019 and latexcgi.xyz is texlive 2020 (updated today) so anything that is available in those distributions should be available. latexcgi.xyz is running on Ubuntu so the fonts available in Ubuntu should be available.

  • Can you clarify the Copyright issue. Can latexcgi.xyz distribute whatever it is that Overleaf can not?

  • Currently we have been documenting to just use the two letter codes, but I guess that will cause problems if we need simplified and traditional? Currently a few parts of the javascript are assuming two letter codes but it wouldn't be hard to fix that. Can you say what you think would be the most natural designations if we had two Chinese variants?

@davidcarlisle davidcarlisle added the translation Enhancements related to translation label Jul 29, 2020
@stone-zeng
Copy link
Author

Can you clarify the Copyright issue.

In texlive there is already an open-source chinese font (fandol), but unfortunately it lacks some rare-used characters, so in some cases one may need to use the system fonts such as simsun/microsoft yahei on windows, pingfang/songti sc on macos, etc. But for the usage of a tutorial, I think this font should be enough and it may not be a big problem.

Can you say what you think would be the most natural designations if we had two Chinese variants?

I think is zh-Hans for simplified and zh-Hant for traditional (I'm still not sure if I should use -Hans or -hans).

@davidcarlisle
Copy link
Member

@stone-zeng thanks. On fonts, yes I found fandol worked for my minimal example at

https://www.learnlatex.org/en/lesson-14#the-unicode-era

but I didn't realise it was the only one. Overleaf and latexcgi.xyz are both running on linux so if there is a system font that works on Overleaf but does not work at latexcgi I should be able to install it there (although the disk is getting full) let me know, But if you can manage with fandol for these simple examples that is even easier:-)

on names yes I gather that the choices are zh-CN (for China) or zh-Hans (for Simplified Script) with the latter being preferred in this sort of context eg
https://en.wikipedia.org/wiki/IETF_language_tag#ISO_3166-1_and_UN_M.49
so let's go with that (I will fix up the Javascript so the language switcher works)

@davidcarlisle
Copy link
Member

davidcarlisle commented Jul 30, 2020

The Overleaf help page

https://www.overleaf.com/learn/latex/chinese

Shows that you can use either of these in addition to fandol at Overleaf

\setCJKmainfont{BabelStone Han}
\setCJKsansfont{Noto Sans CJK SC}

Neither works at latexcgi.xyz at present but if you need one of them let me know, and I'll see what I can do,

@davidcarlisle
Copy link
Member

Fandol Song and BabelStone Han both now work at the LaTeX CGI server for luatex and xetex.

https://davidcarlisle.github.io/latexcgi/test3

@stone-zeng
Copy link
Author

Thanks for your help!

More details about the font:

  • A typical comprehensive chinese document may require 4 kinds of fonts: Song (宋体), Hei (黑体), Kai (楷体) and Fangsong (仿宋体). In ctex and xeCJK, they will be used to match the roman, sans-serif, italic and monospaced latin fonts, respectively.
  • Fandol is the only open source (and free) font family that provide the above 4 kinds. Source Han (i.e. Noto CJK) only contains Song and Hei (i.e. serif and sans), while BabelStone Han only contains Song.

@davidcarlisle
Copy link
Member

davidcarlisle commented Jul 30, 2020

OK hopefully for the tutorial these two will be enough, although as I say I could add more. But being open source and also available on Overleaf is really a requirement as it would be good if all examples on the site worked on both systems.

Currently at latexcgi.xyz I have

$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.7G  7.1G  630M  92% /

so each font eats a reasonable fraction of my available disk space (actually there are a couple of archived linux kenel versions that I could delete if space gets really tight, but..)

Longer term may move the latexcgi.xyz server to a bigger machine but that is what it is just now.

Hopefully you can use Fandol for most of the examples and perhaps a BabelStone Han example to show font switching and then will not need any more fonts in actual examples.

@davidcarlisle
Copy link
Member

Language switching now works for longer language codes (Jekyll/liquid string handling is weird:-)

https://www.learnlatex.org/zh-Hans/

@stone-zeng
Copy link
Author

The CONTRIBUTING.md says:

Please wrap source lines to keep them below 80 characters long.

But for chinese (maybe japanese is the same?) language, line wrap in markdown files will lead to an extra space. So I simply put everything of a paragraph in s single line.

@davidcarlisle
Copy link
Member

@stone-zeng Sure, we were not thinking of Chinese requirements, sorry. Do whatever you need and we will fix up the instructions.

@stone-zeng
Copy link
Author

And for the emphasis (_xxx_ in markdown), since chinese fonts usual do not contain italic shape (actually italic is not commonly used with cjk scripts), I plan to use strong (**xxx**) instead. I'm not sure whether it's ok, or maybe we can change the style of emph for cjk (e.g. underdot, but personally I don't like it and it's rarely seen on web).

@josephwright
Copy link
Contributor

@stone-zeng One for @jonasjacek? This must be a known issue in web development.

@jonasjacek
Copy link

And for the emphasis (_xxx_ in markdown), since chinese fonts usual do not contain italic shape (actually italic is not commonly used with cjk scripts), I plan to use strong (**xxx**) instead. I'm not sure whether it's ok, or maybe we can change the style of emph for cjk (e.g. underdot, but personally I don't like it and it's rarely seen on web).

There are semantic differences between em, strong and i and b. Which to apply depends on the content. I am preparing different styles and also plain CSS classes. We will have to apply HTML elements correctly to achieve a maximum of web content accessibility (also see WCAG). For now you can use what you want. Be prepared, I might change it later.

@davidcarlisle
Copy link
Member

Thank you for working on learnlatex.org translations.
You may have seen already if watching the repository but just a note
to say that we have extended lesson-06 and more-06 to add descriptions
of defining commands with \newcommand and \NewDocumentCommand

463d181

@jonasjacek
Copy link

@stone-zeng - Regarding the text-level semantics, feel free to use whatever you want. Bold and italic are available. If you need more styles or adjustments, let me know.

There is this ticket for me: https://github.com/learnlatex/learnlatex.github.io/projects/1#card-53136775 - It's about using /zh-hans/ instead of just /zh/ for the directory structure.

I did change it during the design process. I had not read this thread in its entirety. So, is it more correct to use /zh-hans/ than just /zh/? Should I change it back?

@davidcarlisle
Copy link
Member

As you may have seen, the main site at learnlatex.org has been given a new design and some of the details of the language data have changed.

If you are still working on the translation, I have updated
https://www.learnlatex.org/TRANSLATIONS
to hopefully give correct instructions for the new layout, but if anything is not clear please ask

@stone-zeng
Copy link
Author

Hi! I have noticed the new design and I will check these updates (and pick up the translations) in recent days.

@davidcarlisle
Copy link
Member

@stone-zeng in this PR to the Japanese translation

wtsnjp#1

I have set up so that _ (emphasis) and ** (strong) use weight 400 and 700 respectively with Noto Sans JP.

We could of course set up similar configuration for Chinese. The Noto Sans SC font appears to be available in exactly the same weights as Noto Sans JP.

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

No branches or pull requests

4 participants