Code Monkey home page Code Monkey logo

botc-translations's Introduction

BotcTranslations

TL;DR: If you want to find translated scripts to play on clocktower.online or Nara, they are in assets/scripts.

This repo contains scripts to generate JSON files for use on clocktower.online or Nara as well as CSV files for the google sheet in which we keep translations for abilities, names, and various reminders.

You can find already generated script JSON files in assets/scripts and the google sheet is here.

The language we use is Elixir (see how to install it).

Adding a new locale

Open lib/constants.ex and add the locale to the @known_locales module variable at the top of the file.

Then either genereate your CSV from a JSON file or the other way around. You'll find instructions on how to do that in this README.

Google Sheet / CSV

We use a google sheet to edit, discuss, and maintain translations of the game, mainly for digital use on clocktower.online or Nara. This format should also be usable to generate translations for the physical copy of the game one day.

Take a look at the english tab which you will need to duplicate for your own language: EN. We download these tabs in CSV format and run our script on them to generate JSON files.

Running the scripts

From CSV to JSON

Full roles JSON

Once we have the CSV file for our language, we can run a script that will generate a JSON file in the clocktower.online format.

mix run generate_json_from_csv.exs

The result will be at assets/json/<LOCALE>.json

Generating translated basic and custom scripts

Simply run the following command to regenerate custom scripts in all locales:

mix run generate_scripts.exs

The files used to generate these custom scripts are:

To generate new custom scripts, simply add a script definition file in assets/script_definitions and run mix run generate_scripts.exs again

From JSON to CSV

If you already have the JSON file containing all roles for your language, then you can also transform it into a CSV and import it in the google sheets

mix run generate_csv_from_json.exs

The result will be at assets/csv/<LOCALE>.csv

Using the generated JSON

The generated json files match the format used on clocktower.online.

You can use them directly as custom scripts (but every role will be available in your game, which is maybe a bit much!) or you can remove the roles you don't want before using them as custom scripts.

We will work on helping you generate ready-made scripts soon (see Contributions)

Contributions

The best way to help is to add your language to the google sheet (by duplicating EN) and then pinging RealVidy#2485 on Discord.

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.