Merge pull request #501 from SVG-Edit/V7-dev

localized strings
master
JFH 2021-05-10 00:13:16 +02:00 committed by GitHub
commit a7052ec9e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View File

@ -1165,7 +1165,7 @@ class Editor extends EditorStartup {
reject(new Error('URLLoadFail'));
return;
}
seAlert(this.uiStrings.notification.URLLoadFail + ': \n' + err);
seAlert(this.i18next.t('notification.URLLoadFail') + ': \n' + err);
resolve();
},
complete() {

View File

@ -216,7 +216,7 @@ class EditorStartup {
let promptMoveLayerOnce = false;
$id('selLayerNames').addEventListener('change', function(evt) {
const destLayer = evt.currentTarget.options[evt.currentTarget.selectedIndex].value;
const confirmStr = self.uiStrings.notification.QmoveElemsToLayer.replace('%s', destLayer);
const confirmStr = self.i18next.t('notification.QmoveElemsToLayer').replace('%s', destLayer);
/**
* @param {boolean} ok
* @returns {void}
@ -594,7 +594,7 @@ class EditorStartup {
*/
const editorObj = this;
const importImage = function (e) {
document.getElementById('se-prompt-dialog').title = editorObj.uiStrings.notification.loadingImage;
document.getElementById('se-prompt-dialog').title = editorObj.i18next.t('notification.loadingImage');
e.stopPropagation();
e.preventDefault();
const file = (e.type === 'drop') ? e.dataTransfer.files[0] : this.files[0];

View File

@ -27,7 +27,7 @@ class MainMenu {
*/
async clickClear() {
const [x, y] = this.editor.configObj.curConfig.dimensions;
const ok = await seConfirm(this.editor.uiStrings.notification.QwantToClear);
const ok = await seConfirm(this.editor.i18next.t('notification.QwantToClear'));
if (ok === "Cancel") {
return;
}
@ -72,15 +72,15 @@ class MainMenu {
this.editor.svgCanvas.setDocumentTitle(title);
if (w !== "fit" && !isValidUnit("width", w)) {
seAlert(this.editor.uiStrings.notification.invalidAttrValGiven);
seAlert(this.editor.i18next.t('notification.invalidAttrValGiven'));
return false;
}
if (h !== "fit" && !isValidUnit("height", h)) {
seAlert(this.editor.uiStrings.notification.invalidAttrValGiven);
seAlert(this.editor.i18next.t('notification.invalidAttrValGiven'));
return false;
}
if (!this.editor.svgCanvas.setResolution(w, h)) {
seAlert(this.editor.uiStrings.notification.noContentToFitTo);
seAlert(this.editor.i18next.t('notification.noContentToFitTo'));
return false;
}
// Set image save option

View File

@ -226,7 +226,7 @@ class LayersPanel {
return;
}
if (this.editor.svgCanvas.getCurrentDrawing().hasLayer(newName)) {
alert(this.uiStrings.notification.dupeLayerName);
alert(this.i18next.t('notification.dupeLayerName'));
return;
}
this.editor.svgCanvas.createLayer(newName);
@ -270,7 +270,7 @@ class LayersPanel {
return;
}
if (this.editor.svgCanvas.getCurrentDrawing().hasLayer(newName)) {
alert(this.uiStrings.notification.dupeLayerName);
alert(this.i18next.t('notification.dupeLayerName'));
return;
}
this.editor.svgCanvas.cloneLayer(newName);
@ -323,7 +323,7 @@ class LayersPanel {
*/
layerRename() {
const oldName = document.querySelector("#layerlist tr.layersel td.layername").textContent;
const newName = prompt(this.uiStrings.notification.enterNewLayerName, "");
const newName = prompt(this.i18next.t('notification.enterNewLayerName'), "");
if (!newName) {
return;
}

View File

@ -138,7 +138,7 @@ class TopPanel {
curhref = curhref.startsWith("data:") ? "" : curhref;
// eslint-disable-next-line no-alert
const url = prompt(
this.editor.uiStrings.notification.enterNewImgURL,
this.editor.i18next.t('notification.enterNewImgURL'),
curhref
);
if (url) {