The code handling these parameters is in layouts/_default/single.html
When the website is built, a page with this parameter will:
- Have its content replaced by the English version
- Links pointing to English pages that can be translated will be rewritten to points to the translation instead
- The top of the page will have a message to encourage new translators
A page with this attribute will still have one version per language.
That attribute has two functions:
- It informs translators that this page should not be translated
- The top of the page will NOT have a message to encourage new translators
A translation with this attribute will display a warning on the top to indicate that the English version is canonical.
When a page should not appears in search engines.
Most pages displays the lastmod
(or date
) on the top. But the most important usage is to help synchronize translations: the lastmod
of a translation must be equal to the lastmod
of the translated page. So when a page is updated and need it's translations to be also updated, updating the lastmod
helps to detect that automatically (on https://letsencrypt.org/i18n)
Also, if the lastmod
of the translation differs from the lastmod
of the English version, a message will appear on the top of the translated page, to inform the user that the English version is newer (with a link to see it)
It contains files that should be copied to add a new language. When a new file is added, a template file can be created there.
The lastmod
is localized using javascript (see i18n.js
)
On the top of each English page with translations (pages really translated, not with the untranslated
attribute), for each language, a message says "See this page in XXX". The javascript (i18n.js
) only displays the languages relevant to the visitor (see layouts/_default/single.html
).
glossary.js
adds titles on links between terms.
shortcodes/def.html
contains the documentation
shortcodes/plotly.html
contains the code and an html tag with the necessary translations (There is no other way to access Hugo translation from the javascript).
Translations of plotly functions are in static/js/plotly-locale-XX.js
, uploaded from https://github.com/plotly/plotly.js/tree/master/dist (some languages have only partial translations)
The shortcode become-a-sponsor uses numberFormat
Ex.: numberFormat = "-|.|,"
and the i18n sentence amount_per_year
Ex.: amount_per_year="${{ .nb }}/yr (USD)"
To construct "$10.000/yr (USD)"
The shortcode is called in the .md
template with the translations for Platin/Gold/Silver as a parameter. They are not in i18n/
because there already are translations for those words for the list of sponsors, and sometimes the translation differs (Ex. in ru
).
After adding the .md
file in content/en
, a file with the same name must be copied in all other folders of content/
, including content/base-l10n
with the following content:
---
slug: the-same-than-english
untranslated: 1
---
After adding the .md
file in content/en
, a file with the same name must be copied in all other folders of content/
, including content/base-l10n
with the following content:
---
slug: repository
untranslated: 1
do_not_translate: 1
---
<!-- Note for translators: do NOT translate this file -->
The file layouts/_default/shortcodes/docs_index.md
must be updated.
The name of the link will be the linkTitle
of the target page (if present) or the title
of the target page.
https://github.com/gohugoio/hugo/releases
- Generate the website using the current version:
hugo -d /tmp/current
- Generate the website using the updated version:
hugo -d /tmp/updated
- Check the diff to be sure nothing is broken:
diff -r /tmp/current /tmp/updated
(the diff is never empty, you must see at least the version updated in two files per languages) - If necessary, updates the code to be compatible with the new Hugo version
- Update
netlify.toml
and.travis.yml
to the new Hugo version - After opening the PR, check the Netlify preview: in the source, you need to check in the
<head>
the meta tag<meta name="generator" content="Hugo 0.XX.X">
to be sure that version of Hugo is available on Netlify.