This tool is designed to fix the pain of developing in one locale but having to have corresponding entries for newly added strings in all supported locales
- Make sure you have
virtualenvinstalled- Run
pip3 install virtualenvif you don't already have it
- Run
- Run
virtualenv translation - Run
source translation/bin/activateto activate this virtual environment - Run
pip install -r requirements.txtto configure all the dependencies - Run
chmod +x translatorand thensudo cp -r translator /usr/local/bin/translatorto be able to invoke the tool from anywhere
- Create a file called
translation-config.ymlin the root of your repository that you want to use this tool on - The
translation-config.ymlfile should look like this:
bundles:
- path: <path/to/your/bundle>
extension: <properties | json>
default_locale: <locale_key> # optional key. Defaults to en_US if not providedwhere each entry under bundles corresponds to a resource bundle that you want to manage with this tool
- Run
translator --generateto begin using the tool
- Everywhere snapshot_file is referred to, should probably change to snapshot_file_name because that's what the bundle object returns
- The reconciliator assumes order of insertion into a dictionary is preserved. When the processor parses all the files and converts them to a dictionary representation, the reconciliator assumes that this was done in order. Key value pairs in the dictionary representation outputted by the processor should appear in the same order they originally show up in the file
- Rename the tool to not be so boring :D
- Parallelize all the bundle operations. Can use threads or asyncio for this