Skip to content

i18n(ja): add guide routing - #14521

Open
Yusaku01 wants to merge 4 commits into
withastro:mainfrom
Yusaku01:i18n/ja/routing
Open

Yusaku01 wants to merge 4 commits into
withastro:mainfrom
Yusaku01:i18n/ja/routing

Conversation

@Yusaku01

@Yusaku01 Yusaku01 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

This PR is based on the following file:

https://github.com/withastro/docs/blob/main/src/content/docs/en/guides/routing.mdx

I'd appreciate it if you could review this when you have time 🫡

@Yusaku01
Yusaku01 marked this pull request as draft September 9, 2026 12:39
@astrobot-houston

astrobot-houston commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the tracking.ignoredKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
ja/basics/astro-pages.mdx Localization changed, will be marked as complete.
ja/basics/layouts.mdx Localization changed, will be marked as complete.
ja/guides/data-fetching.mdx Localization changed, will be marked as complete.
ja/guides/endpoints.mdx Localization changed, will be marked as complete.
ja/guides/middleware.mdx Localization changed, will be marked as complete.
ja/guides/migrate-to-astro/from-create-react-app.mdx Localization changed, will be marked as complete.
ja/guides/routing.mdx Localization added, will be marked as complete.
ja/guides/upgrade-to/v6.mdx Localization changed, will be marked as complete.
ja/guides/upgrade-to/v7.mdx Localization changed, will be marked as complete.
ja/reference/errors/get-static-paths-invalid-route-param.mdx Localization changed, will be marked as complete.
ja/reference/errors/get-static-paths-required.mdx Localization changed, will be marked as complete.
ja/reference/errors/no-matching-static-path-found.mdx Localization changed, will be marked as complete.
ja/tutorial/5-astro-api/2.mdx Localization changed, will be marked as complete.
ja/tutorial/5-astro-api/3.mdx Localization changed, will be marked as complete.
ja/tutorial/6-islands/4.mdx Localization changed, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@github-actions github-actions Bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@Yusaku01 Yusaku01 changed the title i18n(ja): ルーティングガイドの日本語訳を追加 i18n(ja): add guide routing Sep 10, 2026
@Yusaku01
Yusaku01 marked this pull request as ready for review September 10, 2026 14:09
@Yusaku01
Yusaku01 marked this pull request as draft September 14, 2026 13:32
@Yusaku01
Yusaku01 marked this pull request as ready for review September 18, 2026 12:26

@morinokami morinokami left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちら対応いただきありがとうございます!何点かコメントしましたので、妥当そうなものについて修正をお願いします。


<p><Since v="2.9.0" /></p>

`redirects`値を使用して、Astroの設定から永久的なリダイレクトのマッピングを指定できます。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちら英語版では redirects はリンクになっているようです:

You can specify a mapping of permanent redirects in your Astro config with the redirects value.


const { lang, version } = Astro.params;
---
...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

英語版にない「...」が入ってしまっている?

Suggested change
...


const { path } = Astro.params;
---
...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同じくです:

Suggested change
...


```astro title="src/pages/[...slug].astro"
---
export async function getStaticPaths() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これも細かいのですが英語版では async は付いていないようです:

Suggested change
export async function getStaticPaths() {
export function getStaticPaths() {

{
slug: undefined,
title: "Astroストア",
text: "Astroにようこそ!",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文では「Welcome to the Astro store!」なので、「ストア」が抜けてしまっているようです:

Suggested change
text: "Astroにようこそ!",
text: "Astroストアにようこそ!",

{
slug: undefined,
title: "Astroストア",
text: "Astroにようこそ!",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同じく:

Suggested change
text: "Astroにようこそ!",
text: "Astroストアにようこそ!",

Comment on lines +359 to +371
意図的にリライトを使って`/404`ページをレンダリングすることもできます。例えば、eコマースショップの商品が利用できなくなったことを示す場合、以下のようにHTTPレスポンスステータスに基づいて条件付きでリライトできます。

```astro title="src/pages/[item].astro"
---
const { item } = Astro.params;

if (!itemExists(item)) {
return Astro.rewrite("/404");
}
---
```

また、例えば存在しないURLにアクセスした際にサイトの特定のページを表示する場合は、以下のようにパスを指定できます。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L359 と L371 の原文はそれぞれ

You can intentionally create a rewrite to render your /404 page, for example to indicate that a product in your e-commerce shop is no longer available:

You can also conditionally rewrite based on an HTTP response status, for example to display a certain page on your site when visiting a URL that doesn't exist:

なのですが、後者の内容である「HTTPレスポンスステータスに基づいて条件付きでリライト」が前者の訳に含まれてしまっているようでした。こちら確認の上修正をお願いできますか 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants