improve loading of extension locales with fallback

This commit is contained in:
jfh
2020-09-10 00:54:17 +02:00
parent 9a8b573ca5
commit ff83e4d22e
94 changed files with 267 additions and 354 deletions

View File

@@ -6,13 +6,13 @@
* @copyright 2010 Alexis Deveria
*
*/
import {loadExtensionTranslation} from '../../locale.js';
export default {
name: 'imagelib',
async init ({$, decode64, dropXMLInternalSubset}) {
const svgEditor = this;
// eslint-disable-next-line node/no-unsupported-features/es-syntax
const {default: imagelibStrings} = await import(`./locale/${svgEditor.curPrefs.lang}.js`);
const imagelibStrings = await loadExtensionTranslation('imagelib', svgEditor.curPrefs.lang);
const {uiStrings, canvas: svgCanvas} = svgEditor;