improve loading of extension locales with fallback
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
29
src/editor/extensions/ext-imagelib/index.html
Normal file
29
src/editor/extensions/ext-imagelib/index.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>-</title>
|
||||
<link rel="icon" type="image/png" href="../../images/logo.png" />
|
||||
|
||||
<!-- Lacking browser support -->
|
||||
<script nomodule="" src="../../redirect-on-no-module-support.js"></script>
|
||||
<script type="module" src="../../redirect-on-lacking-support.js"></script>
|
||||
|
||||
<!-- As yet no ES6 -->
|
||||
<script src="../../jquery.min.js"></script>
|
||||
|
||||
<!-- ES6+ polyfills (Babel) -->
|
||||
<script src="../../external/core-js-bundle/minified.js"></script>
|
||||
<script src="../../external/regenerator-runtime/runtime.js"></script>
|
||||
|
||||
<script type="module" src="index.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Select an image:</h1>
|
||||
<a href="smiley.svg">smiley.svg</a>
|
||||
<br/>
|
||||
<a href="../../images/logo.png">logo.png</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
imgLibs: [
|
||||
{
|
||||
name: 'Demo library (local)',
|
||||
url: '{path}imagelib/index.html',
|
||||
url: 'extensions/ext-imagelib/index.html',
|
||||
description: 'Demonstration library for SVG-edit on this server'
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user