Giter VIP home page Giter VIP logo

hordes-loc's Introduction

hordes-loc

Build Status

Community driven text and localization repo for the browser game Hordes.io. This is a library of strings for all in-game texts, user interface labels, game-lore, item names & descriptions, etc.

This repository is a public submodule of the beta.hordes.io sourcecode, containing a build script to compile files found in loc/ into individual language specific .json files. Translations for any respective language do not have to be complete, as the build script will fall back to other translations (generally English) for any strings that have not been translated for the language type.

Usage

Installation. Building requires Node.js & NPM: nodejs.org

npm install

Building the generator file, then compiling the languages into dist/

npm run generate

Resources for first timers and git beginners

Contributing

For your first translations, please fork the repo and submit a pull request that way. If everything looks good, you will be added as a contributor.

New languages and translations are always welcome, so feel free to PR. The build system automatically detects new language types, and exports new files for each language type. Any language types are welcome. In order to contribute translations, simply add them to the respective files in the loc/ directory. Make sure to lint your code before committing (npm run lint). Join our Discord if you need help.

If you want to check the status of any translation, simply run the build script, which informs us about translation status.

Detecting loc types...
  Found languages en, de
Compiling...
  en -> 8/8 (100%)
  de -> 5/8 (62%)
Exporting...
  en -> en.json
  de -> de.json

Examples

Lets say we want to add a German translation to some of the basic Strings for the Archer class. We navigate to loc/classes/archer.js, and find:

export default {
  // The class name
  name: {
    en: 'Archer'
  },
  // Class description, visible during character creation
  description: {
    en: 'Archers deal high single target damage and bursty ...',
  }
}

All strings are contained in objects that hold translations for any amount of languages. The default language will generally be enfor English, but any language can be added. In this case, we can see the Archers name being held in the name: { ... } Object, and the English translation is already present.

To add a translation, simply add a ISO639-2 Language code (en, de, fr...) with your translation. For example, to add a German translation for the Archers name:

  // The class name
  name: {
    en: 'Archer',
    de: 'Jäger'
  }

We do not have to add a German translation for the descriptions string. It is perfectly fine if the translations are incomplete, as the build system will automatically resolve the translations to English. Commit, lint and PR, and the translation will be available in game.

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.