Package: babelbox
BabelboxBabelbox allows you to write your language files in .csv files and then generate Minecraft language.json files from them.Creating translations in CSV gives you an easy overview over any errors or missing translations.InstallationUsageGetting startedSingle file sourceDirectory sourceShorten variable namesOrganize translations in foldersBeet pluginContributingChangelogInstallation$pipinstallbabelboxUsageReads translations from all sources and then generates minecraft language files for all language codes$# Single .csv file source$babelbox<file.csv>
$# Directory containing .csv files as source$babelbox<directory>
$# Multiple sources require output directory$babelbox<file1.csv><directory><file2.csv>-o<output_dir>All options:$babelboxSOURCES...-o,--outTheoutputdirectoryofthegeneratedfiles-p,--prefix-identifiersPrefixidentifierswiththeirpathrelativetotheirSOURCESentry--dialect[excel|excel-tab|unix]CSVdialectusedtoparseCSV.Dialectwillbeautomaticallydetectedofomitted-d,--delimiterCSVdelimiteroverwrite--quotecharCSVquotecharoverwrite-m,--minifyMinifygeneratedfiles-i,--indentIndentationusedwhengeneratingfiles--dryDryrun.Donnotgenerateanyfiles-v,--verboseIncreaseverbosity-q,--quietOnlyoutputerrorsGetting startedSingle file source:We have one.csvfile containing translations:resourcepack
  ⠇
  └╴lang
    └╴ items.csvItemen_usde_deitem.stick.﻿namestickStock# You can create comments like thisitem.snowball.﻿namesnowballSchneeballPassingitems.csvas a source to babelbox generates the language filesen_us.jsonandde_de.json:$babelboxresourcepack/.../lang/items.csven_us.json{"item.stick.name":"stick","item.snowball.name":"snowball",}de_de.json{"item.stick.name":"Stock","item.snowball.name":"Schneeball",}resourcepack
  ⠇
  └╴lang
    ├╴ items.csv
    ├╴ en_us.json
    └╴ de_de.jsonDirectory sourceWe have two.csvfiles containing translations:resourcepack
  ⠇
  └╴lang
    ├╴ items.csv
    └╴ blocks.csvitems.csvItemen_usde_deitem.stick.﻿namestickStockblocks.csvBlocken_usde_deblock.log.﻿namelogHolzstammPassing thelangdirectory as a source to babelbox generates the language filesen_us.jsonandde_de.json:$babelboxresourcepack/.../langen_us.json{"item.stick.name":"stick","block.log.name":"log",}de_de.json{"item.stick.name":"Stock","block.log.name":"Holzstamm",}resourcepack
  ⠇
  └╴lang
    ├╴ items.csv
    ├╴ blocks.csv
    ├╴ en_us.json
    └╴ de_de.jsonShorten variable names:We can use the--prefix-identifiersflag to save ourselve some typing. If all identifiers share a common prefix, we can name the file to that prefix and let Babelbox prepend it.resourcepack
  ⠇
  └╴lang
    └╴ item.swords.csvSwordsen_usde_dediamond.﻿nameDiamond SwordDiamantschwertgold.﻿nameGold swordGoldschwert$babelboxresourcepack/.../lang--prefix-identifiers
$# Or abbreviated$babelboxresourcepack/.../lang-pen_us.json{"item.swords.diamond.name":"Diamond Sword","item.swords.gold.name":"Gold sword",}de_de.json{"item.swords.diamond.name":"Diamantschwert","item.swords.gold.name":"Goldschwert",}All identifiers have been prefixed withitem.swords.Organize translations in foldersWe can save ourselves even more typing and organize our translations files in a directory structure:resourcepack
  ⠇
  └╴lang
    ├╴ item
    │  └╴ swords.csv
    └╴ block
      └╴ heavy.csvswords.csvSwordsen_usde_degold.﻿nameGold swordGoldschwertheavy.csvHeavy Blocksen_usde_delead.﻿nameLead BlockBleiblock$babelboxresourcepack/.../lang-pen_us.json{"item.swords.gold.name":"Gold sword","block.heavy.lead.name":"Lead Block",}de_de.json{"item.swords.gold.name":"Goldschwert","block.heavy.lead.name":"Bleiblock",}resourcepack
  ⠇
  └╴lang
    ├╴ item
    │  └╴ swords.csv
    ├╴ block
    │   └╴ heavy.csv
    ├╴ en_us.json
    └╴ de_de.jsonBeet pluginBabelbox can be used as abeetplugin.
Here is a example beet project using babelbox:beet.json
resourcepack
  ⠇
  └╴lang
    └╴item.swords.csvswords.csvSwordsen_usde_degold.﻿nameGold swordGoldschwertbeet.json{"output":"build","resource_pack":{"load":["resourcepack"]},"pipeline":["babelbox.integration.beet"],"meta":{"babelbox":{"load":["resourcepack/assets/minecraft/lang"],"prefix_identifiers":true}}}Runningbeet buildgenerates the language files:beet.json
resourcepack
  ⠇
  └╴lang
    └╴item.swords.csv
build
  ⠇
  └╴lang
    ├╴en_us.json
    └╴de_de.jsonContributingContributions are welcome. Make sure to first open an issue discussing the problem or the new feature before creating a pull request. The project usespoetry. Setup dev environment withinvoke:$invokeinstallRun tests:$invoketestThe project followsblackcodestyle. Import statements are sorted withisort. Code formatting and type checking is enforced usingpre-commit