Skip to content

Commit 304ddd2

Browse files
authored
Merge pull request #2843 from tats-u/deprecate-jp
Deprecate "jp"
2 parents 70f5f75 + f3ddd55 commit 304ddd2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/lib/application.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,22 @@ export class Application extends AbstractComponent<
290290
if (!this.internationalization.hasTranslations(this.lang)) {
291291
// Not internationalized as by definition we don't know what to include here.
292292
this.logger.warn(
293-
`Options specified "${this.lang}" as the language to use, but TypeDoc does not support it.` as TranslatedString,
293+
`Options specified "${this.lang}" as the language to use, but TypeDoc cannot provide translations for it.` as TranslatedString,
294294
);
295295
this.logger.info(
296-
("The supported languages are:\n\t" +
296+
("The languages that translations are available for are:\n\t" +
297297
this.internationalization
298298
.getSupportedLanguages()
299299
.join("\n\t")) as TranslatedString,
300300
);
301301
this.logger.info(
302302
"You can define/override local locales with the `locales` option, or contribute them to TypeDoc!" as TranslatedString,
303303
);
304+
} else if (this.lang === "jp") {
305+
this.logger.warn(
306+
// Only Japanese see this. Meaning: "jp" is going to be removed in the future. Please designate "ja" instead.
307+
"「jp」は将来削除されます。代わりに「ja」を指定してください。" as TranslatedString,
308+
);
304309
}
305310

306311
if (

src/lib/internationalization/internationalization.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ export class Internationalization {
302302
*/
303303
getSupportedLanguages(): string[] {
304304
return unique([
305-
...readdirSync(
306-
join(fileURLToPath(import.meta.url), "../locales"),
307-
).map((x) => x.substring(0, x.indexOf("."))),
305+
...readdirSync(join(fileURLToPath(import.meta.url), "../locales"))
306+
.map((x) => x.substring(0, x.indexOf(".")))
307+
.filter((x) => x !== "jp"),
308308
...this.allTranslations.keys(),
309309
]).sort();
310310
}

0 commit comments

Comments
 (0)