Files
hextra_mirror/exampleSite/content/docs/advanced/multi-language.ja.md
Xin ec007d73c0 docs(blog): prepare for v0.10 release post (#746)
* docs(blog): prepare for v0.10 release post

* Update v0.10.md

* Update v0.10.md to refine upgrade instructions and enhance blog features. Added synchronized tab switching and pagination controls, while improving the search experience and table of contents navigation.

* Enhance v0.10 release documentation with detailed upgrade instructions and migration guide. Added Tailwind theme variable customization section and clarified breaking changes. Improved clarity on CSS class prefix changes for better user experience.

* Update v0.10.md to enhance upgrade instructions, clarify breaking changes, and improve overall readability. Adjusted formatting for consistency and added details on asset management and user experience improvements.

* Add notable new features to v0.10.md, including dropdown menu support, enhanced search experience, and blog list pagination. Updated FlexSearch upgrade details for clarity and improved migration guide by removing redundant breaking change notes.

* chore: update zh-cn translation

* chore: update ja translation

* chore: update fa and ja translations

* chore: prepare release
2025-08-14 23:49:06 +08:00

2.7 KiB

title, weight, prev
title weight prev
多言語対応 1 /docs/advanced

Hextra は Hugo の 多言語モード を使用して、複数言語のサイトを作成することをサポートしています。

多言語対応を有効にする

サイトを多言語対応にするには、Hugo にサポートする言語を伝える必要があります。サイト設定ファイルに以下を追加します:

defaultContentLanguage: en
languages:
  en:
    languageName: English
    weight: 1
  fr:
    languageName: Français
    weight: 2
  ja:
    languageName: 日本語
    weight: 3

ファイル名による翻訳管理

Hugo はファイル名による翻訳管理をサポートしています。例えば、英語のファイル content/docs/_index.md がある場合、フランス語の翻訳用に content/docs/_index.fr.md というファイルを作成できます。

{{< filetree/container >}} {{< filetree/folder name="content" >}} {{< filetree/folder name="docs" state="open" >}} {{< filetree/file name="_index.md" >}} {{< filetree/file name="_index.fr.md" >}} {{< filetree/file name="_index.ja.md" >}} {{< /filetree/folder >}} {{< /filetree/folder >}} {{< /filetree/container >}}

注: Hugo は コンテンツディレクトリによる翻訳 もサポートしています。

メニュー項目の翻訳

ナビゲーションバーのメニュー項目を翻訳するには、identifier フィールドを設定する必要があります:

menu:
  main:
    - identifier: documentation
      name: Documentation
      pageRef: /docs
      weight: 1
    - identifier: blog
      name: Blog
      pageRef: /blog
      weight: 2

そして、対応する i18n ファイルで翻訳します:

documentation: Documentation
blog: Blog

文字列の翻訳

他の場所の文字列を翻訳するには、対応する i18n ファイルに翻訳を追加する必要があります:

readMore: Lire la suite

テーマで使用される文字列の一覧は i18n/en.yaml ファイルで確認できます。

さらに詳しく