mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.81k stars 35.38k forks source link

I want to translate the document into Chinese, but i met some troubles. #6840

Closed hxnan closed 6 years ago

hxnan commented 9 years ago

I read the folder of /doc and the list.js ,the category of api is writed in JSON. I want to know how the document be built. Do you write html of document directly, Or write text of docment in some software then built the folder of doc/ automatically.

I can write html, but maybe there is a easy way to do this.

mrdoob commented 9 years ago

Yeah, right now we're writing the html directly. The system didn't take translations into account 😅

We could, maybe implement something like...

<div class="en">Hello</div>
<div class="cn">您好</div>

And filter those at display time?

tschw commented 9 years ago

The <meta charset="utf-8" /> tag must be in <head> of every file (it should already be in there). Then some unicode-aware editor like Notepad++ using "UTF-8 without BOM" for the encoding should work quite conveniently...

hxnan commented 9 years ago

Two languages or more in a html page will confuse the mainttainer in future. Create a new folder named doc.cn/ in doc/ would be better.

mrdoob commented 9 years ago

How about duplicating files?

docs/api/cameras/Camera.html
docs/api/cameras/CubeCamera.html
docs/api/cameras/OrthographicCamera.html
docs/api/cameras/PerspectiveCamera.html

Will become:

docs/api/cameras/Camera.html
docs/api/cameras/Camera.cn.html
docs/api/cameras/CubeCamera.html
docs/api/cameras/CubeCamera.cn.html
docs/api/cameras/OrthographicCamera.html
docs/api/cameras/OrthographicCamera.cn.html
docs/api/cameras/PerspectiveCamera.html
docs/api/cameras/PerspectiveCamera.cn.html

But that may be a bit messy... Maybe

docs/api/en/cameras/Camera.html
docs/api/en/cameras/CubeCamera.html
docs/api/en/cameras/OrthographicCamera.html
docs/api/en/cameras/PerspectiveCamera.html

docs/api/cn/cameras/Camera.html
docs/api/cn/cameras/CubeCamera.html
docs/api/cn/cameras/OrthographicCamera.html
docs/api/cn/cameras/PerspectiveCamera.html
hxnan commented 9 years ago

I love the last idea . :+1: A simple but useful way.

tiansijie commented 9 years ago

I would like to help with the translation

tschw commented 9 years ago

The language code for Chinese is zh BTW - CN is the region. The whole locale for China is then called zh_CN.

hxnan commented 9 years ago

Well, thank you for pointing out, so the folder should be /docs/api/zh_CN/*

hxnan commented 9 years ago

The default document is

docs/api/cameras/PerspectiveCamera.html

and the Chinese could be

docs/api/zh_CN/cameras/PerspectiveCamera.html

The rules is :

docs/api/ ( language type) /cameras/PerspectiveCamera.html

We don't need to modify the doc exits now, just add the folder of doc writed by other language.

How about this?

tschw commented 9 years ago

Well, thank you for pointing out, so the folder should be /docs/api/zn_CN/*

Wouldn't do that for documentation, unless zn_CN (Chinese as written in China) and zn_TW (Chinese as written in Taiwan) are incompatibly different and there is actually someone doing a translation for the Taiwanese dialect. Otherwise can just define the default for the Chinese language and call the folder zn, just like the value of the lang attribute in the HTML should read, which is why I mentioned it ;-). For localizing software, regions play a more important role: The Date/Time notation may differ, for instance.

mrdoob commented 9 years ago

Maybe we can follow wikipedia? They use zh as sub domain. I don't think they support zn_TW? https://zh.wikipedia.org/wiki/Wikipedia:%E9%A6%96%E9%A1%B5

WestLangley commented 9 years ago

The language code for Chinese is zh call the folder zn

Which is correct?

hxnan commented 9 years ago

zh is correct @WestLangley , Wiki is excellent, but the https://zh.wikipedia.org/ has been polluted by the fuvk g.o.v. these day.

mrdoob commented 9 years ago

I'm thinking about how the new urls should be. Probably this?

http://threejs.org/docs/en/#Reference/Core/BufferGeometry
http://threejs.org/docs/zh/#Reference/Core/BufferGeometry
Pansaai commented 6 years ago

Hi guys, is this still being worked on ?

hxnan commented 6 years ago

I am sorry for this ,I want to do this work when I was a college student and learning the graphics. But I has got an Operation Engineer Job. So ...close this issue. @Pansaai