Repository navigation
nuxt-i18nを使って多言語に対応する - #299
Merged
Merged
Conversation
yuiseki
marked this pull request as ready for review
February 20, 2021 09:22
Member
|
ありがとうございます!多言語化いいですね |
yuiseki
added a commit
to yuiseki/mapprint
that referenced
this pull request
Jul 30, 2026
nuxt-i18n v6 の既定は全ルートで振り分けるため、日本語端末で /en/ を開くと 日本語になっていた。i18n を導入した codeforjapan#299 の受け入れ条件に反する。 redirectOn: 'root' にすると / の自動振り分けは残り、明示の接頭辞は尊重される。
This was referenced Jul 30, 2026
yuiseki
added a commit
that referenced
this pull request
Jul 31, 2026
nuxt-i18n v6 の既定は全ルートで振り分けるため、日本語端末で /en/ を開くと 日本語になっていた。i18n を導入した #299 の受け入れ条件に反する。 redirectOn: 'root' にすると / の自動振り分けは残り、明示の接頭辞は尊重される。
NEKOYASAN
added a commit
that referenced
this pull request
Jul 31, 2026
* feat: Nuxt 2 から Nuxt 4 へ移行する pug と Options API は維持し、動かなくなったものだけを置き換えた。 srcDir: "." で既存のディレクトリ構造を保っているのでファイル移動は無い。 jest→vitest、nuxt-i18n→@nuxtjs/i18n、require→import、Node 20→24。 * fix: Nuxt 4 移行の残件を修正する static/→public/、layouts/error.vue→error.vue、app.vue追加、pages/map/_map.vue→[map].vue。 Vue 3 で挙動が変わる箇所を修正: 同一要素のv-for+v-if、配列watcherにdeepが必要、 $i18n.locale/localesがref、head()はuseHeadへ。SSR不可のimportはクライアント動的import。 lib/mapConfigs.ts と KML の回帰テストを追加。 * fix: <i18n> を <i18n-t> にして「このサイトについて」の本文を復活させる vue-i18n 9 でコンポーネント名と prop 名が変わり、旧名のままだと 未知のコンポーネント扱いで本文が丸ごと消えていた。例外は出ない。 * fix: トップページの head() を useHead に移してタイトルを直す defineNuxtComponent の head() は setup 時点で評価されるため this.locale が undefined になり、日本語でも常に "KamiMap" になっていた。 * fix: gridlex のブレークポイントを昇順にしてPCで3列に戻す min-width のメディアクエリはソース順に出るため降順だと xs が lg より後勝ちし、 col-12_xs-6_lg-4 が PC で2列になっていた。Nuxt 2 のビルドはメディアクエリを 昇順にまとめ直していたため症状が出ていなかった。 * test: トップページのタイトル判定を関数に切り出して分岐を固定する 翻訳のあるロケールと固定文へのフォールバックを両方テストする。 useHead が locale を見られているかは index.head.spec で見る。 * fix(i18n): ブラウザ言語の振り分けをルートだけに限る nuxt-i18n v6 の既定は全ルートで振り分けるため、日本語端末で /en/ を開くと 日本語になっていた。i18n を導入した #299 の受け入れ条件に反する。 redirectOn: 'root' にすると / の自動振り分けは残り、明示の接頭辞は尊重される。 * fix: マーカーと吹き出しの対応を添字ではなく鍵で引く Vue 3 は v-for の template ref の順序を保証しないため、表示範囲が変わって DOM が再利用されると別の地点の吹き出しが付いていた。 併せて、残ったマーカーの番号が古いままだったのを書き換えるようにした。 * fix: 背景画像のパスを Vite が解決できる相対パスにする ~assets は webpack のエイリアスで、Vite では未解決のまま残り画像が出力されない。 * fix(ci): gh-pages の公開先を .output/public にして node 指定を .node-version に揃える
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
/en/というprefixを付けたら英語にするこのPRでやっていないこと
/en/map/:mapidの完全な英語化動作確認範囲
/map/:mapidになっていること/en/map/:mapidになっていることスクリーンショット