{"id":30138466,"url":"https://github.com/pfcode/symfony-i18n-comparator","last_synced_at":"2025-08-11T01:14:33.496Z","repository":{"id":57038340,"uuid":"372600368","full_name":"pfcode/symfony-i18n-comparator","owner":"pfcode","description":"Utility for comparison of duplicated translation files in Symfony projects.","archived":false,"fork":false,"pushed_at":"2021-05-31T18:57:26.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T01:39:52.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/pfcode.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":"2021-05-31T18:45:47.000Z","updated_at":"2021-05-31T18:57:28.000Z","dependencies_parsed_at":"2022-08-24T00:51:07.090Z","dependency_job_id":null,"html_url":"https://github.com/pfcode/symfony-i18n-comparator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pfcode/symfony-i18n-comparator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fsymfony-i18n-comparator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fsymfony-i18n-comparator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fsymfony-i18n-comparator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fsymfony-i18n-comparator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfcode","download_url":"https://codeload.github.com/pfcode/symfony-i18n-comparator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfcode%2Fsymfony-i18n-comparator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269816865,"owners_count":24479847,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":"2025-08-11T01:14:29.645Z","updated_at":"2025-08-11T01:14:33.488Z","avatar_url":"https://github.com/pfcode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# I18nComparatorBundle\nUtility for making a comparison of duplicated translation files in Symfony projects.\n\n### Use case\nThe case this util resolves is very specific - it's intended to help find differences between \ntranslation files belonging to the same domain and language, but saved in different formats \n(messages.en.xlf and messages.en.yml, for example).\n\nNote: Such differences should not occur under usual circumstances when using symfony/translation component.\nPlease see the _Example_ section below and check if this bundle actually solves your problem.\n\n### Installation\nYou can add this bundle into your Symfony project using Composer:\n```bash\ncomposer require pfcode/symfony-i18n-comparator\n```\n\nThis bundle requires at least Symfony 4.4 or 5.0 and PHP 7.1 or later and it's not intended to be used \non production environments.\n\n### Example\nLet's say you have two translation files in your project, that belong to the same domain and are in the same language:\n\n_translations/messages.en.xlf_:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cxliff xmlns=\"urn:oasis:names:tc:xliff:document:1.2\" version=\"1.2\"\u003e\n    \u003cfile source-language=\"fr\" target-language=\"en\" datatype=\"plaintext\" original=\"file.ext\"\u003e\n        \u003cheader\u003e\n            \u003ctool tool-id=\"symfony\" tool-name=\"Symfony\"/\u003e\n        \u003c/header\u003e\n        \u003cbody\u003e\n            \u003ctrans-unit id=\"XXXXXXX\" resname=\"nav.home\"\u003e\n                \u003csource\u003enav.home\u003c/source\u003e\n                \u003ctarget\u003eDashboard\u003c/target\u003e\n            \u003c/trans-unit\u003e\n            \u003ctrans-unit id=\"YYYYYY\" resname=\"nav.login\"\u003e\n                \u003csource\u003enav.login\u003c/source\u003e\n                \u003ctarget\u003eSign In\u003c/target\u003e\n            \u003c/trans-unit\u003e\n            \u003ctrans-unit id=\"ZZZZZZ\" resname=\"nav.logout\"\u003e\n                \u003csource\u003enav.logout\u003c/source\u003e\n                \u003ctarget\u003eLogout\u003c/target\u003e\n            \u003c/trans-unit\u003e\n        \u003c/body\u003e\n    \u003c/file\u003e\n\u003c/xliff\u003e\n```\n\n_translations/messages.en.yml_:\n```yaml\nnav:\n  home: 'Home'\n  login: 'Sign In'\n  logout: 'Sign Out'\n  search: 'Search something...'\n```\n\nThese translation files obviously have some differences. One of them has nav.search key missing and other messages have \ndifferent values. Comparing those files in a text editor would be painful.\n\nTo compare them at the logical level (translation keys, that is), you can use a command provided by this bundle:\n```\nbash-4.4# bin/console i18n-comparator:find-conflicts --translations-dir=translations\n+---------------------+-- messages.en ------+-----------------+\n| Key                 | messages.en.yml     | messages.en.xlf |\n+---------------------+---------------------+-----------------+\n| messages.nav.home   | Home                | Dashboard       |\n| messages.nav.logout | Sign Out            | Logout          |\n| messages.nav.search | Search something... |                 |\n+---------------------+---------------------+-----------------+\n```\n\nWith this command, searching for differences across various translation formats should be a lot easier.\n\n### Supported translation formats\nThis bundle registers a ComparatorFactory service and passes references to all known translation loaders \n(all services tagged by `translation.loader`) to it. So it supports all formats \nthat your Symfony installation already does.\n\n### License\nThis project is distributed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfcode%2Fsymfony-i18n-comparator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfcode%2Fsymfony-i18n-comparator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfcode%2Fsymfony-i18n-comparator/lists"}