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

i18n: Support translating mod description #172

Open
MattSturgeon opened this issue Feb 5, 2024 · 0 comments · May be fixed by #174
Open

i18n: Support translating mod description #172

MattSturgeon opened this issue Feb 5, 2024 · 0 comments · May be fixed by #174
Assignees
Labels
enhancement New feature or request i18n Internationalization: languages & translation

Comments

@MattSturgeon
Copy link
Member

MattSturgeon commented Feb 5, 2024

Request

This topic was brought up in Crowdin discussions by Әлмәт Ак Арыслан
Әлмәт Ак Арыслан
.

Hello! I think it would be nice to have a Possibility to translate Description and Summary for ModMenu... It really helps when navigating through Content of premade Modpacks and also it just improves Mod's Accessibility.

Implementation

While fabric.mod.json doesn't natively support translated descriptions, modmenu documents that additional keys can be added to our language files to handle this.

The additional keys are:

  • modmenu.nameTranslation.freecam: mod name (probably doesn't need translating in our case?)
  • modmenu.descriptionTranslation.freecam: full description shown in the right-hand pane
  • modmenu.summaryTranslation.freecam: text shown in the mod list (defaults to description)

That may be more complex that it sounds, because we need a different description for the standard & Modrinth builds.

I suspect, we'll need to have the :metadata project generate lang files in addition to what it currently does.

This will mean moving the lang files out of common/src/resources and potentially adding additional lang files that we can merge when building.

We'll also need to move the description out of gradle.properties and into one of these new metadata language files.

Forge

I'm not aware of any way to include translations in mods.toml, nor am I aware of any other way to tell (neo)forge's mods menu about translations. That said, I've not properly looked into this yet.

Additional opportunities

Having a translation build step presents a couple unrelated opportunities:

  • We can name our translations something Crowdin natively understands (e.g. en-US.json)
  • We can split up our translations into smaller files (combining them during the build)
  • We can use a different format (.properties supports comments and is easier to read than .json. Crowdin can use comments to add additional context.)
  • We could simplify VariantTooltip, by doing most of the work at build time
@MattSturgeon MattSturgeon added enhancement New feature or request i18n Internationalization: languages & translation labels Feb 5, 2024
@MattSturgeon MattSturgeon self-assigned this Feb 5, 2024
@MattSturgeon MattSturgeon linked a pull request Feb 7, 2024 that will close this issue
12 tasks
MattSturgeon added a commit to MattSturgeon/Freecam that referenced this issue Feb 8, 2024
Introduce `ModNameProcessor` & `ModDescriptionProcessor`, along with a new method `LangTask.getTranslation()` which can be used to get a specific translation after the task has finished running.

Make use of this in `:data` to get the name & description from the translations into the mod metadata file.

Fixes MinecraftFreecam#172
MattSturgeon added a commit to MattSturgeon/Freecam that referenced this issue Feb 9, 2024
Move name & description definition from `gradle.properties` to a lang file in `:data`.

Introduce `ModNameProcessor` & `ModDescriptionProcessor`, along with a new method `LangTask.getTranslation()` which can be used to get a specific translation after the task has finished running.

Make use of this in `:data` to get the name & description from the translations into the mod metadata file.

Fixes MinecraftFreecam#172
MattSturgeon added a commit to MattSturgeon/Freecam that referenced this issue Feb 14, 2024
Move name & description definition from `gradle.properties` to a lang file in `:data`.

Introduce `ModNameProcessor` & `ModDescriptionProcessor`, along with a new method `LangTask.getTranslation()` which can be used to get a specific translation after the task has finished running.

Make use of this in `:data` to get the name & description from the translations into the mod metadata file.

Fixes MinecraftFreecam#172
MattSturgeon added a commit to MattSturgeon/Freecam that referenced this issue Feb 18, 2024
Move name & description definition from `gradle.properties` to a lang file in `:data`.

Introduce `ModNameProcessor` & `ModDescriptionProcessor`, along with a new method `LangTask.getTranslation()` which can be used to get a specific translation after the task has finished running.

Make use of this in `:data` to get the name & description from the translations into the mod metadata file.

Fixes MinecraftFreecam#172
MattSturgeon added a commit to MattSturgeon/Freecam that referenced this issue Feb 22, 2024
Move name & description definition from `gradle.properties` to a lang file in `:data`.

Introduce `ModNameProcessor` & `ModDescriptionProcessor`, along with a new method `LangTask.getTranslation()` which can be used to get a specific translation after the task has finished running.

Make use of this in `:data` to get the name & description from the translations into the mod metadata file.

Fixes MinecraftFreecam#172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i18n Internationalization: languages & translation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant