diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-15 01:04:40 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-15 01:04:40 +0900 |
| commit | 554570cb0964f9eca6eb3d645a0a2ca0550d4733 (patch) | |
| tree | bafc924dea123f6d08ec3c38c682957e2b519e86 /src/build | |
| parent | :v: (diff) | |
| download | misskey-554570cb0964f9eca6eb3d645a0a2ca0550d4733.tar.gz misskey-554570cb0964f9eca6eb3d645a0a2ca0550d4733.tar.bz2 misskey-554570cb0964f9eca6eb3d645a0a2ca0550d4733.zip | |
wip
Diffstat (limited to 'src/build')
| -rw-r--r-- | src/build/i18n.ts | 15 |
1 files changed, 13 insertions, 2 deletions
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] == "'") { |