Skip to content

Add internationalization (i18n) support and initial English / Brazilian Portuguese translations#69

Open
cookieukw wants to merge 22 commits into
JannisX11:mainfrom
cookieukw:main
Open

Add internationalization (i18n) support and initial English / Brazilian Portuguese translations#69
cookieukw wants to merge 22 commits into
JannisX11:mainfrom
cookieukw:main

Conversation

@cookieukw

Copy link
Copy Markdown

Introduce a lightweight i18n system and initial translation files so UI texts can be localized. Adds a t() helper, loads translations, and replaces/organizes several UI strings into translation keys. No breaking changes.

Added

  • en.json — English translation keys (initial)
  • pt-BR.json — Brazilian Portuguese translations (initial)
  • i18n.ts — simple translation resolver t(path) with fallback to English

Modified

  • formats.ts — uses t(...) for format names/descriptions and registers category translation.
  • Several UI labels and messages updated to use translation keys (examples: plugin.title, menu.import_attachment, textures.message, actions.hytale_add_quad, toggle.toggle_attachment_editing, settings.*)

Testing / QA 🔧

  • Load plugin in Blockbench (dev build) and confirm UI texts render from translations (e.g., format names, import dialog text) ✅
  • Change Language.code (or Blockbench language) to pt-BR and verify Portuguese strings appear ✅
  • Set an unsupported language code to verify English fallback behavior ✅
  • Verify newly added translation keys are present in en.json and have equivalents in pt-BR.json ✅

Notes for reviewers / maintainers 📝

  • No breaking changes; existing behavior remains when translations are missing (fallback to English).
  • New translation keys should be kept in sync across languages; consider adding a validation script to CI to detect missing keys (suggestion for follow-up)
  • To add more languages, add src/translations/.json matching en.json key structure and import it in i18n.ts
  • Release note (one line) 📣
  • Added i18n support with initial English and Brazilian Portuguese translations and a t() helper for localized UI strings

@JekSun97

Copy link
Copy Markdown

This is of great importance to me, as I am not familiar with either English or Brazilian.

@cookieukw

cookieukw commented Dec 26, 2025

Copy link
Copy Markdown
Author

This is of great importance to me, as I am not familiar with either English or Brazilian.

@JekSun97
Yes, it's also possible to add other languages ​​in the future. It's not one of the best systems, but it serves its purpose very well

@Antikyth

Copy link
Copy Markdown

I am not Brazilian but this seems really important because I know one of the major countries with Hytale fans is Brazil, I think this could help make Hytale modding more accessible to a lot of people who enjoy the game.

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