Skip to content

Commit 39622e8

Browse files
committed
chore: Use jpn for Japanese
1 parent 3e1b902 commit 39622e8

File tree

15 files changed

+26
-32
lines changed

15 files changed

+26
-32
lines changed
File renamed without changes.

next.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ const withNextIntl = createNextIntlPlugin();
77
/** @type {import('next').NextConfig} */
88
const nextConfig = {
99
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
10+
11+
redirects: async () => [
12+
{
13+
source: "/ja",
14+
destination: "/jpn",
15+
permanent: true,
16+
},
17+
],
1018
};
1119

1220
export default withMDX(withNextIntl(nextConfig));

src/api/translate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function translate(
4040
const { source, target, dialect, pronoun, numReturnSequences = 1 } = params;
4141

4242
let prompt: string = "";
43-
if (source === "ja" && target === "ain") {
43+
if (source === "jpn" && target === "ain") {
4444
prompt = `translate Japanese to Ainu (${dialect}, ${pronoun}): ${input}`;
4545
} else {
4646
prompt = `translate Ainu (${dialect}, ${pronoun}) to Japanese: ${input}`;

src/app/[locale]/_server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export async function fetchTranslation(
142142
transcriptions: {},
143143
};
144144

145-
if (source === "ja") {
145+
if (source === "jpn") {
146146
result.transcriptions.translation = {
147147
type: "kana",
148148
text: to_kana(translation),
File renamed without changes.

src/app/[locale]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default async function Home(props: HomeProps) {
4747
setRequestLocale(params.locale);
4848

4949
const text = searchParams?.text;
50-
const source = searchParams?.source ?? "ja";
50+
const source = searchParams?.source ?? "jpn";
5151
const target = searchParams?.target ?? "ain";
5252
const dialect = searchParams?.dialect ?? "沙流";
5353
const pronoun = searchParams?.pronoun ?? "first";
@@ -102,7 +102,7 @@ export default async function Home(props: HomeProps) {
102102
action={`/${params.locale}`}
103103
defaultValues={{
104104
text: text ?? "",
105-
source: searchParams?.source ?? "ja",
105+
source: searchParams?.source ?? "jpn",
106106
target: searchParams?.target ?? "ain",
107107
dialect,
108108
pronoun,

src/app/sitemap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { MetadataRoute } from "next";
33
export default function sitemap(): MetadataRoute.Sitemap {
44
return [
55
{
6-
url: "https://tunci.aynu.io/ja",
6+
url: "https://tunci.aynu.io/jpn",
77
lastModified: new Date(),
88
alternates: {
99
languages: {
@@ -12,7 +12,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
1212
},
1313
},
1414
{
15-
url: "https://tunci.aynu.io/ja/about",
15+
url: "https://tunci.aynu.io/jpn/about",
1616
lastModified: new Date(),
1717
alternates: {
1818
languages: {

src/components/Composer/Composer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const Composer: FC<ComposerProps> = (props) => {
8585

8686
const handleChangeSource = (source: string): void => {
8787
setSource(source);
88-
setTarget(source === "ja" ? "ain" : "ja");
88+
setTarget(source === "jpn" ? "ain" : "jpn");
8989

9090
if (translation && textareaRef.current && !dirty) {
9191
textareaRef.current.value = translation;
@@ -95,7 +95,7 @@ export const Composer: FC<ComposerProps> = (props) => {
9595

9696
const handleChangeTarget = (target: string): void => {
9797
setTarget(target);
98-
setSource(target === "ja" ? "ain" : "ja");
98+
setSource(target === "jpn" ? "ain" : "jpn");
9999

100100
if (translation && textareaRef.current && !dirty) {
101101
textareaRef.current.value = translation;

src/components/Composer/ComposerInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ export const ComposerInput: FC<ComposerInputProps> = (props) => {
7373
const textareaLanguageRelatedAttributes: ComponentProps<
7474
typeof TextareaAutosize
7575
> = useMemo(() => {
76-
if (source === "ja") {
76+
if (source === "jpn") {
7777
return {
78-
lang: "ja",
78+
lang: "jpn",
7979
};
8080
}
8181

src/components/Composer/LanguageSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const LanguageSelector: FC<LanguageSelectorProps> = (props) => {
2828
aria-labelledby={id}
2929
onValueChange={onChange}
3030
>
31-
<SegmentedControl.Item value="ja">
31+
<SegmentedControl.Item value="jpn">
3232
{t("japanese")}
3333
</SegmentedControl.Item>
3434
<SegmentedControl.Item value="ain">{t("ainu")}</SegmentedControl.Item>

0 commit comments

Comments
 (0)