summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-15 02:58:49 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-15 02:58:49 +0900
commit5a49d142464f42b87e8538579f34795d6a546036 (patch)
treea269989d61ac3139f59a8f076e8f1de32f7583cd /src
parentwip (diff)
downloadsharkey-5a49d142464f42b87e8538579f34795d6a546036.tar.gz
sharkey-5a49d142464f42b87e8538579f34795d6a546036.tar.bz2
sharkey-5a49d142464f42b87e8538579f34795d6a546036.zip
wip
Diffstat (limited to 'src')
-rw-r--r--src/build/i18n.ts3
-rw-r--r--src/client/docs/api/gulpfile.ts4
-rw-r--r--src/client/docs/gulpfile.ts2
3 files changed, 4 insertions, 5 deletions
diff --git a/src/build/i18n.ts b/src/build/i18n.ts
index 1fb43a13c9..57d6a20fd0 100644
--- a/src/build/i18n.ts
+++ b/src/build/i18n.ts
@@ -55,8 +55,7 @@ export default class Replacer {
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;
+ const name = ctx ? ctx.src.substr(ctx.src.indexOf(client) + client.length) : null;
let key = a || b || c;
if (key[0] == '@') {
diff --git a/src/client/docs/api/gulpfile.ts b/src/client/docs/api/gulpfile.ts
index 9980ede231..31027c0be3 100644
--- a/src/client/docs/api/gulpfile.ts
+++ b/src/client/docs/api/gulpfile.ts
@@ -127,7 +127,7 @@ gulp.task('doc:api:endpoints', async () => {
return;
}
const i18n = new I18nReplacer(lang);
- html = html.replace(i18n.pattern, i18n.replacement);
+ html = html.replace(i18n.pattern, i18n.replacement.bind(null, null));
html = fa(html);
const htmlPath = `./built/client/docs/${lang}/api/endpoints/${ep.endpoint}.html`;
mkdirp(path.dirname(htmlPath), (mkdirErr) => {
@@ -171,7 +171,7 @@ gulp.task('doc:api:entities', async () => {
return;
}
const i18n = new I18nReplacer(lang);
- html = html.replace(i18n.pattern, i18n.replacement);
+ html = html.replace(i18n.pattern, i18n.replacement.bind(null, null));
html = fa(html);
const htmlPath = `./built/client/docs/${lang}/api/entities/${kebab(entity.name)}.html`;
mkdirp(path.dirname(htmlPath), (mkdirErr) => {
diff --git a/src/client/docs/gulpfile.ts b/src/client/docs/gulpfile.ts
index 56bf6188c8..5e81d6d3b5 100644
--- a/src/client/docs/gulpfile.ts
+++ b/src/client/docs/gulpfile.ts
@@ -53,7 +53,7 @@ gulp.task('doc:docs', async () => {
return;
}
const i18n = new I18nReplacer(lang);
- html = html.replace(i18n.pattern, i18n.replacement);
+ html = html.replace(i18n.pattern, i18n.replacement.bind(null, null));
html = fa(html);
const htmlPath = `./built/client/docs/${lang}/${name}.html`;
mkdirp(path.dirname(htmlPath), (mkdirErr) => {