Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

[GUIDE] Adding new translatable texts #11

Open
soywiz opened this issue Sep 12, 2016 · 0 comments
Open

[GUIDE] Adding new translatable texts #11

soywiz opened this issue Sep 12, 2016 · 0 comments

Comments

@soywiz
Copy link
Member

soywiz commented Sep 12, 2016

Having this text for example:

s1

We can jus write Texts.format(""), Pressing ctrl+space inside quotes, will show available texts. This just works on intelliJ IDEA, that supports this thanks to some custom annotations:

s2

If we want to add a new text, we just write a new ID, which is UPPERCASED_SNAKE_CASE, and place arguments separated by commas like this "argument" to value:

s3

Then you go to the quoted TEXT_ID and press, alt+return, then select the Create property quickfix:

s4

This will open a dialog where you can put the text inside. Just ensure that arguments are referenced with %argument% like in the example:

s5

Text should have added in all the Texts_*.Properties files.
s6

You could check here:

s7

Also you can edit them/compare easily within the bottom Resource Bundle tab.

s8

When done, just upload it and make a PR with your favourite software.

s9

And here it is the result after following these steps: 0afe5e1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant