Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move i18n content into sub-directories. #1086

Merged
merged 1 commit into from Oct 8, 2022
Merged

Conversation

jholdstock
Copy link
Member

Do i18n on a per-dir basis rather than per-file. For more info see https://gohugo.io/content-management/multilingual/#translate-your-content

Using sub-directories allows us to remove over 100 empty i18n files from version control, and instead just copy the en directory at build time.

This also fixes an issue where press releases were not displayed in non-en languages. (Closes #1071)

Do i18n on a per-dir basis rather than per-file. For more info see
https://gohugo.io/content-management/multilingual/#translate-your-content

Using sub-directories allows us to remove over 100 empty i18n files from version control, and instead just copy the en directory at build time.

This also fixes an issue where press releases were not displayed in non-en languages.
@xaur
Copy link
Contributor

xaur commented Oct 4, 2022

I think it will be easier to navigate and manage languages when all files for language X are in src/content/X. In terms of Git it also allows to track all changes to language X with git log -- src/content/X.

Will Hugo allow to move transifex_catalogs/X.json to src/content/X/strings.json and is it a good idea?

And I wonder why add src/content/X to .gitignore, shouldn't they be available for potential translations of content in en?

@jholdstock
Copy link
Member Author

The changes in this PR are just for files generated during the build process, and wont effect workflow for translators or developers at all. If you look at the files changed, the only deleted files are completely empty and no actual i18n content has been touched.

Its a weird quirk of Hugo. Fallback to English for missing translations isnt a native feature, and hacking it in requires creating a whole bunch of empty files. This PR is basically just enabling those empty files to be generated automatically rather than having them tracked in version control.

Will Hugo allow to move transifex_catalogs/X.json to src/content/X/strings.json and is it a good idea?

The translator.html tool which was inherited from decrediton is currently tied to the format of the transifex_catalogs/X.json files. Once we have translations (mostly) done for the new website, I plan to completely remove the transifex stuff, which will include moving strings in to the src/ dir as you suggest.

@dajohi dajohi merged commit 84aa396 into decred:master Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Press releases are not shown on non-EN languages
3 participants