webgl-fundamentals
webgl-fundamentals copied to clipboard
Translation
Hello, I'd like to translate your "WebGL Fundamentals" guide and publish the translation as a part of my site with an information about your authorship of course. The idea is probably compatible with your licence, but let me confirm - would you like to agree for this kind of activity?
Kind regards, M.
Of course! Be my guest!
Great, thx. So I'm starting to translate /webgl/lessons/webgl-fundamentals.md to polish. Would you like to suggest the best place in repository for the translated file? Maybe /webgl/pl/lessons/webgl-fundamentals.md ? How to generate html file from markdown source regarding to your page layout?
I hacked in some translation support. Grab the latest, put your files in webgl/lessons/pl
. As you add lessons update webgl/lessons/pl/toc.html
.
To build if you haven't already done this type
cd <path-to-repo>
npm install
Then to build type
grunt build
and cross your fingers. I feels pretty hacked but it seemed to work.
I've fetched your changes but unfortunately I still don't know how to correctly regenerate webgl/lessons/pl/webgl-fundamentals.html
on the basis of translated webgl/lessons/pl/webgl-fundamentals.md
. Would you like to help me, pls?
I tried as below, however the html file left untouched. Generally I'm affraid tasks in Gruntfile change mainly docs
and API description, aren't they?
$ grunt --force build
Running "build" task
Warning: Cannot find module 'Promise' Used --force, continuing.
Done, but with warnings.
I tried to verify availability of "promises" and it seems ok
$ js
> require('promise')
{ [Function: Promise]
resolve: [Function],
cast: [Function],
from: [Function],
denodeify: [Function],
nodeify: [Function],
all: [Function],
reject: [Function],
race: [Function] }
So I just tried this and it worked for me
git clone [email protected]:greggman/webgl-fundamentals.git
cd webgl-fundamentals
npm install
grunt build
Does that not work for you?
if I edit webgl/lessons/pl/webgl-fundamentals.md
and then type grunt build
I see
Running "build" task
processing: webgl/lessons/webgl-2-textures.md
processing: webgl/lessons/webgl-2d-matrices.md
processing: webgl/lessons/webgl-2d-rotation.md
processing: webgl/lessons/webgl-2d-scale.md
processing: webgl/lessons/webgl-2d-translation.md
processing: webgl/lessons/webgl-2d-vs-3d-library.md
processing: webgl/lessons/webgl-3d-camera.md
processing: webgl/lessons/webgl-3d-orthographic.md
processing: webgl/lessons/webgl-3d-perspective.md
processing: webgl/lessons/webgl-3d-textures.md
processing: webgl/lessons/webgl-and-alpha.md
processing: webgl/lessons/webgl-animation.md
processing: webgl/lessons/webgl-anti-patterns.md
processing: webgl/lessons/webgl-boilerplate.md
processing: webgl/lessons/webgl-drawing-multiple-things.md
processing: webgl/lessons/webgl-fundamentals.md
processing: webgl/lessons/webgl-how-it-works.md
processing: webgl/lessons/webgl-image-processing-continued.md
processing: webgl/lessons/webgl-image-processing.md
processing: webgl/lessons/webgl-less-code-more-fun.md
processing: webgl/lessons/webgl-resizing-the-canvas.md
processing: webgl/lessons/webgl-scene-graph.md
processing: webgl/lessons/webgl-shaders-and-glsl.md
processing: webgl/lessons/webgl-text-canvas2d.md
processing: webgl/lessons/webgl-text-glyphs.md
processing: webgl/lessons/webgl-text-html.md
processing: webgl/lessons/webgl-text-texture.md
processing: webgl/lessons/index.md
processing: webgl/lessons/pl/webgl-fundamentals.md
Wrote: webgl/lessons/pl/webgl-fundamentals.html
processing: webgl/lessons/pl/index.md
Done, without errors.
I don't know why it doesn't work. I've recorded whole procedure - if you havy any idea it would be great. I'm sorry for my incompetence.
$ git clone https://github.com/greggman/webgl-fundamentals.git
Cloning into 'webgl-fundamentals'...
remote: Counting objects: 3005, done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 3005 (delta 10), reused 0 (delta 0), pack-reused 2978
Receiving objects: 100% (3005/3005), 3.89 MiB | 380 KiB/s, done.
Resolving deltas: 100% (2169/2169), done.
$ cd webgl-fundamentals/
$ npm install
npm WARN peerDependencies The peer dependency eslint@>=0.8.0 included from eslint-plugin-one-variable-per-var will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint@>=0.8.0 included from eslint-plugin-require-trailing-comma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint@>=0.8.0 included from eslint-plugin-optional-comma-spacing will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint@>=0.8.0 included from eslint-plugin-google-camelcase will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
[email protected] node_modules/eslint-plugin-html
[email protected] node_modules/hanson
[email protected] node_modules/minimist
[email protected] node_modules/marked
[email protected] node_modules/grunt-contrib-clean
└── [email protected]
[email protected] node_modules/feed
└── [email protected]
[email protected] node_modules/sitemap
└── [email protected]
[email protected] node_modules/inmemfilecache
└── [email protected] ([email protected])
[email protected] node_modules/promise
└── [email protected]
[email protected] node_modules/glob
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected])
[email protected] node_modules/htmlparser2
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected])
[email protected] node_modules/grunt
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/mout
[email protected] node_modules/handlebars
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/grunt-eslint
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/eslint
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/eslint-plugin-one-variable-per-var
[email protected] node_modules/eslint-plugin-require-trailing-comma
[email protected] node_modules/eslint-plugin-optional-comma-spacing
[email protected] node_modules/eslint-plugin-google-camelcase
[email protected] node_modules/grunt-jsdoc
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected])
$ grunt build --force
Running "build" task
Warning: Cannot find module 'Promise' Used --force, continuing.
Done, but with warnings.
$ cp /somewhere/webgl-fundamentals.md webgl/lessons/pl/webgl-fundamentals.md
$ grunt build --force
Running "build" task
Warning: Cannot find module 'Promise' Used --force, continuing.
Done, but with warnings.
$ ll webgl/lessons/pl/webgl-fundamentals*
... 6 00:37 webgl/lessons/pl/webgl-fundamentals.html
... 6 00:41 webgl/lessons/pl/webgl-fundamentals.md
$ npm --version
2.12.1
Pull again, try it now.
The command grunt --stack
seems to work - thanks for your support.
There is a next question about "hardcoded" messages - would you like to exctract them into any kind of localized resources? For example in build.js
Handlebars.registerHelper('example', function(options) {
options.hash.width = options.hash.width || "400";
options.hash.height = options.hash.height || "300";
options.hash.caption = options.hash.caption || "click here to open in a separate window";
options.hash.examplePath = options.data.root.examplePath;
return templateManager.apply("build/templates/example.template", options.hash);
});
IMVHO it would be great to have the above default caption "click here to open in a separate window" in localizable resource file.
You don't need --stack
. All that does is print a stack trace when there is an error
I'll add something for the hardcoded parts.
Ok, I pushed something that moves some of the language settings to webgl/lessons/pl/langinfo.hanson
.
hanson is just JSON but allows comments and non-quoted property names
Thx a lot. I've fetched your updates. Regarding to a page footer ("Questions" on stackoverflow etc.) I suppose we probably still need a localization of build/templates/lesson.template
. Maybe build/templates/pl/lesson.template
would be ok?
Is it possible to regenerate toc.html
?
I've seen a languge configurations inside build.js
eg.:
{
template: "build/templates/lesson.template",
lessons: "webgl/lessons/pl",
lang: 'pl',
toc: 'webgl/lessons/pl/toc.html',
examplePath: '../',
}
and I wonder if it would not be nice to have separated files with them eg. build/conf/lang/pl.henson
?
For now I just moved the comment section header to langinfo.hanson
. I can consider making it some tiny template but it seemed overkill for such a small string.
I got rid of the stuff in build.js
. It now scans for langinfo.hanson
files. So in other words if there's a webgl/lessons/ja/langinfo.hanson
it will assume that's another language
toc.html
is edited by hand. There is no generating it because it's a manually organized list. So, as you add articles edit pl/toc.html
to point to the articles. I'll leave it to you if you want to point to the English articles for ones not yet translated. Once you have a few files up I'll add a language menu or link of some kind somewhere
I've pushed the translation of the first lesson (webgl-fundamentals) into https://github.com/vinci-mz/webgl-fundamentals.git and published it on https://vinci.org.pl/ref/podstawy-webgl/podstawy-webgl . Please let me know, is it ok for you? If so, I'd like to start translation next lessons.
It's great. Pulled your changes into this repo and published. I added a language menu so if you go to http://webglfundamentals.org/webgl/lessons/webgl-fundamentals.html you'll see a dropdown on the right to select other languages. I still need to add one on the main page as well. You probably want to pull the latest from here into your repo
I hope the polish translation of webgl-2d-vs-3d-library is ready to pull from https://github.com/vinci-mz/webgl-fundamentals.git . I've also made the regarding pull request and published the translation on https://vinci.org.pl/ref/podstawy-webgl/webgl-api-rasteryzacyjne-czy-biblioteka-3d .
Pulled! Thanks!
I hope the polish translation of a next article (webgl-2d-translation) is ready to pull from https://github.com/vinci-mz/webgl-fundamentals.git . I've also made the regarding pull request and published the translation on https://vinci.org.pl/ref/podstawy-webgl/przesuniecia-dwuwymiarowe-w-webgl Kind regrads,