fix some translation issues
This commit is contained in:
@@ -309,7 +309,7 @@ class Editor extends EditorStartup {
|
|||||||
mod = modBits[0] + '+';
|
mod = modBits[0] + '+';
|
||||||
key = modBits[1];
|
key = modBits[1];
|
||||||
}
|
}
|
||||||
keyStr += (i ? '/' : '') + mod + (this.uiStrings['key_' + key] || key);
|
keyStr += (i ? '/' : '') + mod + (this.i18next.t('key_' + key) || key);
|
||||||
});
|
});
|
||||||
if (menu) {
|
if (menu) {
|
||||||
this.lastChild.textContent = t + ' [' + keyStr + ']';
|
this.lastChild.textContent = t + ' [' + keyStr + ']';
|
||||||
@@ -329,15 +329,6 @@ class Editor extends EditorStartup {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Expose the `uiStrings`.
|
|
||||||
* @function module:SVGthis.canvas.getUIStrings
|
|
||||||
* @returns {module:SVGthis.uiStrings}
|
|
||||||
*/
|
|
||||||
getUIStrings() {
|
|
||||||
return this.uiStrings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} editmode
|
* @param {boolean} editmode
|
||||||
* @param {module:svgcanvas.SvgCanvas#event:selected} elems
|
* @param {module:svgcanvas.SvgCanvas#event:selected} elems
|
||||||
@@ -1054,7 +1045,6 @@ class Editor extends EditorStartup {
|
|||||||
const oldLayerName = ($id('#layerlist')) ? $id('#layerlist').querySelector('tr.layersel td.layername').textContent : "";
|
const oldLayerName = ($id('#layerlist')) ? $id('#layerlist').querySelector('tr.layersel td.layername').textContent : "";
|
||||||
const renameLayer = (oldLayerName === this.i18next.t('notification.common.layer') + ' 1');
|
const renameLayer = (oldLayerName === this.i18next.t('notification.common.layer') + ' 1');
|
||||||
|
|
||||||
// this.svgCanvas.setUiStrings(allStrings);
|
|
||||||
this.setTitles();
|
this.setTitles();
|
||||||
|
|
||||||
if (renameLayer) {
|
if (renameLayer) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default {
|
|||||||
const { $id } = svgEditor.svgCanvas;
|
const { $id } = svgEditor.svgCanvas;
|
||||||
const imagelibStrings = await loadExtensionTranslation(svgEditor.configObj.pref('lang'));
|
const imagelibStrings = await loadExtensionTranslation(svgEditor.configObj.pref('lang'));
|
||||||
|
|
||||||
const { uiStrings, svgCanvas } = svgEditor;
|
const { svgCanvas } = svgEditor;
|
||||||
|
|
||||||
const allowedImageLibOrigins = imagelibStrings.imgLibs.map(({ url }) => {
|
const allowedImageLibOrigins = imagelibStrings.imgLibs.map(({ url }) => {
|
||||||
try {
|
try {
|
||||||
@@ -184,7 +184,7 @@ export default {
|
|||||||
|
|
||||||
const name = (curMeta.name || 'file');
|
const name = (curMeta.name || 'file');
|
||||||
|
|
||||||
const message = uiStrings.notification.retrieving.replace('%s', name);
|
const message = svgEditor.i18next.t('notification.retrieving').replace('%s', name);
|
||||||
|
|
||||||
if (mode !== 'm') {
|
if (mode !== 'm') {
|
||||||
await seConfirm(message);
|
await seConfirm(message);
|
||||||
@@ -411,7 +411,7 @@ export default {
|
|||||||
|
|
||||||
const button = document.createElement('button');
|
const button = document.createElement('button');
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
button.innerHTML = '<img class="svg_icon" src="./images/cancel.svg" alt="icon" width="16" height="16" />' + uiStrings.common.cancel;
|
button.innerHTML = '<img class="svg_icon" src="./images/cancel.svg" alt="icon" width="16" height="16" />' + svgEditor.i18next.t('common.cancel');
|
||||||
browser.appendChild(button);
|
browser.appendChild(button);
|
||||||
button.addEventListener('click', function () {
|
button.addEventListener('click', function () {
|
||||||
$id("imgbrowse_holder").style.display = 'none';
|
$id("imgbrowse_holder").style.display = 'none';
|
||||||
|
|||||||
@@ -148,7 +148,6 @@ export default {
|
|||||||
c.style.height = svgCanvas.contentH;
|
c.style.height = svgCanvas.contentH;
|
||||||
await canvg(c, data.svg);
|
await canvg(c, data.svg);
|
||||||
const datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType);
|
const datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType);
|
||||||
// {uiStrings} = svgEditor;
|
|
||||||
|
|
||||||
// Check if there are issues
|
// Check if there are issues
|
||||||
let pre, note = '';
|
let pre, note = '';
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class LayersPanel {
|
|||||||
* @param {PlainObject} editor
|
* @param {PlainObject} editor
|
||||||
*/
|
*/
|
||||||
constructor(editor) {
|
constructor(editor) {
|
||||||
this.uiStrings = editor.uiStrings;
|
|
||||||
this.updateContextPanel = editor.topPanel.updateContextPanel;
|
this.updateContextPanel = editor.topPanel.updateContextPanel;
|
||||||
this.sidedrag = -1;
|
this.sidedrag = -1;
|
||||||
this.sidedragging = false;
|
this.sidedragging = false;
|
||||||
@@ -215,11 +214,11 @@ class LayersPanel {
|
|||||||
let uniqName;
|
let uniqName;
|
||||||
let i = this.editor.svgCanvas.getCurrentDrawing().getNumLayers();
|
let i = this.editor.svgCanvas.getCurrentDrawing().getNumLayers();
|
||||||
do {
|
do {
|
||||||
uniqName = this.uiStrings.layers.layer + " " + ++i;
|
uniqName = this.editor.i18next.t("layers.layer") + " " + ++i;
|
||||||
} while (this.editor.svgCanvas.getCurrentDrawing().hasLayer(uniqName));
|
} while (this.editor.svgCanvas.getCurrentDrawing().hasLayer(uniqName));
|
||||||
|
|
||||||
const newName = prompt(
|
const newName = prompt(
|
||||||
this.i18next.t('notification.enterUniqueLayerName'),
|
this.editor.i18next.t('notification.enterUniqueLayerName'),
|
||||||
uniqName
|
uniqName
|
||||||
);
|
);
|
||||||
if (!newName) {
|
if (!newName) {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class TopPanel {
|
|||||||
*/
|
*/
|
||||||
constructor(editor) {
|
constructor(editor) {
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
this.uiStrings = editor.uiStrings;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @type {module}
|
* @type {module}
|
||||||
|
|||||||
Reference in New Issue
Block a user