{"id":15914645,"url":"https://github.com/68publishers/translation-bridge","last_synced_at":"2026-02-09T00:33:57.673Z","repository":{"id":55692073,"uuid":"312704897","full_name":"68publishers/translation-bridge","owner":"68publishers","description":"🌉 Integrations of translation components and '68 Publishers bundles","archived":false,"fork":false,"pushed_at":"2024-08-06T00:58:02.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-23T11:52:53.608Z","etag":null,"topics":["bridge","bundle","extension","nette","nette-extension","translation"],"latest_commit_sha":null,"homepage":"","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/68publishers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-11-13T23:19:03.000Z","updated_at":"2024-08-06T00:35:30.000Z","dependencies_parsed_at":"2024-10-27T16:33:35.973Z","dependency_job_id":"66b2514d-e4eb-41f5-aa43-ee4ba575970d","html_url":"https://github.com/68publishers/translation-bridge","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.15384615384615385","last_synced_commit":"32f09a865789ec01518feab6edba632b060c4dba"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/68publishers/translation-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftranslation-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftranslation-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftranslation-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftranslation-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/68publishers","download_url":"https://codeload.github.com/68publishers/translation-bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/68publishers%2Ftranslation-bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29251545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bridge","bundle","extension","nette","nette-extension","translation"],"created_at":"2024-10-06T17:04:52.866Z","updated_at":"2026-02-09T00:33:57.658Z","avatar_url":"https://github.com/68publishers.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eTranslation bridge\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/68publishers/translation-bridge/actions\"\u003e\u003cimg alt=\"Checks\" src=\"https://badgen.net/github/checks/68publishers/translation-bridge/master\"\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/68publishers/translation-bridge?branch=master\"\u003e\u003cimg alt=\"Coverage Status\" src=\"https://coveralls.io/repos/github/68publishers/translation-bridge/badge.svg?branch=master\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/68publishers/translation-bridge\"\u003e\u003cimg alt=\"Total Downloads\" src=\"https://badgen.net/packagist/dt/68publishers/translation-bridge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/68publishers/translation-bridge\"\u003e\u003cimg alt=\"Latest Version\" src=\"https://badgen.net/packagist/v/68publishers/translation-bridge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/68publishers/translation-bridge\"\u003e\u003cimg alt=\"PHP Version\" src=\"https://badgen.net/packagist/php/68publishers/translation-bridge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\nThe package contains bridges for the following integrations of [symfomy/translation](https://symfony.com/doc/current/translation.html) into [Nette Framework](https://nette.org):\n\n- [contributte/translations](https://github.com/contributte/translation)\n\nWhy? Because we want to keep our bundles independent of specific integrations so applications can use any of the integrations mentioned above and will be still compatible with our bundles.\n\n## Installation\n\nThe best way to install 68publishers/translation-bridge is using Composer:\n\n```sh\n$ composer require 68publishers/translation-bridge\n```\n\n## Configuration\n\n```neon\nextensions:\n    # if you are using contributte/translation:\n    translation_bridge: SixtyEightPublishers\\TranslationBridge\\Bridge\\Nette\\DI\\ContributteTranslationBridgeExtension\n```\n\n## Usage\n\n### Translation Resources Provider\n\nExtensions can provide paths with translation resources.\n\n```php\nuse Nette\\DI\\CompilerExtension;\nuse SixtyEightPublishers\\TranslationBridge\\Bridge\\Nette\\DI\\TranslationProviderInterface;\n\nfinal class MyBundleExtension extends CompilerExtension implements TranslationProviderInterface\n{\n    public function getTranslationResources(): array\n    {\n        return [\n            __DIR__ . '/translations',\n        ];\n    }\n}\n```\n\n### Translator Aware\n\nAll services that implement an interface `TranslatorAwareInterface` will automatically receive the Translator instance.\n\n```php\n\u003c?php\n\nuse SixtyEightPublishers\\TranslationBridge\\TranslatorAwareTrait;\nuse SixtyEightPublishers\\TranslationBridge\\TranslatorAwareInterface;\n\nfinal class MyService implements TranslatorAwareInterface\n{\n    use TranslatorAwareTrait;\n\n    public function doSomething(): void\n    {\n        $this-\u003etranslator-\u003etranslate('....');\n    }\n}\n```\n\n### Prefixed Translator Factory\n\nThe Container contains an autowired service of type `PrefixedTranslatorFactoryInterface` for creating prefixed translators.\n\n```php\n\u003c?php\n\nuse Nette\\Localization\\Translator;\nuse SixtyEightPublishers\\TranslationBridge\\PrefixedTranslatorFactoryInterface;\n\nfinal class MyService\n{\n    private Translator $translator;\n\n    public function __construct(PrefixedTranslatorFactoryInterface $prefixedTranslatorFactory)\n    {\n        $this-\u003etranslator = $prefixedTranslatorFactory-\u003ecreate('MyService');\n    }\n}\n```\n\n### Translator Localizer\n\nThe Container contains the service of type `TranslatorLocalizerInterface` for manipulating with the Translator locale.\n\n```php\nuse SixtyEightPublishers\\TranslationBridge\\Localization\\TranslatorLocalizerInterface;\n\nfinal class MyService\n{\n    public function __construct(\n        private readonly TranslatorLocalizerInterface $localizer\n    ) {}\n\n    public function doSomething(): void\n    {\n        # Get the current locale\n        $locale = $this-\u003elocalizer-\u003egetLocale();\n\n        # Set the new locale\n        $this-\u003elocalizer-\u003esetLocale('cs_CZ');\n    }\n}\n```\n\n### Translator Locale Resolver\n\nThe Translator's locale can be resolved with own resolvers like this:\n\n```php\n\u003c?php\n\nuse Nette\\Localization\\Translator;\nuse SixtyEightPublishers\\TranslationBridge\\Localization\\TranslatorLocaleResolverInterface;\n\nfinal class MyLocaleResolver implements TranslatorLocaleResolverInterface\n{\n    public function resolveLocale(Translator $translator) : ?string\n    {\n        # return a valid locale or NULL\n    }\n}\n```\n\n```neon\nservices:\n\t- MyLocaleResolver\n```\n\n## Contributing\n\nBefore opening a pull request, please check your changes using the following commands\n\n```bash\n$ make init # to pull and start all docker images\n\n$ make cs.check\n$ make stan\n$ make tests.all\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F68publishers%2Ftranslation-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F68publishers%2Ftranslation-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F68publishers%2Ftranslation-bridge/lists"}