interactive-examples
interactive-examples copied to clipboard
Manage localization/translation for interactive examples
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. thetitle
property of an element of thepages
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.
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>