feat: full i18n support for educational articles with translation generation - #264
Conversation
- Extracts hardcoded Portuguese articles from `learnData.ts` into individual locale JSON files. - Integrates `useArticles` and `useArticleBySlug` React hooks in `ArticlePage.tsx` and `LearnPage.tsx` using `react-i18next`. - Generates Spanish (`es`), Hindi (`hi`), and English (`en`) translations via `googletrans` script. - Fixes greedy regex parsing bug for Markdown bold and italic elements in `ArticlePage.tsx`. - Updates the sitemap generator script to parse the new data formatting for SEO. Co-authored-by: albertoivo <1276520+albertoivo@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Reveja toda a tradução feita agora? |
I have completely re-translated the articles to Spanish, Hindi, and English using a more reliable automated translation engine ( |
- Installs `googletrans` to replace manual translations. - Rewrites `translate_all.py` to chunk translations and handle large texts. - Regenerates Spanish, Hindi, and English `articles.json` files with more accurate translations. Co-authored-by: albertoivo <1276520+albertoivo@users.noreply.github.com>
This pull request fully implements internationalization for the educational articles on PyExplorer. Previously, all articles were hardcoded into a TypeScript array in Portuguese.
Changes included:
src/data/learnData.tsinto a lightweight static metadata array (BASE_ARTICLES) and extracted the bulky string content into dedicated JSON translation files located undersrc/i18n/locales/.useArticles,useArticleBySlug, etc.) that utilizereact-i18nextto inject the localized translations on the fly based on the user's selected language.googletransto parse and automatically translate all the original Portuguese content into English, Spanish, and Hindi JSON files.src/pages/ArticlePage.tsxwhere greedy regex (.*) would mangle markdown when multiple bold or italicized words appeared on the same line. Changed to non-greedy mapping (.*?).scripts/generate-sitemap.cjsfile's regex to ensure the dynamic sitemap generation correctly picks up all article slugs in their new format.All 585 tests are passing cleanly and the build verifies. No side-effects introduced.
PR created automatically by Jules for task 18360564068949808552 started by @albertoivo