{"id":15578431,"url":"https://github.com/pandaplatform/l10n","last_synced_at":"2026-05-20T14:14:36.809Z","repository":{"id":57035337,"uuid":"69765487","full_name":"PandaPlatform/l10n","owner":"PandaPlatform","description":"[READ-ONLY] Subtree split of the Panda Localization Package","archived":false,"fork":false,"pushed_at":"2018-01-14T17:32:59.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"2.1","last_synced_at":"2025-03-29T07:42:46.048Z","etag":null,"topics":["framework","localization","panda-framework","php7"],"latest_commit_sha":null,"homepage":"https://github.com/PandaPlatform/framework","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/PandaPlatform.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":"2016-10-01T21:44:45.000Z","updated_at":"2022-02-12T14:38:12.000Z","dependencies_parsed_at":"2022-08-23T20:50:53.040Z","dependency_job_id":null,"html_url":"https://github.com/PandaPlatform/l10n","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandaPlatform%2Fl10n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandaPlatform%2Fl10n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandaPlatform%2Fl10n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandaPlatform%2Fl10n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PandaPlatform","download_url":"https://codeload.github.com/PandaPlatform/l10n/tar.gz/refs/heads/2.1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156011,"owners_count":20732357,"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":["framework","localization","panda-framework","php7"],"created_at":"2024-10-02T19:10:26.530Z","updated_at":"2026-05-20T14:14:36.731Z","avatar_url":"https://github.com/PandaPlatform.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Panda Localization Package\n\nThis is the localization package of the Panda Platform. It provides a simple translation structure and process for your code.\n\n[![StyleCI](https://styleci.io/repos/69765487/shield?branch=master)](https://styleci.io/repos/69765487)\n\n## Installation\n\nThis package is part of the [Panda Framework](https://github.com/PandaPlatform/panda-framework) but it's also available as a single package.\n\n### Through the composer\n\nAdd the following line to your `composer.json` file:\n\n```\n\"panda/l10n\": \"^2.0\"\n```\n\n## Usage\n\nThe Translation class works using a given `FileProcessor` for the translation files. It uses the `FileProcessor` as a getter to get translations.\n\nEach Processor can have its own implementation of handling files based on locale and packages.\n\n### Translator\n\nThe Translator interface can be used across the entire application. You have to define the application's `FileProcessor` first and then you can load your translations freely.\n\nExample:\n\n```php\n\nuse Panda\\Localization\\Translation\\JsonProcessor;\nuse Panda\\Localization\\Translator;\n\n// Initialize the desired processor\n$processor = new JsonProcessor('your_base_directory_for_translations');\n\n// Initialize the Translator\n$translator = new Translator($processor);\n\n// Get a desired translation\n$translation = $translator-\u003etranslate('translation-key', 'package-name', 'en_US', 'default-translation-value-if-empty');\n```\n\n### JsonProcessor\n\nWhen using the `JsonProcessor`, the translation files should be in the given structure:\n\n```\nBASE_DIRECTORY/{locale}/{package}.json\n```\n\nIf no package name is given (or an empty package name), the 'default' package will be used (`default.json`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaplatform%2Fl10n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpandaplatform%2Fl10n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaplatform%2Fl10n/lists"}