{"id":15097575,"url":"https://github.com/gertjanreynaert/ritm","last_synced_at":"2026-01-06T19:04:58.674Z","repository":{"id":48315247,"uuid":"188427363","full_name":"GertjanReynaert/RITM","owner":"GertjanReynaert","description":"React Interactive Translations Manager","archived":false,"fork":false,"pushed_at":"2021-08-02T04:16:36.000Z","size":4973,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T16:19:53.226Z","etag":null,"topics":["ci","cli","i18n","json","manager","translations","yaml"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GertjanReynaert.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-24T13:34:09.000Z","updated_at":"2019-07-12T12:56:35.000Z","dependencies_parsed_at":"2022-09-21T11:30:36.444Z","dependency_job_id":null,"html_url":"https://github.com/GertjanReynaert/RITM","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/GertjanReynaert%2FRITM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GertjanReynaert%2FRITM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GertjanReynaert%2FRITM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GertjanReynaert%2FRITM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GertjanReynaert","download_url":"https://codeload.github.com/GertjanReynaert/RITM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245878929,"owners_count":20687297,"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":["ci","cli","i18n","json","manager","translations","yaml"],"created_at":"2024-09-25T16:23:43.664Z","updated_at":"2026-01-06T19:04:58.579Z","avatar_url":"https://github.com/GertjanReynaert.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RITM\n\nRITM will help you in managing your translations.\nHereby it will give you the current status of your translation, removing\ntranslations that aren't used any longer, adding those that are missing, and\ntelling you what keys are still not translated.\n\nYou'll still need to update the translations manually in your json files, but\nnow you know what messages you still need to update.\n\n## Installing\n\n```\nyarn add --dev ritm\n```\n\nor\n\n```\nnpm i --save-dev ritm\n```\n\n## Setup\n\n### Basic\n\nThis is an example of the most basic usage of this plugin, in the API documentation below you can find more options.\n\nCreate a script in your package.json\n\n```json\n{\n  \"scripts\": {\n    \"manage:translations\": \"node manageTranslations.js\"\n  }\n}\n```\n\nCreate a file with your config you can run with the npm script\n\n```js\n// manageTranslations.js\nconst { manageTranslations } = require('ritm');\n\n// es2015 import\n// import { manageTranslations } from 'ritm';\n\nmanageTranslations({\n  fileType: 'json',\n  baseLanguage: 'en',\n  translatedLanguages: ['nl'], // any language you want to enforce\n  optionalLanguages: ['ja'], // any language you want info but not enforced\n  translationsDirectory: 'src/i18n' // path to translations from project folder\n});\n```\n\nRun the translation manager with your new npm script\n\n```\nnpm run manage:translations\n```\n\n## Usage\n\nNow you can check the status of your translations by just running the script. Then\nyou can change the missing translations in the translation files.\n\nIf you encounter messages that are identical in translation in a certain\nlanguage as in your default language (example: Dashboard (english) = Dashboard (dutch)),\nthen you can approve the translation-key in the language specific status\nfile. This will prevent the message from showing up as untranslated when\nchecking the translations status.\n\n## API\n\n### manageTranslations\n\nThis will maintain all translation files. Based on your config, you will get\nper specified language the keys that are missing translations. This script will\nalso remove keys in language files if they aren't used anymore in the base\nlanguage file, and reversely, add keys to the language files that are missing\nwhen compared to the base language file.\n\nIt will also maintain a status file per language\nwhere you can specify translation keys where the translation is identical to\nthe default message. This way you can avoid untranslated message warnings for\nthese messages.\n\n#### Status files\n\nWhen you run manageTranslations a new status file will be created. Here you'll\nfind an object shaped like this:\n\n```\n{\n  \"approved\": [],\n  \"pending\": []\n}\n```\n\nEvery time untranslated keys are found they'll be added to pending. If that same\nkey get's translated it'll automatically be removed from pending.\n\nIn case you can't translate because the translation is identical, you can\nmanually move the key to approved. This way the key will no longer show up as\nuntranslated.\n\nYou'll notice that once a key is removed from the translations files, it will\nautomatically be removed from the `approved` list, and the `approved` list will\nalways be sorted based on the order keys appear in in your base translations file.\n\n#### Config\n\n- `fileType` (required),\n\n  - extension of your translation files, both `json` and `yaml` are supported\n  - options: 'json' | 'yaml' | 'yml'\n\n- `baseLanguage` (string, required),\n\n  - this is the language you're using as single source of truth\n  - example: `en`\n\n- `translatedLanguages` (Array\u003cstring\u003e, required),\n\n  - this is the list of languages you want to enforce translations for\n  - example: `[\"nl\", \"fr\"]`\n\n- `optionalLanguages` (Array\u003cstring\u003e, required),\n\n  - this is the list of languages you want to maintain translation keys without\n    blocking ci\n  - example: `[\"ja\"]`\n\n- `translationsDirectory` (string, required),\n  - this is the path to your translations starting from the project folder\n  - example: `src/i18n`\n\n# License\n\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgertjanreynaert%2Fritm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgertjanreynaert%2Fritm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgertjanreynaert%2Fritm/lists"}