{"id":25044978,"url":"https://github.com/sectorlabs/lingui-multi","last_synced_at":"2025-04-14T02:01:43.426Z","repository":{"id":31992337,"uuid":"129108626","full_name":"SectorLabs/lingui-multi","owner":"SectorLabs","description":"A command line utility to generate multiple sub-catalogs for i18n from js-lingui message catalog.","archived":false,"fork":false,"pushed_at":"2024-01-03T11:48:18.000Z","size":568,"stargazers_count":3,"open_issues_count":8,"forks_count":2,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-03-27T15:56:02.263Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/SectorLabs.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}},"created_at":"2018-04-11T14:42:54.000Z","updated_at":"2022-01-23T14:41:46.000Z","dependencies_parsed_at":"2023-01-14T20:17:15.608Z","dependency_job_id":null,"html_url":"https://github.com/SectorLabs/lingui-multi","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Flingui-multi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Flingui-multi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Flingui-multi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Flingui-multi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SectorLabs","download_url":"https://codeload.github.com/SectorLabs/lingui-multi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809032,"owners_count":21164895,"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":"2025-02-06T05:20:07.745Z","updated_at":"2025-04-14T02:01:43.392Z","avatar_url":"https://github.com/SectorLabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lingui Multi\n[![CircleCI](https://circleci.com/gh/SectorLabs/lingui-multi/tree/master.svg?style=svg)](https://circleci.com/gh/SectorLabs/lingui-multi/tree/master)\n\nThis is a command line utility for generating multiple catalog files from a single (unified) messages JSON file using [js-lingui cli api](https://www.npmjs.com/package/@lingui/cli). Please ensure your application uses js-lingui before attempting to use this utility.\n\n# Setup\nAdd the following to your project's package.json file:\n```json\n \"lingui-multi\": {\n    \"sub_catalog_name\": {\n        \"srcPathIgnorePatterns\": [\n            \"\u003cignore_folder\u003e\",\n            \"\u003cignore_folder_2\u003e\"\n            ...\n        ]\n    },\n    \"sub_catalog_2_name\": {\n        \"srcPathIgnorePatterns\": [\n            \"\u003cignore_folder_3\u003e\",\n            \"\u003cignore_folder_4\u003e\"\n            ...\n        ]\n    }\n }\n```\n\nEach sub-catalog will include all the i18n translations used in the source paths defined for lingui in the package.json file minus the ignore patterns defined either in the lingui configuration, the lingui-multi sub-catalog configuration or in the environment variable named `LINGUI_MULTI_IGNORE_PATTERNS` (regular expression string, for example `\"ignore_folder_2|ignore_folder_3\"`).\n\n\n**Note: Lingui multi requires your existing messages.json file to be in `minimal` format. If it is in any other format please convert to the minimal format before using this utility**\n\n# Usage\nYou can extract new translations and metadata by executing the command provided by the package like so:\n```shell\n$ lingui-multi extract [path-to-application-package.json] [path-to-locale-directory]\n```\n\nThe extract command will extract new messages/translations to your messages.json file as well as create a messages.metadata.json file that is used in translation include/exclude logic during the sub-catalog assembly in the compile command.\n\nSub-catalog compilation can be done by executing:\n```shell\n$ lingui-multi compile [path-to-application-package.json] [path-to-locale-directory]\n```\n\nThe compile command uses messages.metadata.json file to figure out which translations to include/exclude from messages.json file based on the different sub-catalog configurations.\n\n**Please do not edit the messages.metadata.json file manually. All your changes/additions to the translations must only be done in messages.json file. No changes or translations from messages.metadata.json file is carried over to the compiled JS catalogs.**\n\nThe default value for package.json path is: `./package.json`\n\nThe default value for locales directory is: `./locale`\n\nThe utility will pick up lingui configuration and lingui-multi configuration from the package.json file and spit out catalog files in the locale directory with the format `\u003csub_catalog\u003e.messages.js` for each sub-catalog and a `messages.js` catalog with all translations excluding only those that are defined in the `lingui` settings in `package.json` file of the application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectorlabs%2Flingui-multi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsectorlabs%2Flingui-multi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectorlabs%2Flingui-multi/lists"}