Skip to content

Commit 6ab407b

Browse files
authored
content: Improve links on lang.Translate page
1 parent 91e7240 commit 6ab407b

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

‎content/en/functions/lang/Translate.md‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ aliases: [/functions/i18n]
1313

1414
The `lang.Translate` function returns the value associated with given key as defined in the translation table for the current language.
1515

16-
If the key is not found in the translation table for the current language, the `lang.Translate` function falls back to the translation table for the [`defaultContentLanguage`].
16+
If the key is not found in the translation table for the current language, the `lang.Translate` function falls back to the translation table for the [`defaultContentLanguage`][].
1717

1818
If the key is not found in the translation table for the `defaultContentLanguage`, the `lang.Translate` function returns an empty string.
1919

2020
> [!note]
2121
> To list missing and fallback translations, use the `--printI18nWarnings` flag when building your site.
2222
>
23-
> To render placeholders for missing and fallback translations, set [`enableMissingTranslationPlaceholders`] to `true` in your site configuration.
23+
> To render placeholders for missing and fallback translations, set [`enableMissingTranslationPlaceholders`][] to `true` in your site configuration.
2424
2525
## Translation tables
2626

27-
Create translation tables in the `i18n` directory, naming each file according to [RFC 5646]. Translation tables may be JSON, TOML, or YAML. For example:
27+
Create translation tables in the `i18n` directory, naming each file according to [RFC 5646][]. Translation tables may be JSON, TOML, or YAML. For example:
2828

2929
```text
3030
i18n/en.toml
3131
i18n/en-US.toml
3232
```
3333

34-
The base name must match the [language key] as defined in your site configuration.
34+
The base name must match the [language key][] as defined in your site configuration.
3535

36-
Artificial languages with private use subtags as defined in [RFC 5646 § 2.2.7] are also supported. You may omit the `art-x-` prefix for brevity. For example:
36+
Artificial languages with private use subtags as defined in [RFC 5646 § 2.2.7][] are also supported. You may omit the `art-x-` prefix for brevity. For example:
3737

3838
```text
3939
i18n/art-x-hugolang.toml
@@ -94,7 +94,7 @@ i18n/
9494
└── pl.toml
9595
```
9696

97-
The Unicode [CLDR Plural Rules chart] describes the pluralization categories for each language.
97+
The Unicode [CLDR Plural Rules chart][CLDR] describes the pluralization categories for each language.
9898

9999
The English translation table:
100100

@@ -177,7 +177,7 @@ Template code:
177177
178178
## Reserved keys
179179

180-
Hugo uses the [go-i18n] package to look up values in translation tables. This package reserves the following keys for internal use:
180+
Hugo uses the [go-i18n][] package to look up values in translation tables. This package reserves the following keys for internal use:
181181

182182
id
183183
: (`string`) Uniquely identifies the message.
@@ -195,22 +195,22 @@ rightdelim
195195
: (`string`) The right Go template delimiter.
196196

197197
zero
198-
: (`string`) The content of the message for the [CLDR] plural form "zero".
198+
: (`string`) The content of the message for the [CLDR][] plural form "zero".
199199

200200
one
201-
: (`string`) The content of the message for the [CLDR] plural form "one".
201+
: (`string`) The content of the message for the [CLDR][] plural form "one".
202202

203203
two
204-
: (`string`) The content of the message for the [CLDR] plural form "two".
204+
: (`string`) The content of the message for the [CLDR][] plural form "two".
205205

206206
few
207-
: (`string`) The content of the message for the [CLDR] plural form "few".
207+
: (`string`) The content of the message for the [CLDR][] plural form "few".
208208

209209
many
210-
: (`string`) The content of the message for the [CLDR] plural form "many".
210+
: (`string`) The content of the message for the [CLDR][] plural form "many".
211211

212212
other
213-
: (`string`) The content of the message for the [CLDR] plural form "other".
213+
: (`string`) The content of the message for the [CLDR][] plural form "other".
214214

215215
If you need to provide a translation for one of the reserved keys, you can prepend the word with an underscore. For example:
216216

@@ -238,8 +238,7 @@ Then in your templates:
238238

239239
[`defaultContentLanguage`]: /configuration/all/#defaultcontentlanguage
240240
[`enableMissingTranslationPlaceholders`]: /configuration/all/#enablemissingtranslationplaceholders
241-
[CLDR]: https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html
242-
[CLDR Plural Rules chart]: https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html
241+
[CLDR]: https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html
243242
[go-i18n]: https://github.com/nicksnyder/go-i18n
244243
[language key]: /configuration/languages/#language-keys
245244
[RFC 5646]: https://datatracker.ietf.org/doc/html/rfc5646

0 commit comments

Comments
 (0)