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

Complete infrastructures for localizing tooltips/descriptions #5426

Merged
merged 13 commits into from
Nov 27, 2023

Conversation

ZZZank
Copy link
Contributor

@ZZZank ZZZank commented Nov 17, 2023

This PR makes every tooltips/descritions defined in scripts localizable. It's a continuation of #5423 .

Summary

  • base::tooltips
  • normal::tooltips
  • normal::jei_descriptions

and

  • move dynamic added text to the front of text adding action, to enable localization
  • build infrastructures to allow handling texts with %s placeholder. It's first used in Simple Farming Beverages descriptions

New Infrastructure with

The new infrastructures added a with , which is in the same level of items and text , to allow handling %s in text . with should be a nested array. An real world example may look like this:

{
  items: ['minecraft:stick'],
  text: ['example1: %s', '%s-example2-%s'],
  with: [
     ['insert1'],
     ['insert2', 'insert3'],
  ]
}

This will be interpreted as:

example1: insert1
insert2-example2-insert3

Test

I don't have time to do a throughout test recently, but I do made a quick test, and no problem found.

Copy link
Collaborator

@NielsPilgaard NielsPilgaard left a comment

Choose a reason for hiding this comment

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

Nice work again!

.gitignore Outdated Show resolved Hide resolved
kubejs/assets/enigmatica/lang/en_us.json Outdated Show resolved Hide resolved
kubejs/assets/enigmatica/lang/en_us.json Outdated Show resolved Hide resolved
@NielsPilgaard NielsPilgaard merged commit 00248ac into EnigmaticaModpacks:develop Nov 27, 2023
7 checks passed
@ZZZank ZZZank deleted the even_more_locali branch November 28, 2023 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants