Skip to content

Add new languages and sort things#658

Open
1enify wants to merge 4 commits intoNerimity:mainfrom
1enify:main
Open

Add new languages and sort things#658
1enify wants to merge 4 commits intoNerimity:mainfrom
1enify:main

Conversation

@1enify
Copy link
Copy Markdown
Contributor

@1enify 1enify commented Apr 21, 2026

What does this PR do?

  • Adds new languages: Catalan, Italian, Spanish (Latin American)
  • Changes codes of Ukrainian and French to fit in with the rest
  • Sorts language codes in GoogleTranslate.ts
  • Moves Ukrainian to its respective place in languages.ts
  • Sorts contributors based on contributions

Screenshots

выява выява выява

Did you test your code?

Yes, apart from message translation

Checklist

  • Changes are clear, concise, and easy to review
  • Code has been tested and works as intended
  • Text/content changes support internationalization (i18n)
  • Any new user-facing strings are properly localized

Summary by CodeRabbit

  • New Features
    • Added support for three new languages: Catalan, Italian, and Latin American Spanish
    • Updated language mapping configurations to ensure proper translation delivery

lenify added 2 commits April 21, 2026 16:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

This pull request updates language code mappings and locale metadata by modifying the Google Translate language mappings and adding support for three new locales (Catalan, Italian, Latin American Spanish) while reorganizing contributor attribution lists.

Changes

Cohort / File(s) Summary
Google Translate Language Mapping
src/common/GoogleTranslate.ts
Updated GOOGLE_LANGUAGE_MAP to add/modify locale-to-language-code mappings including new entries (ca-ca, es-latam, it-it) and adjusting casing (fr-FR); removed several existing mappings and reordered entries.
Language Locale Definitions
src/locales/languages.ts
Added three new locale definitions (ca-ca, it-it, es-latam) with name, native name, emoji, and contributors. Reordered contributor arrays for existing locales (be-tarask, pt-br, nl-nl, tr-tr, uk).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 New tongues join our lexicon bright,
Catalan, Italian—a polyglot's delight!
Maps redrawn with contributors in place,
Languages flourish across every space! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive terms like 'sort things' that don't clearly convey the main changes in the changeset. Consider a more specific title such as 'Add Catalan, Italian, and Spanish (Latin American) language support' or 'Add new languages and reorganize language mappings'.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description covers the main objectives and includes screenshots, but lacks details on testing scope and specific implementation changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/common/GoogleTranslate.ts`:
- Line 22: The GOOGLE_LANGUAGE_MAP contains a mixed-case key "fr-FR" that
doesn't match how locales are looked up (the code lowercases the stored locale
before indexing GOOGLE_LANGUAGE_MAP), causing French to fall back to English;
update the map key to the lowercase form "fr-fr" (and audit other entries for
consistent lowercasing) so that the lookup in the code that lowercases locales
correctly finds the French mapping.

In `@src/locales/languages.ts`:
- Around line 148-153: The languages map adds "es-latam" but the locale
resolution currently falls back to the first "es*" key (currently "es-es")
because exact browser subtags like "es-MX", "es-AR", "es-419" don't match;
update the locale resolution to map those regional subtags to "es-latam" or
extend the fallback logic so getBrowserLocale / the languages lookup prefers
specific region matches (e.g., check full locale, then explicit alias map for
["es-MX","es-AR","es-419"] -> "es-latam", then generic "es") and ensure the code
that iterates es* keys (referenced near the existing selection at line ~216)
uses this alias map.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e451cbc-f999-4f22-b8cb-a25bb4b91480

📥 Commits

Reviewing files that changed from the base of the PR and between 7b3307a and 5d9c7a7.

📒 Files selected for processing (5)
  • src/common/GoogleTranslate.ts
  • src/locales/languages.ts
  • src/locales/list/ca-ca.json
  • src/locales/list/es-latam.json
  • src/locales/list/it-it.json

Comment thread src/common/GoogleTranslate.ts Outdated
Comment thread src/locales/languages.ts
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.

1 participant