-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak api a little, release a first beta
- Loading branch information
Showing
12 changed files
with
116 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,53 @@ | ||
# Server-Translations | ||
# Server Translation API | ||
It's a library for handling translations server side. It supports | ||
per player language, by using one provided by client on join/language change. | ||
|
||
Translators can translate the components here: https://hosted.weblate.org/projects/nucleoid/ | ||
## Adding as dependency: | ||
Add it to your dependencies like this: | ||
|
||
```groovy | ||
repositories { | ||
maven { url 'https://maven.nucleoid.xyz' } | ||
} | ||
dependencies { | ||
modImplementation include("xyz.nucleoid:server-translations-api:[TAG]") | ||
} | ||
``` | ||
|
||
For `[TAG]`/translations api version I recommend you checking [this maven](https://maven.nucleoid.xyz/xyz/nucleoid/server-translations-api/). | ||
|
||
### For versions before 1.19.4: | ||
```groovy | ||
repositories { | ||
maven { url 'https://maven.nucleoid.xyz' } | ||
} | ||
dependencies { | ||
modImplementation include("fr.catcore:server-translations-api:[TAG]") | ||
} | ||
``` | ||
|
||
For `[TAG]`/translations api version I recommend you checking [this maven](https://maven.nucleoid.xyz/fr/catcore/server-translations-api/). | ||
|
||
## Usage | ||
To use i, you just need to use vanilla `Text.translation(...)` with key specified by you in your code. | ||
|
||
Then you just need to create `data/modid/lang` folder in your mod's resources. | ||
Then you can create there `en_us.json` for default translation and similar files for other languages (same format as vanilla translations). | ||
|
||
Example valid language file looks like this: | ||
``` | ||
{ | ||
"block.honeytech.pipe": "Pipe", | ||
"block.honeytech.item_extractor": "Item Extractor", | ||
"block.honeytech.trashcan": "Trash Can", | ||
"block.honeytech.cable": "Cable", | ||
"item.honeytech.diamond_dust": "Diamond Dust", | ||
"item.honeytech.raw_aluminium": "Raw Aluminium Ore", | ||
"item.honeytech.aluminium_ingot": "Aluminium Ingot", | ||
"item.honeytech.copper_wire": "Copper Wire", | ||
"item.honeytech.motor": "Motor", | ||
"gui.honeytech.show_recipes": "Show Recipes" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...src/main/java/xyz/nucleoid/server/translations/api/language/ServerLanguageDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 1 addition & 9 deletions
10
api/src/main/java/xyz/nucleoid/server/translations/mixin/packet/TextSerializerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Done to increase the memory available to gradle. | ||
org.gradle.jvmargs=-Xmx1G | ||
|
||
maven_group=fr.catcore | ||
maven_group=xyz.nucleoid |