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

Japanese translation #69

Open
wtsnjp opened this issue Jul 28, 2020 · 28 comments
Open

Japanese translation #69

wtsnjp opened this issue Jul 28, 2020 · 28 comments
Assignees
Labels
translation Enhancements related to translation

Comments

@wtsnjp
Copy link

wtsnjp commented Jul 28, 2020

Following the instruction in TRANSLATIONS.md, I am happy to open this issue to announce that I have just started the Japanese translation. You can find the translation and its up-to-dated progress in the translation-ja branch of my folk.

Since the translation progress is too little for now (right now headings only), I haven't yet set up for the github-pages at this point. When I prepare a live test site so that to make people easily check for the translation, I will notify the URL in this thread. I hope this way works fine for you.

I am looking forward to working further with you 😄

@davidcarlisle
Copy link
Member

Thanks a lot.

I should say that there are some Japanese examples already on the site, but they were just me checking that (u)platex was supported at the various back ends being used. Feel free to discard them when you get to those pages.

@wtsnjp
Copy link
Author

wtsnjp commented Jul 28, 2020

I got it. I appreciate you and all the people involved to make (u)platex available on the backends.

@josephwright josephwright added the translation Enhancements related to translation label Jul 28, 2020
@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

@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

@wtsnjp
Copy link
Author

wtsnjp commented Apr 26, 2021

Although the progress is slow, I am still working on this Japanese translation. Now I completed “literal” translation for all 16 main lessons (lesson-XX), and so started to host the demo site: https://wtsnjp.github.io/learnlatex.github.io/ja/

The content is still unsuitable for pLaTeX users, and that makes the translation too premature to be read by actual readers. I will continue working on further adjustment of explanations for pLaTeX and also the translation for other contents such as “More on this topic” (more-XX).

@davidcarlisle
Copy link
Member

@wtsnjp Thanks for the status update.

Yes we'll need to leave it to you to a certain extent on how literal the translation needs to be. The "spirit" should be that it is the same course, translated, not a different course, but it also has to be useful to the readers...

At one extreme you could make it a Japanese language course on how to write English LaTeX documents, and leave all the platex specifics to language-xxx lessons at the end, but that might be too extreme.

If you switch the examples to Japanese using platex then you will naturally have to adjust the text in some places and use your judgement on how much to change the text.

You don't have to do the same for all examples: you can have some examples using pdftex and some in platex (or both) if you need to show the differences..

がんばろう!

(Hope that means something:-)

@davidcarlisle
Copy link
Member

davidcarlisle commented Apr 26, 2021

Oh I see you have translated the examples mostly. That's fine they should work at texlive.net and at Overleaf if you add

% !TeX platex

at the top of each. If you need fonts installing at TeXLive.net let me know we have a lot more space available than on my original aws trial host so adding new fonts is not a problem.

test

@wtsnjp
Copy link
Author

wtsnjp commented Apr 26, 2021

Yes. I tested all of the examples with my local platex but have not yet tested with online systems. I noticed that I need to add the magic comments to the pLaTeX examples (most of all examples) and plan to do so.

Today I realize that there is a new "Setting" page on the website. Any possibility to change the default "Default Engine" to another engine from pdfLaTeX for a specific language?

@davidcarlisle
Copy link
Member

davidcarlisle commented Apr 26, 2021

Any possibility to change the default "Default Engine" to another engine from pdfLaTeX for a specific language?

I knew you were going to ask that:-)

Currently not really: the "settings page" is personal settings and disabled by default as uses cookies. but the default default is only set in one place in assets/scripts/runlatex.js

var rldefaultengine=getCookie('runlatex-engine');
if(rldefaultengine=="") rldefaultengine="pdflatex";

I'm not sure I want to make that variable (it complicates the site description a bit if you can't tell by looking which engine will be used) but I can see it might make the translations look nicer (@josephwright any thoughts??)

I think all you would need to do is change the above to

var rldefaultengine=getCookie('runlatex-engine');
if(rldefaultengine=="") {
 if(runlatex.defaultengine==null) {
   rldefaultengine="pdflatex";
 } else {
   rldefaultengine=runlatex.defaultengine;
}
}

Then put

runlatex.defaultengine="platex";

in ja/include/buttons.js

You could try that in your fork:-)

@davidcarlisle
Copy link
Member

davidcarlisle commented Apr 26, 2021

The code above doesn't work actually, the timing is wrong, but this simpler scheme works, you can put

var rldefaultengine=getCookie('runlatex-engine');
if(rldefaultengine=="") rldefaultengine="platex";

at the end of ja/buttons.js and that will work without changing runlatex.js at all.

You can try the examples here:

https://davidcarlisle.github.io/learnlatex.github.io/ja/help

The first has a !TeX comment and the second does not. Conversely I have added a %!TeX pdflatex comment to the English example on that page (although that simple case works with platex as well)

@wtsnjp
Copy link
Author

wtsnjp commented Apr 26, 2021

Thank you very much for that! It is great because it can be all done within the "ja" subtree. I will definitely try it.

@davidcarlisle
Copy link
Member

davidcarlisle commented Apr 26, 2021

one reason having the comments may be simpler....

The above code makes it use platex unless the user has set a preference for something else, but that means if the user has (say) lualatex set as default for the rest of the site the ja pages will fail. It might be better not to look at the cookie and to just have unconditional

rldefaultengine="platex";

which would work the same way as having a platex comment on every page and use platex even if cookies have been set.

@wtsnjp
Copy link
Author

wtsnjp commented Apr 26, 2021

The above code makes it use platex unless the user has set a preference for something else, but that means if the user has (say) lualatex set as default for the rest of the site the ja pages will fail.

Well, but if one set "default engine", then I feel it natural to fail running the examples, which are for platex, without explicit ! TEX comment. Isn't the user who set it by cookies responsible for that?

One small concern is that it still shows "pdfLaTeX" as the default engine in the option menu on ja/setting page, while the actual default engine is "pLaTeX" in this case.

@davidcarlisle
Copy link
Member

well as I say it needs documenting...

currently there is only one setting for the whole site (the cookies have scope for the root of the website) so the ja/settings page is setting the same things as the en/settings page, just the text is translated (or will be) However you might expect that the menus start off selecting the current (Japanese) defaults

the menu is supposed to start with the current value of rldefaultengine

(v==rldefaultengine ? " selected

so I'll have a look why that isn't happening,

@davidcarlisle
Copy link
Member

@wtsnjp ah:

{% if page.path contains "-" or page.path contains "help" %}

so the settings page doesn't read the localised buttons.js

Fixed on my fork:

davidcarlisle@1df8aab

https://davidcarlisle.github.io/learnlatex.github.io/ja/settings
shows platex on the engine menu even when cookies are disabled

@wtsnjp
Copy link
Author

wtsnjp commented Apr 26, 2021

Thanks again for finding the solution.

well as I say it needs documenting...

Ah, now I see. I will mention the ja-specific behavior in ja/setting. Hope that is sufficient.

@davidcarlisle
Copy link
Member

The rest of the site is using noto sans for most text, but the ones that we have installed locally don't cover Japanese so the ja pages are picking up whatever font is installed locally

I added one of your pages to my fork and experimented a bit with using google font server as a fallback after trying the fonts served from texlive.net

https://davidcarlisle.github.io/learnlatex.github.io/ja/lesson-11

As I can't read it anyway it's hard for me to judge if that is reasonable. if you do want to use noto sans, probably the assignment of the weights could be more careful I just got google fonts API to generate three weights here, as an experiment (actually I think I'm only using the regular weight, but enough for tonight)

The change to the css is

davidcarlisle@8471da5#diff-cd886530abfa495dc6782189ca779f1304bb73bc1758e5d3f0968448dfb67abe

and a couple of commits after that to catch more of the css classes used on my test page

@davidcarlisle
Copy link
Member

is

レッスン 11

OK or would you rather have localised digits?

In _includes/toc-lessons.html and _layouts/lesson.html (I should make them share code:-) You will see some code to get Marathi digits, you could add the same for Japanese (it just requires an array of the numbers 0-20).

so you get

प्रकरण ११

at

https://www.learnlatex.org/mr/lesson-11

@wtsnjp
Copy link
Author

wtsnjp commented Apr 27, 2021

I added one of your pages to my fork and experimented a bit with using google font server as a fallback after trying the fonts served from texlive.net

https://davidcarlisle.github.io/learnlatex.github.io/ja/lesson-11

As I can't read it anyway it's hard for me to judge if that is reasonable. if you do want to use noto sans, probably the assignment of the weights could be more careful I just got google fonts API to generate three weights here, as an experiment (actually I think I'm only using the regular weight, but enough for tonight)

I personally think this fallback is a nice idea. Your demo page looks already fine to me, but I am not a professional web designer nor a typographer, so I am currently consulting with some Japanese TeX experts.

@wtsnjp
Copy link
Author

wtsnjp commented Apr 27, 2021

is

レッスン 11

OK or would you rather have localised digits?

Thanks for the tip. But in our case "レッスン 11" (with Arabic numbers) is quite fine. (on the other hand, it is rather preferred to use Kanji to represent numbers when making documents in the vertical direction (i.e., tate-gumi; 縦組み))

@wtsnjp
Copy link
Author

wtsnjp commented Apr 30, 2021

As the Chinese translator mentioned before, using Italic shape to emphasize texts is not common for CJK languages. So, I am also using <strong> (**text** in Markdown) instead of <em> (_text_) in Japanese translation.

I noticed that <strong> are not working well at least in my browser. For instance, in the following case, “TeX システム” (TeX system) are in the <strong> tag but only the “システム” part in Japanese letters are in bold.

Screen Shot 2021-04-30 at 14 51 35

In another example, even Japanese letters (the “後に” part in the below) are not in the bold style. Is this a known issue?

Screen Shot 2021-04-30 at 14 52 14

@davidcarlisle
Copy link
Member

@wtsnjp this is actually related to the noto sans comment I made earlier. I should probably make another attempt this weekend of setting up the fonts. Currently the fonts specified don't cover Japanese so your browser CSS engine will use whichever font it finds that has the characters. Then whether that font has a bold or italic variant installed is all a bit arbitrary and depends on the machine you use to view the site and what fonts it has.

If we set up the noto sans cjk fonts correctly then we will have a known set of variants and can set up the fonts even without you changing the markup. That is, if italic doesn't make sense we can specify that css class uses bold without changing the markdown.

@davidcarlisle
Copy link
Member

@wtsnjp I may have over-done the contrast a bit, but does this look readable (I honestly can't really tell)

https://davidcarlisle.github.io/learnlatex.github.io/ja/lesson-09#label-%E3%82%92%E7%BD%AE%E3%81%8F%E4%BD%8D%E7%BD%AE

I went a step further than my attempt in the comment above, rather than offering the Noto Sans JP font just as a fallback I switch the stylesheet to use a style-ja.sccs which gives more flexibility to adjust weights and sizes.

I added your fork as another upstream to my fork and am building the gh-pages the translation-ja branch.
So if this looks at all reasonable I can easily make a PR back to your fork.

I haven't done the monospace font used by the editor and have only done the lesson template not the non-lesson pages template, but I thought I'd let you see the attempt so far.

@davidcarlisle
Copy link
Member

sorry something not right, it's gone back to my local yu Gothic font in most places, probably I broke the css. Enough for tonight though.

@wtsnjp
Copy link
Author

wtsnjp commented May 1, 2021

Thanks a lot for your help. Though I haven't yet checked everything, your fork looks far better than before 👍

I added your fork as another upstream to my fork and am building the gh-pages the translation-ja branch.
So if this looks at all reasonable I can easily make a PR back to your fork.

This is much helpful for me. I also wonder how we apply the previous matters (i.e., the changes for default "default engine" for ja translation).

I occasionally merge learnlatex:main to my translation-ja branch anyway, so just putting those updates in the original repository will work fine too.

@davidcarlisle
Copy link
Member

I also wonder how we apply the previous matters (i.e., the changes for default "default engine" for ja translation).

That should happen automatically if when you make a PR to add Japanese to the main site, you have the default setting in ja/buttons.js it should "just work"

PR to @wtsnjp fork at wtsnjp#1

@wtsnjp
Copy link
Author

wtsnjp commented May 1, 2021

Thanks for the pull request. I merged and confirmed it works. I will update style-ja.scss further on my side if necessary.

I also wonder how we apply the previous matters (i.e., the changes for default "default engine" for ja translation).

That should happen automatically if when you make a PR to add Japanese to the main site, you have the default setting in ja/buttons.js it should "just work"

I meant this one (davidcarlisle@1df8aab). This change is not under the ja directory, so it can be a cause of conflict in the future, but should I commit this to my fork anyway?

@davidcarlisle
Copy link
Member

@wtsnjp ah sorry yes, that will be fine add it on your side then you can test it. I don't need to worry about merge conflicts in my fork, it is a "throw away" repository for testing things. If it is not easy to resolve conflicts I just discard it and re-fork from the head of the main site.

wtsnjp added a commit to wtsnjp/learnlatex.github.io that referenced this issue May 1, 2021
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

3 participants