fix: fix translation linking

This commit is contained in:
Alex Grozav 2023-06-22 13:06:54 +03:00
parent b616ab6287
commit ffcbaedf18
4 changed files with 34 additions and 24 deletions

View file

@ -421,9 +421,9 @@ export default defineComponent({
case 'settings': {
const defaultRoute = this.findFirstAccessibleSettingsRoute();
if (defaultRoute) {
const routeProps = this.$router.resolve({ name: defaultRoute });
const route = this.$router.resolve({ name: defaultRoute });
if (this.$router.currentRoute.name !== defaultRoute) {
this.goToRoute(routeProps.route.path);
this.goToRoute(route.path);
}
}
break;
@ -445,7 +445,6 @@ export default defineComponent({
}
},
goToRoute(route: string | { name: string }) {
console.log(this.$router);
this.$router.push(route).catch((failure) => {
console.log(failure);
// Catch navigation failures caused by route guards

View file

@ -4,7 +4,6 @@
:before-close="closeDialog"
:class="{
'dialog-wrapper': true,
[$style.center]: center,
scrollable: scrollable,
[getCustomClass()]: true,
}"

View file

@ -597,8 +597,8 @@ export const I18nPlugin: Plugin<{}> = {
async install(app) {
await locale.use('en');
locale.i18n((key: string, options?: { interpolate: object }) =>
i18nInstance.global.t(key, options && options.interpolate),
locale.i18n((key: string, options?: { interpolate: Record<string, unknown> }) =>
i18nInstance.global.t(key, options?.interpolate || {}),
);
app.config.globalProperties.$locale = i18n;

View file

@ -1,21 +1,33 @@
{
"_reusableBaseText.cancel": "Cancel",
"_reusableBaseText.codeNodeEditor.linter.useJson": "Access the properties of an item under `.json`, e.g. `item.json`",
"_reusableBaseText.codeNodeEditor.completer.all": "Get all items",
"_reusableBaseText.codeNodeEditor.completer.first": "Get the first item",
"_reusableBaseText.codeNodeEditor.completer.last": "Get the last item",
"_reusableBaseText.codeNodeEditor.completer.itemMatching": "Get the item matching a specified input item. Pass the input item index",
"_reusableBaseText.name": "Name",
"_reusableBaseText.save": "Save",
"_reusableBaseText.dismiss": "Dismiss",
"_reusableDynamicText.readMore": "Read more",
"_reusableDynamicText.learnMore": "Learn more",
"_reusableDynamicText.moreInfo": "More info",
"_reusableDynamicText.oauth2.clientId": "Client ID",
"_reusableDynamicText.oauth2.clientSecret": "Client Secret",
"_reusableBaseText.unlimited": "Unlimited",
"_reusableBaseText.activate": "Activate",
"_reusableBaseText.error": "Error",
"_reusableBaseText": {
"cancel": "Cancel",
"codeNodeEditor": {
"linter": {
"useJson": "Access the properties of an item under `.json`, e.g. `item.json`"
},
"completer": {
"all": "Get all items",
"first": "Get the first item",
"last": "Get the last item",
"itemMatching": "Get the item matching a specified input item. Pass the input item index"
}
},
"name": "Name",
"save": "Save",
"dismiss": "Dismiss",
"unlimited": "Unlimited",
"activate": "Activate",
"error": "Error"
},
"_reusableDynamicText": {
"readMore": "Read more",
"learnMore": "Learn more",
"moreInfo": "More info",
"oauth2": {
"clientId": "Client ID",
"clientSecret": "Client Secret"
}
},
"generic.any": "Any",
"generic.cancel": "Cancel",
"generic.confirm": "Confirm",
@ -1132,7 +1144,7 @@
"runData.editor.save": "Save",
"runData.editor.cancel": "Cancel",
"runData.editor.copyDataInfo": "You can copy data from previous executions and paste it above.",
"saveButton.save": "@:{'saveButton.saved'}",
"saveButton.save": "@:_reusableBaseText.save",
"saveButton.saved": "Saved",
"saveButton.saving": "Saving",
"settings": "Settings",