{"id":21519136,"url":"https://github.com/dcspark/webpack-monorepo-translations-plugin","last_synced_at":"2026-07-18T14:47:17.069Z","repository":{"id":110085750,"uuid":"441025619","full_name":"dcSpark/webpack-monorepo-translations-plugin","owner":"dcSpark","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-27T17:07:08.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-17T16:52:38.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"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/dcSpark.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-23T01:11:07.000Z","updated_at":"2021-12-27T17:07:11.000Z","dependencies_parsed_at":"2023-05-21T07:45:15.640Z","dependency_job_id":null,"html_url":"https://github.com/dcSpark/webpack-monorepo-translations-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcSpark/webpack-monorepo-translations-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Fwebpack-monorepo-translations-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Fwebpack-monorepo-translations-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Fwebpack-monorepo-translations-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Fwebpack-monorepo-translations-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcSpark","download_url":"https://codeload.github.com/dcSpark/webpack-monorepo-translations-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcSpark%2Fwebpack-monorepo-translations-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35621145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-24T00:55:57.498Z","updated_at":"2026-07-18T14:47:17.064Z","avatar_url":"https://github.com/dcSpark.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plugins\n\n\n## Webpack Build i18n Plugin\n\nA webpack plugin for merging all language files in a monorepo. \n\n### Features\n* generates a global message file for translation systems.\n* generate a message file for each package with only the required translation strings\n* hooks into webpack and HMR for tracking language file changes\n\n\n### Dependencies\n* yarn workspaces\n* formatjs\n\n### How it works \nWhen added to your webpack config plugin list, BuildI18nPlugin will hook into 3 events:\n\n**compiler.hooks.initialize** - Initialize will scan all package.json files and look for the 'lang' property. \nThe `lang` property should provide the location to search for language files (e.g en-US.json)\nWith that information it will make sure directories needed, and paths are created.\n\n**compiler.hooks.watchRun** - The bulk of the work is done here, it scans, parses all message files and merged them. \nThis is then copied into the Root package for using it with translation services. It will also extract the required \nmessages for each subpackage and place a generated translation file for each locale in the particular package.\n\ne.g.\n```bash\n- rootPackage\n   | - lang/generated\n   | | - en-US.json (all messages merged)\n   | - packageOne/src/i18n/\n   | |--- locales/en-US.json (local messages/translations)\n   | |--- generated/en-US.json (subset of messages that apply only to this package)\n   | - packageTwo/app/i18n\n   | |--- locales/en-US.json \n   | |--- generated/en-US.json (subset of messages that apply only to this package)\n   | - packageThree/src/i18n\n   | |--- locales/en-US.json\n   | |--- generated/en-US.json (subset of messages that apply only to this package)\n```\n\n** compiler.hooks.afterCompile ** - Since the packages will point to a generated json file for loading their translations\nwe need a way ensure any change in the local translation will trigger a reload/rebuild of the generated files. We do that here.\n\n## FAQ\n**Which language should I use on my local files?**\nThe plugin language agnostic, plugin does not care about the language/locale of the message list. It tracks are available locales. \nSo if you want to do your translations locally on a subpackage you can, the plugin will take care of merging and organize them.\n\n**Why split message files?**\nThis allows to in the future package each subpackage independently with its own translations.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcspark%2Fwebpack-monorepo-translations-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcspark%2Fwebpack-monorepo-translations-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcspark%2Fwebpack-monorepo-translations-plugin/lists"}