-
Notifications
You must be signed in to change notification settings - Fork 49
Internationalisation support to the website #397
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
base: website
Are you sure you want to change the base?
Conversation
|
This looks like a great adding! How are we planing to handle the blog post? Auto translation like GTranslate? |
|
We first need to verify if translating the posts (which are in markdown) will be possible. But it might be a bit complicated, indeed, if each post needs to be translated, but at the same time, it could be easier for a reader to get new features in his language. Automatic translations could be a start, so that translators don't need to start from zero, and just ammend incorrect translations |
daschuer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, Thank you very much for picking this up.
| A more compact way is using gettext | ||
|
|
||
| {% trans %}translatable content{% endtrans %} | ||
| {{ gettext('translatable content') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both is printed in one line. I think you need to add a blank line. It is probably better to recommend only one translation method. I like { tr('translatable content') } to match the mixxx source. But it doesn't really matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the line break, but I am unsure about keeping just one.
Also note that I cannot randomly choose a name, although I could define a function in the pelicanconf.py file that calls to the real one.
Using "tr" would be confusing (the only thing in common would be that it is a translatable text)
Anyway, all the existing code uses {% trans %} {% endtrans %}, (except the site language text that I've added), but using the gettext syntax is problematic if one needs to escape text.
So, I am still in doubt of what we do. Maybe recommend the longer syntax, but that the shorter one can be used too?
…pre-commit (windows does not have a python3 alias,except if using the Microsoft Store version of python) and other changes in pre-commit-config.yaml
…g menu in all subsites, but i am unable to wrap correctly the languages dropdown to show them all. Also I am still unsure about the placement of the site languages menu, since right now it squeezes the rest of the menu.
|
Last commit has a somewhat working solution, but still misses the menu translation and the languages list is cropped if it can't be shown completely in the screen size. Also I realised i didn't create a new branch before creating the PR. Wonder if I should start a new one or it's ok now. |
|
Nice! |
|
I am currently refitting the older translations from transifex into this and will put only those with a percentatge at or above 25% translated. |
- Incorporated most of the translations that existed in transifex for the old site. Added two and removed six (based on amount of translated content) - Moved the language selection to the footer. - Fixed html lang - Small change to not include code in one translation.
|
Ok, now this is in a workable state.
|
|
ok, the download page error seems to be an actual bug. %s is not a valid format in python: I've changed it locally to %S instead, but that should be solved in a separate PR . Seems this was done in 2021 by @Holzhaus |
… simply commenting the language in pelicanconf.py is enough Also improved the visuals for the language selection in the footer.html Note: Seems that texts labeled with fuzzy (i.e. not revised) are not compiled and so not translated.
…dn't find a way to keep using the MenuItem class, although I can't tell if it is possible or not) add translation elements to the footer.
…ather than the one corresponding to the locale)
|
Nice work. Am I looking over a language indicator (other then in the url)? |
|
Hello @Eve00000 . You're right that there are hundreds of lines to translate. This includes explanations of the features, or where and how to get in contact. The older site had already translations, which is why I started the zulip thread and ended in this PR. Like Mixxx itself, it's in transifex, here: https://app.transifex.com/mixxx-dj-software/mixxxdj-website/dashboard/ I took that as a reference ( %) of the amount of translations done (although some texts no longer exist and there are some other new). Then, I "upgraded" the translations with the messages generated for the current site. I need to readd the translations of the menu entries, since I removed them in the upgrade process because they weren't available yet. Also I will need to remove the fuzzy indicator on the translations (basically means the translation is not revised, sometimes means that is autogenerated or copied from an already existing translation). If I don't do that, those are not considered as translated. I am not sure of what you mean with language indicator. If you mean to know in the site which language is selected, the commit you probably tested shows the selected language in white instead of yellow. The fake english is partially autogenerated from transifex. Manual link: Oh, you're right. I forgot that this relative path is not part of the site, but another subsite. Fixed and will commit the change. |
When you 're ready with you big summer clean-up and you have a po with all lines that can be translated, I think we can do a big effort to translate them in the major languages (I prefer to do it directly in the po as it speeds up a lot).
In the current version (deploy->preview) I don't see an indicator anymore, In an earlier version there was a language dropdown but that's gone, now the languages are all at the bottom (see images) so no white or yellow.
Thank you for explaining, I was just wondering why it was integrated but it makes sense showing it for testing resaons in the PR PS: still enjoying your free time? 😄 |
…those that don't have about 50% translated. It will probably be better that they start from scratch.



Work in progress to add language support to the website.
Even though it is true that nowadays some browsers give the option to autotranslate a site, giving a default translated site could better suit new and existing users.
This PR adds i18n_subsites pelican plugin which generates subfolders with translated content, and a dropdown list of supported languages has been added to the navigation bar.
Ideally the site should switch to the language that the browser reports, but so far I'm leaving that out of the equation.
Next step is checking the pages that need to add gettext/trans annotations.
I'm not 100% sure if the markdown pages will be as easily translatable as the templates.
Also I need to envision a way to translate the menu/navigation bar, since currently it is defined in the pelicanconf.py, not in the html templates.