Add new locale picker and related improvements

Closes: #583
This commit is contained in:
James Panther
2023-09-12 09:22:49 +10:00
parent 1e90d7f077
commit ad8a1b0390
31 changed files with 255 additions and 107 deletions
@@ -89,14 +89,12 @@ Congoは現在、以下の言語に対応しています:
<!-- prettier-ignore-start -->
|Name|Default|Description|
|---|---|---|
|`languageCode`|`"en"`|このファイルの言語コード。トップレベル言語 (例 `en`)またはサブ変数 (例 `en-au`)で、ファイル名の `[language-code]` と一致する必要があります。Hugoはこの値が常に小文字であることを期待しています。HTMLに正しく準拠するためには、大文字と小文字を区別する `params.isoCode` パラメーターを設定してください。|
|`languageCode`|`"en"`|このファイルの言語コード。トップレベル言語 (例 `en`)またはサブ変数 (例 `en-AU`)で、ファイル名の `[language-code]` と一致する必要があります。|
|`languageName`|`"English"`|言語名。|
|`languageDirection`|`"ltr"`|RTL言語かどうか。 `"rtl"` に設定すると、コンテンツを右から左にリフローする。CongoはRTL言語とLTR言語の同時使用を完全にサポートしており、動的に両方の言語に調整します。|
|`weight`|`1`|多言語サイトを構築する際の優先順序。|
|`title`|`"Congo"`|ウェブサイトのタイトル。サイトのヘッダーとフッターに表示されます。|
|`copyright`|_Not set_|サイトのフッターに表示する著作権メッセージを含むMarkdown文字列。何も指定されない場合、Congoは `title` を使って自動的にコピーライト文字列を生成します。|
|`params.isoCode`|`"en"`|HTMLメタデータ用のISO言語コード。トップレベル言語 (例 `en`)またはサブバリアント (例 `en-AU`)です。|
|`params.displayName`|`"EN"`|ウェブサイトに表示される際に使用される言語名。|
|`params.rtl`|`false`|RTL言語かどうか。 `true` に設定すると、コンテンツを右から左にリフローする。CongoはRTL言語とLTR言語の同時使用を完全にサポートしており、動的に両方の言語に調整します。|
|`params.dateFormat`|`"2 January 2006"`|日付の書式。許容される書式については、[Hugo docs](https://gohugo.io/functions/format/#gos-layout-string)を参照してください。|
|`params.mainSections`|_Not set_|最近の記事リストに表示するセクション。指定されていない場合は、記事の数が最も多いセクションが使われます。|
|`params.description`|_Not set_|ウェブサイトの説明。これはサイトのメタデータに使用されます。|
@@ -89,14 +89,12 @@ The default file can be used as a template to create additional languages, or re
<!-- prettier-ignore-start -->
|Name|Default|Description|
|---|---|---|
|`languageCode`|`"en"`|The Hugo language code for this file. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-au`) and should match the language code in the filename. Hugo expects this value to always be in lowercase. For proper HTML compliance, set the `params.isoCode` parameter which is case-sensitive.|
|`languageCode`|`"en"`|The Hugo language code for this file. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-AU`) and should match the language code in the filename.|
|`languageName`|`"English"`|The name of the language.|
|`languageDirection`|`"ltr"`|Whether or not this is an RTL language. Set to `"rtl"` to reflow content from right-to-left. Congo fully supports using RTL and LTR languages at the same time and will dynamically adjust to both.|
|`weight`|`1`|The weight determines the order of languages when building multilingual sites.|
|`title`|`"Congo"`|The title of the website. This will be displayed in the site header and footer.|
|`copyright`|_Not set_|A Markdown string containing the copyright message to be displayed in the site footer. If none is provided, Congo will automatically generate a copyright string using the site `title`.|
|`params.isoCode`|`"en"`|The ISO language code for HTML metadata purposes. It can be a top-level language (ie. `en`) or a sub-variant (ie. `en-AU`).|
|`params.displayName`|`"EN"`|The name used when the language appears on the website.|
|`params.rtl`|`false`|Whether or not this is a RTL language. Set to `true` to reflow content from right-to-left. Congo fully supports using RTL and LTR languages at the same time and will dynamically adjust to both.|
|`params.dateFormat`|`"2 January 2006"`|How dates are formatted in this language. Refer to the [Hugo docs](https://gohugo.io/functions/format/#gos-layout-string) for acceptable formats.|
|`params.mainSections`|_Not set_|The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used.|
|`params.description`|_Not set_|The website description. This will be used in the site metadata.|
@@ -231,9 +231,10 @@ Further customisation can be achieved through the use of special theme parameter
There is a special case for creating menu items for links that take theme actions. These are denoted using the `action` parameter, and a value of the action the link should perform. Action links allow for all the same custom parameters as other links and can be styled with an icon or text name.
There are two valid theme actions:
There are three valid theme actions:
- `appearance` will create a link to the appearance switcher
- `locale` will create a drop down picker to access translated content
- `search` will create a link to the site search
Both menus are completely optional and can be commented out if not required. Use the template provided in the default file as a guide.
@@ -23,6 +23,8 @@ Die vollständige Liste der integrierten Icons und ihre entsprechenden Namen fin
| blogger | {{< icon blogger >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
| chevron-up | {{< icon chevron-up >}} |
| circle-info | {{< icon circle-info >}} |
| codepen | {{< icon codepen >}} |
| comment | {{< icon comment >}} |
@@ -35,6 +37,7 @@ Die vollständige Liste der integrierten Icons und ihre entsprechenden Namen fin
| foursquare | {{< icon foursquare >}} |
| github | {{< icon github >}} |
| gitlab | {{< icon gitlab >}} |
| globe | {{< icon globe >}} |
| google | {{< icon google >}} |
| hashnode | {{< icon hashnode >}} |
| instagram | {{< icon instagram >}} |
@@ -68,10 +71,11 @@ Die vollständige Liste der integrierten Icons und ihre entsprechenden Namen fin
| tag | {{< icon tag >}} |
| telegram | {{< icon telegram >}} |
| tiktok | {{< icon tiktok >}} |
| translate | {{< icon translate >}} |
| triangle-exclamation | {{< icon triangle-exclamation >}} |
| tumblr | {{< icon tumblr >}} |
| twitch | {{< icon twitch >}} |
| twitter | {{< icon twitter >}} |
| whatsapp | {{< icon whatsapp >}} |
| xmark | {{< icon xmark >}} |
| youtube | {{< icon youtube >}} |
| youtube | {{< icon youtube >}} |
@@ -23,6 +23,8 @@ La lista completa de íconos incorporados y sus nombres correspondientes se pued
| blogger | {{< icon blogger >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
| chevron-up | {{< icon chevron-up >}} |
| circle-info | {{< icon circle-info >}} |
| codepen | {{< icon codepen >}} |
| comment | {{< icon comment >}} |
@@ -35,6 +37,7 @@ La lista completa de íconos incorporados y sus nombres correspondientes se pued
| foursquare | {{< icon foursquare >}} |
| github | {{< icon github >}} |
| gitlab | {{< icon gitlab >}} |
| globe | {{< icon globe >}} |
| google | {{< icon google >}} |
| hashnode | {{< icon hashnode >}} |
| instagram | {{< icon instagram >}} |
@@ -68,10 +71,11 @@ La lista completa de íconos incorporados y sus nombres correspondientes se pued
| tag | {{< icon tag >}} |
| telegram | {{< icon telegram >}} |
| tiktok | {{< icon tiktok >}} |
| translate | {{< icon translate >}} |
| triangle-exclamation | {{< icon triangle-exclamation >}} |
| tumblr | {{< icon tumblr >}} |
| twitch | {{< icon twitch >}} |
| twitter | {{< icon twitter >}} |
| whatsapp | {{< icon whatsapp >}} |
| xmark | {{< icon xmark >}} |
| youtube | {{< icon youtube >}} |
| youtube | {{< icon youtube >}} |
@@ -23,6 +23,8 @@ Congoは[FontAwesome 6](https://fontawesome.com/icons)のアイコンをサポ
| blogger | {{< icon blogger >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
| chevron-up | {{< icon chevron-up >}} |
| circle-info | {{< icon circle-info >}} |
| codepen | {{< icon codepen >}} |
| comment | {{< icon comment >}} |
@@ -35,6 +37,7 @@ Congoは[FontAwesome 6](https://fontawesome.com/icons)のアイコンをサポ
| foursquare | {{< icon foursquare >}} |
| github | {{< icon github >}} |
| gitlab | {{< icon gitlab >}} |
| globe | {{< icon globe >}} |
| google | {{< icon google >}} |
| hashnode | {{< icon hashnode >}} |
| instagram | {{< icon instagram >}} |
@@ -68,6 +71,7 @@ Congoは[FontAwesome 6](https://fontawesome.com/icons)のアイコンをサポ
| tag | {{< icon tag >}} |
| telegram | {{< icon telegram >}} |
| tiktok | {{< icon tiktok >}} |
| translate | {{< icon translate >}} |
| triangle-exclamation | {{< icon triangle-exclamation >}} |
| tumblr | {{< icon tumblr >}} |
| twitch | {{< icon twitch >}} |
@@ -23,6 +23,8 @@ The full list of built-in icons and their corresponding names can referenced bel
| blogger | {{< icon blogger >}} |
| bug | {{< icon bug >}} |
| check | {{< icon check >}} |
| chevron-down | {{< icon chevron-down >}} |
| chevron-up | {{< icon chevron-up >}} |
| circle-info | {{< icon circle-info >}} |
| codepen | {{< icon codepen >}} |
| comment | {{< icon comment >}} |
@@ -35,6 +37,7 @@ The full list of built-in icons and their corresponding names can referenced bel
| foursquare | {{< icon foursquare >}} |
| github | {{< icon github >}} |
| gitlab | {{< icon gitlab >}} |
| globe | {{< icon globe >}} |
| google | {{< icon google >}} |
| hashnode | {{< icon hashnode >}} |
| instagram | {{< icon instagram >}} |
@@ -68,6 +71,7 @@ The full list of built-in icons and their corresponding names can referenced bel
| tag | {{< icon tag >}} |
| telegram | {{< icon telegram >}} |
| tiktok | {{< icon tiktok >}} |
| translate | {{< icon translate >}} |
| triangle-exclamation | {{< icon triangle-exclamation >}} |
| tumblr | {{< icon tumblr >}} |
| twitch | {{< icon twitch >}} |