v1.0.0
Manage the translation of the content of your applications with Mantis!
Add the JitPack repository to your build file
-
Add it in your root build.gradle at the end of repositories
repositories { ... maven { url 'https://jitpack.io' } maven { url 'https://repo.clojars.org' } }
repositories { ... maven("https://jitpack.io") maven("https://repo.clojars.org") }
-
Add the dependency
dependencies { implementation 'com.github.N7ghtm4r3:Mantis:1.0.0' }
dependencies { implementation("com.github.N7ghtm4r3:Mantis:1.0.0") }
- Add it in your root build.gradle at the end of repositories
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add the dependency
<dependency>
<groupId>com.github.N7ghtm4r3</groupId>
<artifactId>Mantis</artifactId>
<version>1.0.0</version>
</dependency>
You must place the resources file, named resource.mantis, in the resources folder of your application:
src
|-- main
|-- resources
| |-- resources.mantis
Content example:
{
"it": {
"string_one_key" : "ciao!",
"string_two_key": "prova questa libreria :)"
},
"en": {
"string_one_key" : "hello!",
"string_two_key": "try this library :)"
}
}
// current locale en
Mantis mantis = new Mantis(Locale.ENGLISH);
System.out.println(mantis.getResource("string_one_key")); // hello!
// current locale it
Mantis mantisIt = new Mantis(Locale.ITALIAN);
System.out.println(mantisIt.getResource("string_one_key")); // ciao!
// Dynamic translation of any contents
System.out.println(mantis.translate("Hello how are you?")); // Ciao, come stai?
If you need help using the library or encounter any problems or bugs, please contact us via the following links:
Thank you for your help!
If you want support project and developer
Crypto | Address | Network |
---|---|---|
3H3jyCzcRmnxroHthuXh22GXXSmizin2yp | Bitcoin | |
0x1b45bc41efeb3ed655b078f95086f25fc83345c4 | Ethereum |
If you want support project and developer with PayPal
Copyright © 2023 Tecknobit