Skip to content

Commit 1aa8acc

Browse files
authored
Merge pull request #2701 from palark/reorder-lang-menu
Sorting existing languages in the menu
2 parents 6065a0d + 739132a commit 1aa8acc

File tree

2 files changed

+74
-69
lines changed

2 files changed

+74
-69
lines changed

LOCALIZATION.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,31 @@ Open a PR with the localization initiation following this example: https://githu
5757

5858
To add a new language to the site, modify [config.toml](https://github.com/cncf/glossary/blob/main/config.toml#L54) (Note: localization teams should use their assigned development branch for this).
5959

60-
The `[languages]` block of `config.toml` is used to set the language. For instance, `[languages.en]` stands for English and `[languages.ko]` for Korean language configuration. Go to the `[languages]` block in `config.toml` and add a new block for your language-specific configuration. For instance, the Korean localization team added its `[languages.ko]` block after the `[languages.en]` block.
60+
The `[languages]` block of `config.toml` is used to set the language. For instance, `[languages.en]` stands for English and `[languages.ko]` for Korean language configuration. Go to the `[languages]` block in `config.toml` and find a place for your new localization:
61+
62+
- The English language always stays first.
63+
- Other languages are sorted based on the alphabetized English translation of their names (see how currently existing localizations are ordered as an example).
64+
- Each localization is written in its own language followed by the English translation in parentheses — e.g., `한국어 (Korean)`.
65+
- The `weight` parameter in the config is used for sorting (`1` is for English, `2` is for the alphabetically first language, `3` is for the second one, and so on).
66+
67+
For instance, you're adding a new block for the Korean localization. You calculated its weight as 8. Find the language block with `weight = 7` and add your new block afterwards:
6168

6269
- Example of `New language block for /config.toml`
6370
```diff
6471
[languages]
65-
[languages.en]
66-
title = "Cloud Native Glossary"
67-
description = "The CNCF Cloud Native Glossary Project is intended to be used as a reference for common terms used when talking about cloud native applications."
68-
languageName ="English"
69-
# Weight used for sorting.
70-
weight = 1
72+
...
73+
weight = 7
7174

7275
+[languages.ko]
7376
+title = "클라우드 네이티브(Cloud Native) 용어집"
7477
+description = "CNCF 클라우드 네이티브 용어집 프로젝트는 클라우드 네이티브 애플리케이션에 대한 대화를 나눌 때 공통의 용어를 참조하여 사용하도록 하는 목적을 가지고 있다."
75-
+languageName ="한국어(Korean)"
78+
+languageName = "한국어 (Korean)"
7679
+contentDir = "content/ko"
77-
+weight = 2
80+
+weight = 8
7881
```
7982

83+
Since the `weight` values should always be kept consistent, please **remember to increment the weights** of all the languages following your newly added localization.
84+
8085
#### 3-2. Adding a file for site strings
8186

8287
`i18n/<localization>.toml` sets up language-specific site strings.

config.toml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -68,85 +68,85 @@ description = "The CNCF Cloud Native Glossary Project is intended to be used as
6868
#time_format_default = "02.01.2006"
6969
#time_format_blog = "02.01.2006"
7070

71+
[languages.bn]
72+
contentDir = "content/bn"
73+
languageName = "বাংলা (Bengali)"
74+
title = "ক্লাউড নেটিভ শব্দকোষ"
75+
weight = 2
76+
[languages.bn.params]
77+
description = "CNCF ক্লাউড নেটিভ শব্দকোষ প্রকল্পটি ক্লাউড নেটিভ অ্যাপ্লিকেশন সম্পর্কে কথা বলার সময় ব্যবহৃত সাধারণ পদগুলির জন্য একটি রেফারেন্স হিসাবে ব্যবহার করার উদ্দেশ্যে।"
78+
79+
[languages.fr]
80+
contentDir = "content/fr"
81+
languageName = "Français (French)"
82+
title = "Glossaire Cloud Native"
83+
weight = 3
84+
[languages.fr.params]
85+
description = "Le projet de Glossaire CNCF Cloud Native a pour objectif de référencer les termes courants utilisés dans les différentes applications Cloud Natives."
86+
87+
[languages.de]
88+
contentDir = "content/de"
89+
languageName = "Deutsch (German)"
90+
title = "Cloud Native Glossar"
91+
weight = 4
92+
[languages.de.params]
93+
description = "Das CNCF Cloud Native Glossar soll als Referenz für gängige Begriffe dienen, die im Zusammenhang mit Cloud Native Anwendungen verwendet werden."
94+
7195
[languages.hi]
7296
contentDir = "content/hi"
7397
languageName = "हिन्दी (Hindi)"
7498
title = "क्लाउड नेटिव शब्दावली"
75-
weight = 2
99+
weight = 5
76100
[languages.hi.params]
77101
description = "CNCF क्लाउड नेटिव शब्दावली परियोजना का उद्देश्य क्लाउड नेटिव एप्लिकेशन के बारे में बात करते समय प्रयोग किए जाने वाले सामान्य शब्दों के संदर्भ के रूप में उपयोग किया जाना है।"
78102

79-
[languages.pt-br]
80-
contentDir = "content/pt-br"
81-
languageName = "Português"
82-
title = "Glossário Cloud Native"
83-
weight = 3
84-
[languages.pt-br.params]
85-
description = "O Projeto CNCF Glossário Cloud Native se destina a ser usado como uma referência para termos comuns usados ao falar sobre aplicações nativas de nuvem."
86-
87103
[languages.it]
88104
contentDir = "content/it"
89-
languageName = "Italiano"
105+
languageName = "Italiano (Italian)"
90106
title = "Glossario Cloud Native"
91-
weight = 4
107+
weight = 6
92108
[languages.it.params]
93109
description = "Il progetto del Glossario CNCF Cloud Native è pensato per essere un riferimento per i termini comuni, usati nell'ambito delle applicazioni cloud native."
94110

111+
[languages.ja]
112+
contentDir = "content/ja"
113+
languageName = "日本語 (Japanese)"
114+
title = "クラウドネイティブ用語集"
115+
weight = 7
116+
[languages.ja.params]
117+
description = "CNCF クラウドネイティブ用語集プロジェクトは、クラウドネイティブアプリケーションについて話すときに使われる一般的な用語のリファレンスとして使用することを目的としています。"
118+
95119
[languages.ko]
96120
contentDir = "content/ko"
97121
languageName = "한국어 (Korean)"
98122
title = "클라우드 네이티브(Cloud Native) 용어집"
99-
weight = 5
123+
weight = 8
100124
[languages.ko.params]
101125
description = "CNCF 클라우드 네이티브 용어집 프로젝트는 클라우드 네이티브 애플리케이션을 주제로 대화를 나눌 때 참조할 수 있는 공통의 용어 제공을 목표로 한다."
102126

103-
[languages.es]
104-
contentDir = "content/es"
105-
languageName = "Español (Spanish)"
106-
title = "Cloud Native Glosario"
107-
weight = 6
108-
[languages.es.params]
109-
description = "El proyecto de CNCF Cloud Native Glosario pretende ser usado como una referencia para los terminos comunes usados cuando se habla acerca de las aplicaciones nativas para la nube."
127+
[languages.pt-br]
128+
contentDir = "content/pt-br"
129+
languageName = "Português (Portuguese)"
130+
title = "Glossário Cloud Native"
131+
weight = 9
132+
[languages.pt-br.params]
133+
description = "O Projeto CNCF Glossário Cloud Native se destina a ser usado como uma referência para termos comuns usados ao falar sobre aplicações nativas de nuvem."
110134

111135
[languages.zh-cn]
112136
contentDir = "content/zh-cn"
113137
languageName = "简体中文 (Simplified Chinese)"
114138
title = "Cloud Native(云原生) Glossary"
115-
weight = 7
139+
weight = 10
116140
[languages.zh-cn.params]
117141
description = "CNCF 云原生 Glossary 项目旨在用作讨论云原生应用程序时常用术语的参考"
118142

119-
[languages.bn]
120-
contentDir = "content/bn"
121-
languageName = "বাংলা (Bengali)"
122-
title = "ক্লাউড নেটিভ শব্দকোষ"
123-
weight = 8
124-
[languages.bn.params]
125-
description = "CNCF ক্লাউড নেটিভ শব্দকোষ প্রকল্পটি ক্লাউড নেটিভ অ্যাপ্লিকেশন সম্পর্কে কথা বলার সময় ব্যবহৃত সাধারণ পদগুলির জন্য একটি রেফারেন্স হিসাবে ব্যবহার করার উদ্দেশ্যে।"
126-
127-
[languages.de]
128-
contentDir = "content/de"
129-
languageName = "Deutsch"
130-
title = "Cloud Native Glossar"
131-
weight = 9
132-
[languages.de.params]
133-
description = "Das CNCF Cloud Native Glossar soll als Referenz für gängige Begriffe dienen, die im Zusammenhang mit Cloud Native Anwendungen verwendet werden."
134-
135-
[languages.ur]
136-
contentDir = "content/ur"
137-
languageName = "اردو (Urdu)"
138-
title = "کلاؤڈ کی مقامی لغت"
139-
weight = 10
140-
[languages.ur.params]
141-
description = "CNCF کلاؤڈ کی مقامی لغت کا مقصد کلاؤڈ مقامی ایپلی کیشنز کے بارے میں بات کرتے وقت استعمال ہونے والی عام اصطلاحات کے حوالے کے طور پر استعمال کرنا ہے۔"
142-
143-
[languages.fr]
144-
contentDir = "content/fr"
145-
languageName = "Français (French)"
146-
title = "Glossaire Cloud Native"
143+
[languages.es]
144+
contentDir = "content/es"
145+
languageName = "Español (Spanish)"
146+
title = "Cloud Native Glosario"
147147
weight = 11
148-
[languages.fr.params]
149-
description = "Le projet de Glossaire CNCF Cloud Native a pour objectif de référencer les termes courants utilisés dans les différentes applications Cloud Natives."
148+
[languages.es.params]
149+
description = "El proyecto de CNCF Cloud Native Glosario pretende ser usado como una referencia para los terminos comunes usados cuando se habla acerca de las aplicaciones nativas para la nube."
150150

151151
[languages.zh-tw]
152152
contentDir = "content/zh-tw"
@@ -156,21 +156,21 @@ weight = 12
156156
[languages.zh-tw.params]
157157
description = "CNCF 雲端原生 Glossary 專案旨在用作討論雲端原生應用程式時常用術語的參考"
158158

159-
[languages.ja]
160-
contentDir = "content/ja"
161-
languageName = "日本語 (Japanese)"
162-
title = "クラウドネイティブ用語集"
163-
weight = 13
164-
[languages.ja.params]
165-
description = "CNCF クラウドネイティブ用語集プロジェクトは、クラウドネイティブアプリケーションについて話すときに使われる一般的な用語のリファレンスとして使用することを目的としています。"
166-
167159
[languages.tr]
168160
title = "Cloud Native Sözlüğü"
169-
description = "CNCF Cloud Native Sözlüğü projesi, cloud native uygulamalardan bahsederken kullanılan yaygın terimler için bir referans olarak kullanılmak üzere tasarlanmıştır."
170161
languageName ="Türkçe (Turkish)"
171162
contentDir = "content/tr"
172-
# Weight used for sorting.
163+
weight = 13
164+
[languages.tr.params]
165+
description = "CNCF Cloud Native Sözlüğü projesi, cloud native uygulamalardan bahsederken kullanılan yaygın terimler için bir referans olarak kullanılmak üzere tasarlanmıştır."
166+
167+
[languages.ur]
168+
contentDir = "content/ur"
169+
languageName = "اردو (Urdu)"
170+
title = "کلاؤڈ کی مقامی لغت"
173171
weight = 14
172+
[languages.ur.params]
173+
description = "CNCF کلاؤڈ کی مقامی لغت کا مقصد کلاؤڈ مقامی ایپلی کیشنز کے بارے میں بات کرتے وقت استعمال ہونے والی عام اصطلاحات کے حوالے کے طور پر استعمال کرنا ہے۔"
174174

175175
[markup]
176176
[markup.goldmark]

0 commit comments

Comments
 (0)