Skip to content

Commit

Permalink
Merge pull request #44869 from dipesh-rawat/sort-language-dropdown
Browse files Browse the repository at this point in the history
Enhance language dropdown ordering
  • Loading branch information
k8s-ci-robot authored Jan 26, 2024
2 parents 54145dd + a1d4ec4 commit cb2f55e
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 93 deletions.
7 changes: 5 additions & 2 deletions content/en/docs/contribute/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,11 @@ script and use it in the theme. Assign "language name in latin script" to
`languageNameLatinScript`. For example, `languageNameLatinScript ="Korean"` or
`languageNameLatinScript = "Deutsch"`.

When assigning a `weight` parameter for your block, find the language block with
the highest weight and add 1 to that value.
The `weight` parameter determines the order of languages in the language selection bar.
A lower weight takes precedence, resulting in the language appearing first.
When assigning the `weight` parameter, it is important to examine the existing languages
block and adjust their weights to ensure they are in a sorted order relative to all languages,
including any newly added language.

For more information about Hugo's multilingual support, see
"[Multilingual Mode](https://gohugo.io/content-management/multilingual/)".
Expand Down
184 changes: 93 additions & 91 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -318,50 +318,66 @@ language_alternatives = ["en"]
languageNameLatinScript = "Chinese"
description = "生产级别的容器编排系统"

[languages.ko]
[languages.fr]
title = "Kubernetes"
languageName = "한국어 (Korean)"
languageName = "Français (French)"
weight = 3
contentDir = "content/ko"
contentDir = "content/fr"
languagedirection = "ltr"

[languages.ko.params]
time_format_blog = "2006.01.02"
[languages.fr.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
description = "운영 수준의 컨테이너 오케스트레이션"
languageNameLatinScript = "Korean"
description = "Solution professionnelle d’orchestration de conteneurs"
languageNameLatinScript = "Français"

[languages.ja]
[languages.de]
title = "Kubernetes"
languageName = "日本語 (Japanese)"
languageName = "Deutsch (German)"
weight = 4
contentDir = "content/ja"
contentDir = "content/de"
languagedirection = "ltr"

[languages.ja.params]
time_format_blog = "2006.01.02"
[languages.de.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
languageNameLatinScript = "Japanese"
description = "プロダクショングレードのコンテナ管理基盤"
description = "Produktionsreife Container-Orchestrierung"
languageNameLatinScript = "Deutsch"

[languages.fr]
[languages.hi]
title = "Kubernetes"
languageName = "Français (French)"
languageName = "हिन्दी (Hindi)"
weight = 5
contentDir = "content/fr"
contentDir = "content/hi"
languagedirection = "ltr"

[languages.fr.params]
[languages.hi.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
description = "Solution professionnelle d’orchestration de conteneurs"
languageNameLatinScript = "Français"
description = "प्रोडक्शन-ग्रेड कंटेनर ऑर्केस्ट्रेशन"
languageNameLatinScript = "Hindi"

[languages.id]
title = "Kubernetes"
languageName ="Bahasa Indonesia (Indonesian)"
weight = 6
contentDir = "content/id"
languagedirection = "ltr"

[languages.id.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
description = "Orkestrasi Kontainer dengan Skala Produksi"
languageNameLatinScript = "Bahasa Indonesia"

[languages.it]
title = "Kubernetes"
languageName = "Italiano (Italian)"
weight = 6
weight = 7
contentDir = "content/it"
languagedirection = "ltr"

Expand All @@ -372,6 +388,27 @@ language_alternatives = ["en"]
description = "Orchestrazione di Container in produzione"
languageNameLatinScript = "Italiano"

[languages.ja]
title = "Kubernetes"
languageName = "日本語 (Japanese)"
weight = 8
contentDir = "content/ja"
languagedirection = "ltr"

[languages.ja.params]
time_format_blog = "2006.01.02"
language_alternatives = ["en"]
languageNameLatinScript = "Japanese"
description = "プロダクショングレードのコンテナ管理基盤"

[languages.ko]
title = "Kubernetes"
languageName = "한국어 (Korean)"
weight = 9
contentDir = "content/ko"
languagedirection = "ltr"

# 'Norsk (Norwegian)' language is disabled via 'disableLanguages' config.
[languages.no]
title = "Kubernetes"
languageName = "Norsk (Norwegian)"
Expand All @@ -386,38 +423,30 @@ language_alternatives = ["en"]
description = "Production-Grade Container Orchestration"
languageNameLatinScript = "Norsk"

[languages.de]
title = "Kubernetes"
languageName = "Deutsch (German)"
weight = 8
contentDir = "content/de"
languagedirection = "ltr"

[languages.de.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
[languages.ko.params]
time_format_blog = "2006.01.02"
language_alternatives = ["en"]
description = "Produktionsreife Container-Orchestrierung"
languageNameLatinScript = "Deutsch"
description = "운영 수준의 컨테이너 오케스트레이션"
languageNameLatinScript = "Korean"

[languages.es]
[languages.pl]
title = "Kubernetes"
languageName = "Español (Spanish)"
weight = 9
contentDir = "content/es"
languageName = "Polski (Polish)"
weight = 10
contentDir = "content/pl"
languagedirection = "ltr"

[languages.es.params]
time_format_blog = "02.01.2006"
[languages.pl.params]
time_format_blog = "01.02.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
description = "Orquestación de contenedores para producción"
languageNameLatinScript = "Español"
description = "Produkcyjny system zarządzania kontenerami"
languageNameLatinScript = "Polski"

[languages.pt-br]
title = "Kubernetes"
languageName = "Português (Portuguese)"
weight = 10
weight = 11

contentDir = "content/pt-br"
languagedirection = "ltr"
Expand All @@ -429,49 +458,10 @@ language_alternatives = ["en"]
description = "Orquestração de contêineres em nível de produção"
languageNameLatinScript = "Português"

[languages.id]
title = "Kubernetes"
languageName ="Bahasa Indonesia"
weight = 11
contentDir = "content/id"
languagedirection = "ltr"

[languages.id.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
description = "Orkestrasi Kontainer dengan Skala Produksi"
languageNameLatinScript = "Bahasa Indonesia"

[languages.hi]
title = "Kubernetes"
languageName = "हिन्दी (Hindi)"
weight = 12
contentDir = "content/hi"
languagedirection = "ltr"

[languages.hi.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
description = "प्रोडक्शन-ग्रेड कंटेनर ऑर्केस्ट्रेशन"
languageNameLatinScript = "Hindi"

[languages.vi]
title = "Kubernetes"
languageName = "Tiếng Việt (Vietnamese)"
contentDir = "content/vi"
weight = 13
languagedirection = "ltr"

[languages.vi.params]
languageNameLatinScript = "Tiếng Việt"
description = "Giải pháp điều phối container trong môi trường production"

[languages.ru]
title = "Kubernetes"
languageName = "Русский (Russian)"
weight = 14
weight = 12
contentDir = "content/ru"
languagedirection = "ltr"

Expand All @@ -482,24 +472,24 @@ language_alternatives = ["en"]
description = "Первоклассная оркестрация контейнеров"
languageNameLatinScript = "Russian"

[languages.pl]
[languages.es]
title = "Kubernetes"
languageName = "Polski (Polish)"
weight = 15
contentDir = "content/pl"
languageName = "Español (Spanish)"
weight = 13
contentDir = "content/es"
languagedirection = "ltr"

[languages.pl.params]
time_format_blog = "01.02.2006"
[languages.es.params]
time_format_blog = "02.01.2006"
# A list of language codes to look for untranslated content, ordered from left to right.
language_alternatives = ["en"]
description = "Produkcyjny system zarządzania kontenerami"
languageNameLatinScript = "Polski"
description = "Orquestación de contenedores para producción"
languageNameLatinScript = "Español"

[languages.uk]
title = "Kubernetes"
languageName = "Українська (Ukrainian)"
weight = 16
weight = 14
contentDir = "content/uk"
languagedirection = "ltr"

Expand All @@ -509,3 +499,15 @@ time_format_blog = "02.01.2006"
language_alternatives = ["en"]
description = "Довершена система оркестрації контейнерів"
languageNameLatinScript = "Ukrainian"

[languages.vi]
title = "Kubernetes"
languageName = "Tiếng Việt (Vietnamese)"
contentDir = "content/vi"
weight = 15
languagedirection = "ltr"

[languages.vi.params]
languageNameLatinScript = "Tiếng Việt"
description = "Giải pháp điều phối container trong môi trường production"

0 comments on commit cb2f55e

Please sign in to comment.