interactive-examples icon indicating copy to clipboard operation
interactive-examples copied to clipboard

Manage localization/translation for interactive examples

Open SphinxKnight opened this issue 7 years ago • 1 comments

This issue is about tracking what needs to be done about localization:

  • [ ] Being able to localize strings in templates (or templates) (e.g. the "Reset" button)
  • [ ] Being able to localize static strings in site.json (e.g. the title property of an element of the pages array)
  • [ ] Being able to localize the content of examples (e.g. ['Fire', 'Wind', 'Rain']; in js-examples/array-join.html) including comments etc.

First two items could leverage existing tools already in use for Kuma. As for the third one, it seems to me that Pontoon wouldn't be a good place for such translations… maybe a branch per locale (e.g. "fr" branch to store the French content with a fallback on master/en-US if the localized content doesn't exist).

This is a rough initial draft, feel free to comment.

SphinxKnight avatar Nov 21 '17 18:11 SphinxKnight

How about using lang attribute for dynamic import?

such as,

// Korean
<pre lang="ko">
<code id="static-js">// create an ArrayBuffer with a size in bytes
var buffer = new ArrayBuffer(16);

console.log(ArrayBuffer.isView(new Int32Array()));
// expected output: true
</code>
</pre>

// Default
<pre>
<code id="static-js">// create an ArrayBuffer with a size in bytes
var buffer = new ArrayBuffer(16);

console.log(ArrayBuffer.isView(new Int32Array()));
// expected output: true
</code>
</pre>

techhtml avatar Apr 11 '18 09:04 techhtml