Skip to content

Commit f61b973

Browse files
committed
Deprecate "jp"
1 parent 41dea00 commit f61b973

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

src/lib/application.ts

+21-9
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,28 @@ export class Application extends AbstractComponent<
286286
if (!this.internationalization.hasTranslations(this.lang)) {
287287
// Not internationalized as by definition we don't know what to include here.
288288
this.logger.warn(
289-
`Options specified "${this.lang}" as the language to use, but TypeDoc does not support it.` as TranslatedString,
289+
`Options specified "${this.lang}" as the language to use, but TypeDoc cannot provide translations for it.` as TranslatedString,
290290
);
291-
this.logger.info(
292-
("The supported languages are:\n\t" +
293-
this.internationalization
294-
.getSupportedLanguages()
295-
.join("\n\t")) as TranslatedString,
296-
);
297-
this.logger.info(
298-
"You can define/override local locales with the `locales` option, or contribute them to TypeDoc!" as TranslatedString,
291+
if (this.lang !== "jp") {
292+
this.logger.info(
293+
("The languages that translations are available for are:\n\t" +
294+
this.internationalization
295+
.getSupportedLanguages()
296+
.join("\n\t")) as TranslatedString,
297+
);
298+
this.logger.info(
299+
"You can define/override local locales with the `locales` option, or contribute them to TypeDoc!" as TranslatedString,
300+
);
301+
} else {
302+
this.logger.info(
303+
// Only Japanese see this. Meaning: "jp" has been removed. Please designate "ja" (instead).
304+
"「jp」は削除されました。「ja」を指定してください。" as TranslatedString,
305+
);
306+
}
307+
} else if (this.lang === "jp") {
308+
this.logger.warn(
309+
// Only Japanese see this. Meaning: "jp" is going to be removed in the future. Please designate "ja" instead.
310+
"「jp」は将来削除されます。代わりに「ja」を指定してください。" as TranslatedString,
299311
);
300312
}
301313

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)