Repository navigation
Conversation
Signed-off-by: 0lbap <pablo.laviron@gmail.com>
marcan
force-pushed
the
main
branch
3 times, most recently
from
January 14, 2024 08:03
6fdf253 to
23a8902
Compare
|
please refer to #67 for discussion on this nice PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added support for both English and French languages. I've followed Hugo's official documentation on multilingual mode closely to implement these changes. However, please feel free to review and provide feedback, as there's always a chance I might have overlooked something or made some typos.
More languages can be added in the
config.tomlfile. The default language is set to English, and you can access the different languages with the URL (for example, the/aboutpage is in English, but/fr/aboutpage is in french).Template text translation is done through the
i18nfunction, which can be shorten by simply writingT. This uses thei18n/en.tomlandi18n/fr.tomltranslation files (a list of key/value pairs). See this page for more information.The
contentdirectory now contains two directoriesenandfr, in which the Markdown content is manually translated.Here are some steps to add a new language :
config.tomlby adding it under the[languages]and defining thecontentDir,languageCode,languageNameandweighti18n/fr.toml). You can use the English file as a basecontent/fr/). You can use the English directory as a baseThis marks my first open source contribution, and I'm eager to learn and improve.