Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial localization support #37

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Open

Conversation

NebelNidas
Copy link
Member

@NebelNidas NebelNidas commented Jun 17, 2023

Inspired by Enigma's and JADX's equivalents, but heavily stripped down. Only supports mapping format names for now, exception messages are going to be tackled in a separate PR.

Copy link
Member

@modmuss50 modmuss50 left a comment

Choose a reason for hiding this comment

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

I dont think we should localise error messages like this
It makes it harder to search for solutions, harder for people trying to provide support, and doesn't really benefit users. We dont localise error messages in other projects, especially none user facing ones like this.

@NebelNidas NebelNidas force-pushed the i18n branch 4 times, most recently from 01c0576 to 7386425 Compare October 16, 2023 11:33
@NebelNidas NebelNidas marked this pull request as ready for review October 16, 2023 11:42
@NebelNidas NebelNidas marked this pull request as draft March 28, 2024 19:34
@sfPlayer1
Copy link
Contributor

We could maybe introduce error codes that make it accessible for replacement on the embedding application side?

@NebelNidas
Copy link
Member Author

NebelNidas commented Apr 19, 2024

That's the goal, having a central ErrorMessages class holding all the error messages MIO uses in the form of Translatables. Consumers can either translate the Translatable to a given locale, or manually check for equality with a given error message.

But as mentioned above, that's going to be a separate PR (probably after #94 is merged)

@NebelNidas NebelNidas marked this pull request as ready for review April 19, 2024 16:35
@NebelNidas NebelNidas requested a review from modmuss50 April 20, 2024 04:50
@NebelNidas NebelNidas changed the title Localization support Initial localization support Jan 18, 2025
@@ -0,0 +1,14 @@
format.tiny_file = Tiny File
Copy link
Member

Choose a reason for hiding this comment

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

Most of this shouldnt even be translated, other than maybe "File". Im not really sure this should be handled in mapping-io.

Copy link
Member Author

@NebelNidas NebelNidas Jan 18, 2025

Choose a reason for hiding this comment

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

Some languages will need to hyphenate individual words, switch their order around, or even outright translate the format names. For example in German, you'd have Tiny-v2-Datei and IntelliJ-Migrationszuordnungsdatei (at least when going with the German language pack's translation).

I think this makes sense being part of Mapping-IO natively, as I don't want to duplicate the translation files across a dozen different applications like Enigma, Matcher and JADX, just to name a few. And you're not forced to use MIO's translations either, you can always delegate to a custom localization system via Translatable#translationKey(). Not to mention that these facilities are required for #88 and #94 to provide user-friendly warnings and error messages e.g. in Enigma.

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