Skip to content

Conversation

john-sp
Copy link
Member

@john-sp john-sp commented Jul 21, 2025

This is my first attempt at multilingual support, only /play/faq/ has a translation.

Note: The list of languages at the top of pages with translations is going to change.

image

Closes #8

Copy link

🚀 Draft Preview: https://pr151-draft.lc0.org/

1 similar comment
Copy link

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp john-sp marked this pull request as ready for review August 7, 2025 02:13
@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 02:13
Copilot

This comment was marked as outdated.

@john-sp
Copy link
Member Author

john-sp commented Aug 7, 2025

Oops, I still haven't finished the dropdown menus for languages. Not quite ready for merge Fixed

Copy link

github-actions bot commented Aug 7, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp
Copy link
Member Author

john-sp commented Aug 7, 2025

That didn't merge correctly, let me try again

Copy link

github-actions bot commented Aug 7, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

Copy link

github-actions bot commented Aug 7, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp john-sp requested a review from Copilot August 7, 2025 16:16
Copilot

This comment was marked as outdated.

@john-sp john-sp changed the title [DRAFT] Multilingual Support Multilingual Support Aug 7, 2025
Copy link

github-actions bot commented Aug 7, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

2 similar comments
Copy link

🚀 Draft Preview: https://pr151-draft.lc0.org/

Copy link

🚀 Draft Preview: https://pr151-draft.lc0.org/

@mooskagh
Copy link
Member

mooskagh commented Aug 20, 2025

Looks good!

The language "icon" is a bit confusing though. Maybe take some from here?
https://icon-sets.iconify.design/?query=language&attribution=0
UPD it seems that the link doesn't lead to the search page. What I did is selected "Palette and license → optonal", and then searched for "language"

It feels that also it would look better right aligned (near or below the "Edit on Github" button).

Copy link

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp
Copy link
Member Author

john-sp commented Aug 21, 2025

I know we had talked about the Edit on Github/Wiki button. Do we want to move that to the bottom while I am here?

Copy link

🚀 Draft Preview: https://pr151-draft.lc0.org/

@mooskagh
Copy link
Member

Maybe remove "edit on github" completely? For people not using github, it leads to 404 page, and who does, usually goes through the github repo as it's more familiar.

Copy link

github-actions bot commented Sep 5, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp
Copy link
Member Author

john-sp commented Sep 5, 2025

Ahh, rebase time

Copy link

github-actions bot commented Sep 5, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp
Copy link
Member Author

john-sp commented Sep 5, 2025

Issues before merging:

  1. There is no way to change the language on the home page (or blogs, but I was never planning on supporting blog translations)
  2. The top bar's menu, while now translated, does not link to the translated section, if it exists.

Copy link

github-actions bot commented Sep 6, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp
Copy link
Member Author

john-sp commented Sep 6, 2025

The top bar's menu, while now translated, does not link to the translated section, if it exists.

We don't have translations for almost any page, so I am going to leave this for now. It is an easy fix if the site gets close to a full translation.

Copy link

github-actions bot commented Sep 6, 2025

🚀 Draft Preview: https://pr151-draft.lc0.org/

@john-sp john-sp requested a review from Copilot September 6, 2025 13:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements multilingual support for the website, adding Spanish and Hindi translations with language-specific navigation, menus, and content. The implementation includes proper internationalization infrastructure for alert messages, navigation menus, and homepage content.

Key changes include:

  • Introduction of language dropdown functionality for translated pages
  • Implementation of fallback behavior for untranslated content in sidebar navigation
  • Addition of Spanish and Hindi translations for FAQ page and homepage data

Reviewed Changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
themes/leela/layouts/_partials/sidebar.html Enhanced sidebar navigation with multilingual support and fallback to English content
themes/leela/layouts/_partials/main-menu.html Added internationalization for menu item names using translation keys
themes/leela/layouts/_partials/i18n-dropdown.html New language selector dropdown component for translated pages
themes/leela/layouts/_partials/head/opengraph.html Added multilingual SEO optimization with hreflang tags
themes/leela/layouts/_partials/content.html Integrated language dropdown and machine translation notice banner
themes/leela/layouts/_markup/render-blockquote.html Implemented internationalized alert titles with fallback handling
themes/leela/assets/js/main.js Added JavaScript functionality for language dropdown toggle behavior
themes/leela/assets/css/main.css Added styling for language dropdown component
themes/leela/assets/css/icons.css Added language icon for dropdown toggle button
layouts/index.html Updated homepage to support language-specific data files
i18n/*.toml Created translation files for English, Spanish, and Hindi UI strings
data/*/homepage.json Added Spanish and Hindi translations for homepage content
content/play/faq.es.md Spanish translation of FAQ page
content/play/_index.es.md Spanish section index page
content/contribute/hugo/translate.md Updated translation documentation with detailed instructions
config.toml Added multilingual configuration and menu identifiers
README.md Added development setup and translation guidelines

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@john-sp john-sp merged commit f97b98c into LeelaChessZero:master Sep 6, 2025
1 check passed
@john-sp john-sp deleted the multi-lingual branch September 6, 2025 13:22
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.

Enable support for more languages
2 participants