diff --git a/src/build/i18n.ts b/src/build/i18n.ts index b9b7403214..d9dacccd34 100644 --- a/src/build/i18n.ts +++ b/src/build/i18n.ts @@ -44,8 +44,19 @@ export default class Replacer { } } - public replacement(match, a, b, c) { - const key = a || b || c; + public replacement(ctx, match, a, b, c) { + const client = 'misskey/src/client/app/'; + const name = ctx.src.substr(ctx.src.indexOf(client) + client.length); + if (name == '') return match; + + let key = a || b || c; + if (key[0] == '@') { + const prefix = name.split('.')[0].replace(/\//g, '.') + '.'; + //if (name.startsWith('app/desktop/views/')) prefix = 'desktop.views.'; + //if (name.startsWith('app/mobile/views/')) prefix = 'mobile.views.'; + key = prefix + key.substr(1); + } + if (match[0] == '"') { return '"' + this.get(key).replace(/"/g, '\\"') + '"'; } else if (match[0] == "'") { diff --git a/src/client/app/common/views/components/connect-failed.troubleshooter.vue b/src/client/app/common/views/components/connect-failed.troubleshooter.vue index cadbd36ba4..b0a9c87e78 100644 --- a/src/client/app/common/views/components/connect-failed.troubleshooter.vue +++ b/src/client/app/common/views/components/connect-failed.troubleshooter.vue @@ -1,34 +1,34 @@ diff --git a/src/client/app/common/views/components/connect-failed.vue b/src/client/app/common/views/components/connect-failed.vue index 185250dbd8..d90c8756b8 100644 --- a/src/client/app/common/views/components/connect-failed.vue +++ b/src/client/app/common/views/components/connect-failed.vue @@ -1,15 +1,15 @@ diff --git a/src/client/app/common/views/components/forkit.vue b/src/client/app/common/views/components/forkit.vue index 6f334b965a..05971cbf15 100644 --- a/src/client/app/common/views/components/forkit.vue +++ b/src/client/app/common/views/components/forkit.vue @@ -1,5 +1,5 @@ diff --git a/src/client/app/common/views/components/nav.vue b/src/client/app/common/views/components/nav.vue index 8ce75d3529..2295957928 100644 --- a/src/client/app/common/views/components/nav.vue +++ b/src/client/app/common/views/components/nav.vue @@ -1,18 +1,18 @@ diff --git a/src/client/app/common/views/components/poll-editor.vue b/src/client/app/common/views/components/poll-editor.vue index 47d901d7b1..fa1897f435 100644 --- a/src/client/app/common/views/components/poll-editor.vue +++ b/src/client/app/common/views/components/poll-editor.vue @@ -1,18 +1,18 @@ diff --git a/src/client/app/common/views/components/twitter-setting.vue b/src/client/app/common/views/components/twitter-setting.vue index 00669cd833..77788290f6 100644 --- a/src/client/app/common/views/components/twitter-setting.vue +++ b/src/client/app/common/views/components/twitter-setting.vue @@ -1,11 +1,11 @@