TinaX is a Unity-based framework, simple , complete and delightful, ready to use. TinaX provides functionality in the form of "Unity packages".
TinaX.I18N
provides internationalization feature support for TinaX Framework
- Use json (or
.asset
file) key/value to define the i18n table - Real-time regions switching
- Extensions for UGUI.
package name: io.nekonya.tinax.i18n
"Readme" in other languages :
The main service interface of VFS:
TinaX.I18N.II18N
Facade of the main service interface:
TinaX.I18N.XI18N
Define some json file:
en_common.json
{
"data":[
{ "k": "hello", "v" : "Hello" },
{ "k": "meow", "v" : "Meow~" }
]
}
jp_common.json
{
"data":[
{ "k": "hello", "v" : "こんいちは"},
{ "k": "meow" , "v" : "にゃ" }
]
}
The Json file is suitable for slightly larger projects. Usually in these projects, the I18N definition file will be configured by Excel and exported to Json through the tools in the team.
For small-scale projects, Json seems too cumbersome, it is recommended to directly use the form of
.asset
file to configure the data.
Then configure the above json file in the corresponding area in the "Project Settings" window.
Use I18N text in code.
gameObject.GetComponent<Text>().text = i18n.GetText("hello");
//The object "i18n" (type: II18N) can be obtained through dependency injection. or use facade.
For scenes that do not require coding, you can also use Component to set Text directly.
Most functions of TinaX are based on URI to management assets, such as pictures, audio, Prefabs, etc. This means that almost all functions can provide localized services through the i18n system in the form of key/value table.
For other usages, please read the documentation.
Install via openupm
# Install openupm-cli if not installed.
npm install -g openupm-cli
# OR yarn global add openupm-cli
#run install in your project root folder
openupm add io.nekonya.tinax.i18n
Modify Packages/manifest.json
file in your project, and add the following code before "dependencies" node of this file:
"scopedRegistries": [
{
"name": "TinaX",
"url": "https://registry.npmjs.org",
"scopes": [
"io.nekonya"
]
},
{
"name": "package.openupm.com",
"url": "https://package.openupm.com",
"scopes": [
"com.cysharp.unitask",
"com.neuecc.unirx"
]
}
],
If after doing the above, you still cannot find the relevant Packages for TinaX in the "Unity Package Manager" window, You can also try refreshing, restarting the editor, or manually adding the following configuration to "dependencies" node.
"io.nekonya.tinax.i18n" : "6.6.1"
You can use the following to install and use this package in UPM GUI.
git://github.com/yomunsam/TinaX.I18N.git
If you want to set a target version, you can use release tag like #6.6.3
. for detail you can see this page: https://github.com/yomunsam/TinaX.I18N/releases
- com.neuecc.unirx :
https://github.com/neuecc/UniRx.git?path=Assets/Plugins/UniRx/Scripts
- io.nekonya.tinax.core :
git://github.com/yomunsam/TinaX.Core.git
if you install packages by git UPM, You need to install the dependencies manually. Or dependencies will installed automatically by NPM / OpenUPM
You can find out how to use the various features of TinaX in the documentation
The following excellent third-party libraries are used in this project:
- UniRx : Reactive Extensions for Unity