Coder Social home page Coder Social logo

tinax.i18n's Introduction

TinaX Framework - Internationalization (I18N).

logo

LICENSE 996.icu LICENSE

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 :



QuickStart

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.

1592018075032

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 this package

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

Install via npm (UPM)

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"

Install via git UPM:

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



Dependencies

if you install packages by git UPM, You need to install the dependencies manually. Or dependencies will installed automatically by NPM / OpenUPM




Learn TinaX

You can find out how to use the various features of TinaX in the documentation


Third-Party

The following excellent third-party libraries are used in this project:

  • UniRx : Reactive Extensions for Unity

tinax.i18n's People

Contributors

yomunsam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.