Skip to content

Test translated pages #1350

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

Closed
wants to merge 2 commits into from
Closed

Test translated pages #1350

wants to merge 2 commits into from

Conversation

adamant-pwn
Copy link
Member

Addresses #1311 as a proof of concept.

In principle, one way to maintain translated versions is to keep them in /pt/, /en/, etc subfolders of the main directory and specify it in mkdocs.yml as extra/alternate. There are some obvious issues that we need to address:

  1. I don't think we want to have contributions to alternate languages reviewed in the same github project as the main one. A possible way to manage this could be to create a separate repo containing just the translations, and then make a github workflow that will merge any changes to it upstream.
  2. Beyond pages, alternate sites would likely require their own mkdocs overrides and mkdocs.yml, e.g. to maintain a separate search index. One way to work with it is found at Setting up multi-language installations squidfunk/mkdocs-material#2346.
  3. Alternative language versions need their own maintainers. @Phon1209, @filipemsilv4 do you want to do it on cp-algorithm's side, or your self-hosted mirror?

Generally, taking (1) and (2) into account I feel like it could be easier to make a separate fork repo for each interested language that will be maintained independently, and then set up the navigation between them in extra/alternate. Though doing it in this manner can complicate sync of technical changes, e.g. in mkdocs.yml or other files that are more related to the site engine than the content.

Copy link
Contributor

Visit the preview URL for this PR (for commit cd092ad):

https://cp-algorithms--preview-1350-pubcypqk.web.app

(expires 2024-10-19T11:06:55.610634926Z)

@adamant-pwn
Copy link
Member Author

So, see e.g. https://cp-algorithms--preview-1350-pubcypqk.web.app/pt/. Navigation still only refers to English pages, and the site GUI is in English as well.

squidfunk/mkdocs-material#2346 includes some potential ways to address it, like adding

{% block announce %}
{% if config.theme.language == 'nl' %}
Welkom!
{% elif config.theme.language == 'en' %}
Welcome!
{% else %}
Bienvenue !
{% endif %}
{% endblock %}

to mkdocs overrides. So, it's probably better to keep things somewhat connected to be in proper sync with each other, but maybe put out language-specific files in separate repos for more granular maintainer access and to keep github histories separate. So, e.g. a separate fork repo could build its own "staging" version of the site, and then new changes would be merged into main site automatically once every day or week.

@filipemsilv4
Copy link

I’m not very familiar with MkDocs to be honest, but I’m more than willing to contribute by translating the content into Portuguese in the best way I can. Initially, my idea was to fork the repository and create a self-hosted mirror in Portuguese. However, if implementing the modifications you’re suggesting for cp-algorithms is feasible, I’d be happy to collaborate in that direction as I think it would be a great approach.

If we go down that path and add a language selector to the cp-algorithms site, I believe it’s important for the navigation to clearly indicate which languages each article is available in. For example, if I choose to browse the site in Portuguese, the navigation should still show all the articles but highlight which ones are available in Portuguese and which aren’t (perhaps with a flag or some other indicator).

@jakobkogler
Copy link
Member

I'm against adding support for multiple languages.
I've added a longer comment here: #1311 (comment)

@adamant-pwn
Copy link
Member Author

Alright, closing this for now.

@adamant-pwn adamant-pwn deleted the i18n branch October 14, 2024 13:11
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.

3 participants