js-draw 1.30.1 → 1.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/bundle.js +20 -20
- package/dist/cjs/localizations/getLocalizationTable.js +2 -0
- package/dist/cjs/localizations/zh.d.ts +3 -0
- package/dist/cjs/localizations/zh.js +170 -0
- package/dist/cjs/tools/PanZoom.js +8 -2
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/localizations/getLocalizationTable.mjs +2 -0
- package/dist/mjs/localizations/zh.d.ts +3 -0
- package/dist/mjs/localizations/zh.mjs +168 -0
- package/dist/mjs/tools/PanZoom.mjs +8 -2
- package/dist/mjs/version.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
@@ -268,9 +268,9 @@ const editor = new Editor(document.body, {
|
|
268
268
|
|
269
269
|
### Localization
|
270
270
|
|
271
|
-
|
271
|
+
By default, `js-draw` will attempt to automatically select the display language: if a user's language is available in [src/localizations/](packages/js-draw/src/localizations) (as determined by `navigator.languages`), that localization will be used.
|
272
272
|
|
273
|
-
To
|
273
|
+
**Using a different UI language**: To change the language used by the editor, set the `localization` option to `getLocalizationTable([ 'custom locale here' ])` or a custom localization table. For example,
|
274
274
|
|
275
275
|
```ts
|
276
276
|
const editor = new Editor(document.body, {
|
@@ -279,9 +279,11 @@ const editor = new Editor(document.body, {
|
|
279
279
|
});
|
280
280
|
```
|
281
281
|
|
282
|
+
**Contributing a new localization upstream**: To contribute a new localization to `js-draw`, use one of the "Translation" [issue templates](https://github.com/personalizedrefrigerator/js-draw/issues/new/choose) in the main `js-draw` repository.
|
283
|
+
|
282
284
|
<details><summary>Creating a custom localization</summary>
|
283
285
|
|
284
|
-
See [src/localization.ts](packages/js-draw/src/localization.ts) for a list of strings that can be translated.
|
286
|
+
It's also possible to create a full custom localization table. See [src/localization.ts](packages/js-draw/src/localization.ts) and [the translation issue templates](https://js-draw.web.app/debugging/translation-tester/) for a list of strings that can be translated.
|
285
287
|
|
286
288
|
Many of the default strings in the editor might be overridden like this:
|
287
289
|
|