{"id":20504456,"url":"https://github.com/tiknil/json-excel-translations","last_synced_at":"2025-04-13T20:50:19.537Z","repository":{"id":37740992,"uuid":"173142854","full_name":"tiknil/json-excel-translations","owner":"tiknil","description":"Two simple python scripts to convert JSON translation files to excel and excel files to JSON translation files","archived":false,"fork":false,"pushed_at":"2023-07-24T09:28:29.000Z","size":16,"stargazers_count":10,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T11:11:56.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiknil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-28T16:02:58.000Z","updated_at":"2024-11-01T08:50:36.000Z","dependencies_parsed_at":"2024-11-15T19:38:16.383Z","dependency_job_id":"33f5c758-0eb6-4dae-bb7a-000b5f227ec1","html_url":"https://github.com/tiknil/json-excel-translations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Fjson-excel-translations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Fjson-excel-translations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Fjson-excel-translations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Fjson-excel-translations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiknil","download_url":"https://codeload.github.com/tiknil/json-excel-translations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782279,"owners_count":21160716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T19:38:07.579Z","updated_at":"2025-04-13T20:50:19.510Z","avatar_url":"https://github.com/tiknil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Localize Json\n\nTwo python script to convert JSON translation files to excel and the other way around. It has been created to work with [I18n](https://github.com/mashpie/i18n-node).\n\nThe character used of object nesting in json is the dot `.`\n\nThe following json structure:\n```json\n{\n  \"app\": {\n    \"name\": \"App Name\"\n  }\n}\n```\nProduces a key named `app.name`\n\nFlat json files are also supported (note: use `-fk` argument for excelToJson):\n```json\n{\n  \"app.name\": \"App Name\"\n}\n```\n\n## Installation\n\nClone the project:\n\n```bash\ngit clone https://github.com/tiknil/json-excel-translations.git\ncd json-excel-translations\n```\n\nSetup the virtualenv with the setup script:\n```bash\nchmod +x setup.sh\n./setup.sh\n```\n\nNow you can use the script:\n```bash\n./jsonToExcel.py -o output/file -i input/folder\n./exceltoJson.py -i input/file -o output/folder\n```\n\nYou can use the link script to setup the scripts in your `/usr/local/bin` folder, so they can be used from everywhere:\n\n```bash\nsudo ./link.sh\njsonToExcel -o output/file -i input/folder\nexceltoJson -i input/file -o output/folder\n``` \n\n## Usage\n\n\n### jsonToExcel\nThe scripts assumes a folder of `.json` files named after their respective locale: `it.json`, `en.json`, ...\n\nIt creates an excel file where each column represents a locale and each row is a translation key.\n\n\nThe key are obtained from the primary language (default `en`, it can be configured using the `-p` argument)\n\nAssume we have a folder, named `translations`, with 2 files: `it.json` and `en.json`, where the primary language is `it`.\n\nGiven the command:\n```\njsonToExcel.py -o translations.xlsx -i translations -p it\n```\n\nIt produces an excel file named translations.xlsx structured as:\n\n| **key**  | **it**  | **en**   |\n|---|---|---|\n| keyName  | italiano  | inglese  |\n\n#### Options\n- `-h` Instructions on the script usage \n- `-o`/`--output-file` where the excel file must be created (default `output/translations.xlsx`)\n- `-i`/`--input-dir` where the translation files are located (default `translations/`)\n- `-k`/`--key-name` name of the excel column containing the keys (default `key`)\n- `-n`/`--name` a name of the excel sheet (default `Translations`)\n- `-p`/`--primary` a translation file name without .json to be used as the primary language (default `en`)\n- `-l`/`--locales` A comma-separated list of the locales to select (default all json files in the input directory)\n\n\n### excelToJson\n\n\nGiven an excel files structured as in the table below\n\n| **key**  | **locale1**  | **locale2**   |\n|---|---|---|\n| keyName  | locale1 string  | locale2 string  |\n| keyName2  | ...  | ...  |\n\nIt produces a json file for each locale containing the corresponding translations.\n\n#### Options\n- `-h` Instructions on the script usage \n- `-o`/`--output-dir` outpit directory for the translation files (default `translations/`)\n- `-i`/`--input-file` location of the excel input file (default `output/translations.xlsx`)\n- `-e`/`--empty` set this flag to also include keys without a translation (default is to NOT include keys without a translation, assuming there is a fallback mechanism in your app for such strings)\n- `-k`/`--key-name` name of the excel column containing the keys (default `key`)\n- `-is`/`--indent-size` size of the Json indentation (default is `4`)\n- `-fk`/`--flat-keys` set this flag to keep composite keys in output json files which will make them flat key-values objects (default is to split composite keys by .)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiknil%2Fjson-excel-translations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiknil%2Fjson-excel-translations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiknil%2Fjson-excel-translations/lists"}