Giter Club home page Giter Club logo

server-translations's Introduction

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.

Adding as dependency:

Add it to your dependencies like this:

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.

For versions before 1.19.4:

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.

Usage

To use it, 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"
}

server-translations's People

Contributors

thecatcore avatar gegy avatar patbox avatar madis0 avatar drexhd avatar mightyknight avatar ashhhleyyy avatar jerozgen avatar potatopresident avatar samekichi avatar weblate avatar altrisi avatar ivan-khar avatar haykam821 avatar skycatminepokie 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.