fix some translation issues

master
JFH 2021-05-16 16:44:13 +02:00
parent 81a31c3dad
commit 8001005a19
5 changed files with 6 additions and 19 deletions

View File

@ -309,7 +309,7 @@ class Editor extends EditorStartup {
mod = modBits[0] + '+';
key = modBits[1];
}
keyStr += (i ? '/' : '') + mod + (this.uiStrings['key_' + key] || key);
keyStr += (i ? '/' : '') + mod + (this.i18next.t('key_' + key) || key);
});
if (menu) {
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 {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 renameLayer = (oldLayerName === this.i18next.t('notification.common.layer') + ' 1');
// this.svgCanvas.setUiStrings(allStrings);
this.setTitles();
if (renameLayer) {

View File

@ -29,7 +29,7 @@ export default {
const { $id } = svgEditor.svgCanvas;
const imagelibStrings = await loadExtensionTranslation(svgEditor.configObj.pref('lang'));
const { uiStrings, svgCanvas } = svgEditor;
const { svgCanvas } = svgEditor;
const allowedImageLibOrigins = imagelibStrings.imgLibs.map(({ url }) => {
try {
@ -184,7 +184,7 @@ export default {
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') {
await seConfirm(message);
@ -411,7 +411,7 @@ export default {
const button = document.createElement('button');
// 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);
button.addEventListener('click', function () {
$id("imgbrowse_holder").style.display = 'none';

View File

@ -148,7 +148,6 @@ export default {
c.style.height = svgCanvas.contentH;
await canvg(c, data.svg);
const datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType);
// {uiStrings} = svgEditor;
// Check if there are issues
let pre, note = '';

View File

@ -14,7 +14,6 @@ class LayersPanel {
* @param {PlainObject} editor
*/
constructor(editor) {
this.uiStrings = editor.uiStrings;
this.updateContextPanel = editor.topPanel.updateContextPanel;
this.sidedrag = -1;
this.sidedragging = false;
@ -215,11 +214,11 @@ class LayersPanel {
let uniqName;
let i = this.editor.svgCanvas.getCurrentDrawing().getNumLayers();
do {
uniqName = this.uiStrings.layers.layer + " " + ++i;
uniqName = this.editor.i18next.t("layers.layer") + " " + ++i;
} while (this.editor.svgCanvas.getCurrentDrawing().hasLayer(uniqName));
const newName = prompt(
this.i18next.t('notification.enterUniqueLayerName'),
this.editor.i18next.t('notification.enterUniqueLayerName'),
uniqName
);
if (!newName) {

View File

@ -15,7 +15,6 @@ class TopPanel {
*/
constructor(editor) {
this.editor = editor;
this.uiStrings = editor.uiStrings;
}
/**
* @type {module}