Skip to content

Deprecate "jp" #2843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,22 @@ export class Application extends AbstractComponent<
if (!this.internationalization.hasTranslations(this.lang)) {
// Not internationalized as by definition we don't know what to include here.
this.logger.warn(
`Options specified "${this.lang}" as the language to use, but TypeDoc does not support it.` as TranslatedString,
`Options specified "${this.lang}" as the language to use, but TypeDoc cannot provide translations for it.` as TranslatedString,
);
this.logger.info(
("The supported languages are:\n\t" +
("The languages that translations are available for are:\n\t" +
this.internationalization
.getSupportedLanguages()
.join("\n\t")) as TranslatedString,
);
this.logger.info(
"You can define/override local locales with the `locales` option, or contribute them to TypeDoc!" as TranslatedString,
);
} else if (this.lang === "jp") {
this.logger.warn(
// Only Japanese see this. Meaning: "jp" is going to be removed in the future. Please designate "ja" instead.
"「jp」は将来削除されます。代わりに「ja」を指定してください。" as TranslatedString,
);
}

if (
Expand Down
6 changes: 3 additions & 3 deletions src/lib/internationalization/internationalization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ export class Internationalization {
*/
getSupportedLanguages(): string[] {
return unique([
...readdirSync(
join(fileURLToPath(import.meta.url), "../locales"),
).map((x) => x.substring(0, x.indexOf("."))),
...readdirSync(join(fileURLToPath(import.meta.url), "../locales"))
.map((x) => x.substring(0, x.indexOf(".")))
.filter((x) => x !== "jp"),
...this.allTranslations.keys(),
]).sort();
}
Expand Down