Skip to content

fix:Localize record dropdown menu options and fix loader Japanese support#7514

Merged
walterbender merged 1 commit into
sugarlabs:masterfrom
Noaman-Akhtar:fix/record-dropdown-translation
Jun 13, 2026
Merged

fix:Localize record dropdown menu options and fix loader Japanese support#7514
walterbender merged 1 commit into
sugarlabs:masterfrom
Noaman-Akhtar:fix/record-dropdown-translation

Conversation

@Noaman-Akhtar

Copy link
Copy Markdown
Contributor

PR Category :

  • Bug fix

Description

This PR localizes the hardcoded record dropdown menu options in the user interface by leveraging the existing i18next localization setup.

Key Changes

  1. UI String Localization:

    • Added data-i18n attributes to the record options in index.html to hook them into the translation engine:
      • "Record canvas and toolbars"
      • "Record canvas only"
  2. Loader Integration:

    • Leveraged the existing translation mechanism in js/loader.js to dynamically translate elements tagged with data-i18n.
    • Updated the translation loader in js/loader.js (updateContent()) to handle complex locale objects (such as Japanese, which resolves to a {kanji, kana} structure), preventing [object Object] displaying on-screen.
  3. Translation Updates:

    • Added localized entries for all 82 target languages in the po/ directory.
    • Flagged AI-generated translations with the #. AUTOTRANSLATED: AI marker in the .po files.
    • Kept English, Hindi, Urdu, and Bengali entries clean of the AI marker as these have been verified and reviewed.
    • Compiled all 82 .po files into their respective .json files inside the locales/ directory.

Before :

Screenshot 2026-06-13 185821

After :

Screenshot 2026-06-13 222049

Testing & Quality Checks

  • Ran formatting checks via Prettier to ensure clean code structure.
  • Ran linting checks via ESLint to ensure zero warnings or errors on modified files.
  • Ran the full test suite (npm test), confirming all 165 test suites and 5,491 tests pass successfully.

@github-actions github-actions Bot added bug fix Fixes a bug or incorrect behavior size/XXL XXL: 1000+ lines changed area/javascript Changes to JS source files area/i18n Changes to localization files area/core Changes to core app entry files labels Jun 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Jest Test Results

✅ All Jest tests passed! This PR is ready to merge.

Coverage: Statements: 49.12% | Branches: 40.54% | Functions: 53.32% | Lines: 49.53%
Master Coverage: Statements: 49.12% | Branches: 40.56% | Functions: 53.32% | Lines: 49.54%

@Noaman-Akhtar Noaman-Akhtar force-pushed the fix/record-dropdown-translation branch from 3d11d8c to 867866d Compare June 13, 2026 17:05
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Jest Test Results

✅ All Jest tests passed! This PR is ready to merge.

Coverage: Statements: 49.12% | Branches: 40.54% | Functions: 53.32% | Lines: 49.53%
Master Coverage: Statements: 49.12% | Branches: 40.56% | Functions: 53.32% | Lines: 49.54%

@Noaman-Akhtar

Copy link
Copy Markdown
Contributor Author

@walterbender can pls you review this

@walterbender walterbender merged commit 15d824b into sugarlabs:master Jun 13, 2026
11 checks passed
unmeshgb pushed a commit to unmeshgb/musicblocks that referenced this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Changes to core app entry files area/i18n Changes to localization files area/javascript Changes to JS source files bug fix Fixes a bug or incorrect behavior size/XXL XXL: 1000+ lines changed

Projects

Development

Successfully merging this pull request may close these issues.

2 participants