gbl / CrowdinTranslate

A Minecraft Mod that automatically updates translations from CrowdIn to MC .json files
MIT License
26 stars 12 forks source link

Request: specifying JSON file name #2

Closed Hugman76 closed 3 years ago

Hugman76 commented 3 years ago

This is a simple request for a new variable in the build.gradle file to allow for different JSON file name. Crowdin allows for way more than only one JSON file per project and so I'm taking advantage of that by putting all translatable strings from all my mods into a single project: Screenshot So in one case I would have this in my build.gradle:

crowdintranslate.setCrowdinProjectname 'dawnteam'
crowdintranslate.setMinecraftProjectName 'dawn'
crowdintranslate.setFileName 'dawn'
gbl commented 3 years ago

Going to implement this, but it'll take me a bit, as I want to do it in a way to have it work with the dynamic downloading part as well. And I guess the whatever.json file should be downloaded as en_us.json in that case so the untranslated version of the mod has strings to use, too.

gbl commented 3 years ago

Ok - please don't tell everybody, and especially, don't use that with the JIJ feature as a client-side-download-mod, because it hasn't been tested much, but what you asked for should work from within gradle:

classpath 'de.guntram.mcmod:crowdin-translate:1.3-pre1-hugman'
...
crowdintranslate.crowdinProjectName = 'dawnteam'
crowdintranslate.minecraftProjectName = 'dawn'
crowdintranslate.jsonSourceName = 'dawn'
//crowdintranslate.minecraftProjectName = 'mubble'
//crowdintranslate.jsonSourceName = 'mubble'
crowdintranslate.verbose = true

Depending on whether or not you comment out the "dawn" or "mubble" defs, you get the corresponding files into the corresponding assets directory. Please tell me if it works for you.

Hugman76 commented 3 years ago

Thanks a ton! It works very well 👍