A language localization generator for Minecraft
Project description
Babelbox
Babelbox allows you to write your language files in the CSV format and then generate Minecraft language files from them.
Creating translations in CSV gives you an easy overview over any errors or missing languages.
Table of contents
Installation
pip install babelbox
Usage
Finds all .csv
files in the source directory and generates minecraft language files
babelbox <src_dir> [dest_dir]
-p, --pretty-print Pretty print json
-i, -indent TEXT String used to indent json
-n, --prefix-filename Prefixes all variables with filename
--dry Dry run. Don't create any files
-v, --verbose
Examples
Basic usage:
We have these two CSV files containing our translations:
.../lang/items.csv:
Variable | en_us | de_de |
---|---|---|
item.stick.name | stick | Stock |
item.snowball.name | snowball | Schneeball |
.../lang/blocks.csv:
Variable | en_us | de_de |
---|---|---|
block.grass.name | grass | Gras |
block.diamond.name | diamond | Diamant |
Running babelbox .../lang/
makes Babelbox parse the CSV files and generate the following language files in the same folder:
.../lang/en_us.json:
{
"item.stick.name": "stick",
"item.snowball.name": "snowball",
"block.grass.name": "grass",
"block.diamond.name": "diamond"
}
.../lang/de_de.json:
{
"item.stick.name": "Stock",
"item.snowball.name": "Schneeball",
"block.grass.name": "Gras",
"block.diamond.name": "Diamant"
}
Shorten variable names:
We can use the --prefix-filename
flag to save ourselve some typing. If all variables in a CSV file share a common prefix, we can name the file to that prefix and let Babelbox prepend it.
.../lang/item.swords.csv
Variable | en_us | de_de |
---|---|---|
diamond.name | Diamond Sword | Diamantschwert |
gold.name | Gold sword | Goldschwert |
Running babelbox .../lang/ --prefix-filename
creates these two files:
.../lang/en_us.json
{
"item.swords.diamond.name": "Diamond Sword",
"item.swords.gold.name": "Gold sword",
}
.../lang/de_de.json
{
"item.swords.diamond.name": "Diamantschwert",
"item.swords.gold.name": "Goldschwert",
}
All variables have been prefixed with item.swords
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file babelbox-1.2.0.tar.gz
.
File metadata
- Download URL: babelbox-1.2.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f96736eea15a8ad842366789d8559f4aa75cd54067868cf120f58b34133e564 |
|
MD5 | e45fec0cf5606b54dd788813e3cf6e00 |
|
BLAKE2b-256 | 33330da80b1c90adfe7565d661c82ab6fcf88100a878d4095abee6340f9974bc |
File details
Details for the file babelbox-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: babelbox-1.2.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb6108c83347b10bdef2ab5983802bda0f54f4b0c9f0fedfdccee53fc24d9c22 |
|
MD5 | d60bad1d2c49f69c772f0cc4ae543b34 |
|
BLAKE2b-256 | aebb609cf4b73f04a4b5631dc77127abe6509ca70ef8c07af19560e93503043b |