# symfony/translation

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/symfony-translation).**

6,607 stars · 90 forks · PHP · MIT

## Links

- GitHub: https://github.com/symfony/translation
- Homepage: https://symfony.com/translation
- awesome-repositories: https://awesome-repositories.com/repository/symfony-translation.md

## Topics

`component` `php` `symfony` `symfony-component`

## Description

Symfony Translation is a PHP library and framework component for internationalizing applications. It provides a complete system for managing message catalogs, handling locale-aware string translation, and formatting messages using ICU MessageFormat syntax to support pluralization, gender, and conditional selection. The component organizes translatable strings into named domains, supports key-based lookup that decouples source text from localized versions, and offers deferred rendering through translatable objects that store parameters and render only when output is needed.

The library distinguishes itself through its comprehensive XLIFF support across versions 1.2 through 2.2, including the ability to attach contextual notes for translators and handle plural, gender, and select variations. It provides a push-pull interface for synchronizing translation content with third-party services, a fallback locale chain resolution system, and the ability to register custom loaders and dumpers for non-standard file formats. The component also includes console commands for extracting translation keys from source files, synchronizing catalogs, and identifying missing or unused translations.

Beyond core translation, the component integrates with broader application infrastructure including locale-aware routing, session-based locale persistence, and automatic locale detection from HTTP headers. It supports pseudolocalization for testing, an identity translator for development, and validation of translation file syntax. The library manages translation resource files organized by domain, locale, and format, with override priority across application bundles.

## Tags

### Web Development

- [Internationalization Libraries](https://awesome-repositories.com/f/web-development/internationalization-libraries.md) — Provides a complete internationalization library for PHP with message catalogs, locale handling, and ICU MessageFormat.
- [Service Implementation Selectors](https://awesome-repositories.com/f/web-development/backend-as-a-service-implementations/service-implementation-selectors.md) — Provides a mechanism to override autowired services by specifying a different service identifier for a constructor argument. ([source](https://symfony.com/doc/current/service_container.html))
- [URL Route Mapping](https://awesome-repositories.com/f/web-development/dynamic-content-resolution/url-route-mapping.md) — Maps URL patterns to controller methods, invoking the appropriate handler when a route matches. ([source](https://symfony.com/doc/current/controller.html))
- [Locale Fallback Mechanisms](https://awesome-repositories.com/f/web-development/internationalization-localization/locale-fallback-mechanisms.md) — Defines a prioritized chain of fallback locales for resolving missing translations. ([source](https://symfony.com/doc/current/translation.html))
- [Key-Based String Localizations](https://awesome-repositories.com/f/web-development/internationalization-localization/translation-management-platforms/site-localization/multi-language-content-delivery/locale-based-filters/content-translation/key-based-string-localizations.md) — Implements key-based string lookup that decouples source text from localized versions in translation catalogs.
- [Localized Routing](https://awesome-repositories.com/f/web-development/localized-routing.md) — Defines unique URL paths per locale and automatically sets the request locale on route match. ([source](https://symfony.com/doc/current/routing.html))
- [PHP Translation Libraries](https://awesome-repositories.com/f/web-development/php-translation-libraries.md) — Provides a complete translation framework for PHP applications with message catalogs, locale handling, and XLIFF support.
- [ICU MessageFormat Translators](https://awesome-repositories.com/f/web-development/php-translation-libraries/icu-messageformat-translators.md) — Provides a translator that processes ICU MessageFormat strings for complex pluralization and gender handling.
- [Template-to-Response Rendering](https://awesome-repositories.com/f/web-development/request-body-handling/dynamic-body-templating/response-templating/template-to-response-rendering.md) — Renders Twig templates into HTTP responses with provided variables. ([source](https://symfony.com/doc/current/controller.html))
- [Route Parameter Validation](https://awesome-repositories.com/f/web-development/route-parameter-validation.md) — Constrains route parameter values using regular expressions to ensure only matching URLs are accepted. ([source](https://symfony.com/doc/current/routing.html))
- [Route Parameter Accessors](https://awesome-repositories.com/f/web-development/routing-systems/routing-utilities/route-parameter-accessors.md) — Provides access to the matched route's name and parameters from the request object or global variable. ([source](https://symfony.com/doc/current/routing.html))
- [Route Parameter Captures](https://awesome-repositories.com/f/web-development/routing-systems/routing/parameter-handling-utilities/route-parameter-captures.md) — Allows route parameters to be optional with default values, enabling flexible URL matching. ([source](https://symfony.com/doc/current/routing.html))
- [Route Grouping](https://awesome-repositories.com/f/web-development/routing-systems/routing/route-definition-strategies/route-grouping.md) — Supports grouping routes under common prefixes and defaults to reduce repetition in route definitions. ([source](https://symfony.com/doc/current/routing.html))
- [Route Naming Systems](https://awesome-repositories.com/f/web-development/routing-systems/routing/route-naming-systems.md) — Implements a route naming system that generates URLs from named routes across controllers and templates. ([source](https://symfony.com/doc/current/routing.html))
- [Named Route Redirects](https://awesome-repositories.com/f/web-development/routing-systems/routing/route-naming-systems/named-route-redirects.md) — Configures routes to issue redirects to other URLs or named routes without writing a controller. ([source](https://symfony.com/doc/current/routing.html))
- [URL Routing Engines](https://awesome-repositories.com/f/web-development/url-routing-engines.md) — Provides a URL routing engine that generates URLs from named routes for links and redirects. ([source](https://symfony.com/doc/current/controller.html))
- [Translation Format Registrations](https://awesome-repositories.com/f/web-development/numeric-fields/numeric-formatting/custom-format-registrations/translation-format-registrations.md) — Registers custom loaders and dumpers for non-standard translation file formats.
- [Deferred Translation Objects](https://awesome-repositories.com/f/web-development/server-side-rendering/translation-rendering/deferred-translation-objects.md) — Ships translatable objects that defer rendering until output is needed, storing parameters for later use.
- [Session Flash Messaging](https://awesome-repositories.com/f/web-development/session-flash-messaging.md) — Stores a notification message in the session that is automatically removed after it is displayed to the user. ([source](https://symfony.com/doc/current/controller.html))

### Artificial Intelligence & ML

- [Translation Placeholder Substitutions](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-writing-assistants/prompt-customization/placeholder-variable-replacement/translation-placeholder-substitutions.md) — Replaces percent-delimited placeholders in translated messages with dynamic values. ([source](https://symfony.com/doc/current/translation.html))
- [Default Translation Domains](https://awesome-repositories.com/f/artificial-intelligence-ml/domain-to-domain-translation/default-translation-domains.md) — Sets a default translation domain for all translation calls within a template. ([source](https://symfony.com/doc/current/reference/twig_reference.html))
- [Session-Based Locale Persistence](https://awesome-repositories.com/f/artificial-intelligence-ml/human-in-the-loop-intervention-requests/session-based-locale-persistence.md) — Persists the user's locale in the session for consistent language across requests. ([source](https://symfony.com/doc/current/session.html))

### Content Management & Publishing

- [XLIFF Extraction and Compilation](https://awesome-repositories.com/f/content-management-publishing/content-management-systems/translation-management/xliff-extraction-and-compilation.md) — Reads translation strings from XLIFF XML files supporting versions 1.2 through 2.2 for structured localization.
- [ICU MessageFormat Placeholders](https://awesome-repositories.com/f/content-management-publishing/content-preservation-placeholders/variable-placeholder-preservations/icu-messageformat-placeholders.md) — Inserts variable values into translated strings using curly-brace placeholders processed by the ICU MessageFormatter. ([source](https://symfony.com/doc/current/reference/formats/message_format.html))
- [Translation String Contexts](https://awesome-repositories.com/f/content-management-publishing/content-management-systems/translation-management/linguistic-context-selection/translation-string-contexts.md) — Stores translator-facing context notes inside XLIFF 2 files to clarify the meaning or usage of strings. ([source](https://symfony.com/doc/current/reference/formats/xliff.html))

### Data & Databases

- [Message Domain Organization](https://awesome-repositories.com/f/data-databases/file-based-storage-systems/sorted-string-tables/string-translation-mappers/message-domain-organization.md) — Organizes translatable strings into named domains for separate translation files per application part. ([source](https://symfony.com/doc/current/reference/index.html))
- [Expression-Based Translation Messages](https://awesome-repositories.com/f/data-databases/expression-based-data-querying/linq-expression-translators/expression-based-translation-messages.md) — Evaluates dynamic expressions inside translation messages for context-aware output. ([source](https://symfony.com/doc/current/reference/index.html))

### Development Tools & Productivity

- [I18n Message Extraction](https://awesome-repositories.com/f/development-tools-productivity/i18n-message-extraction.md) — Provides a complete internationalization workflow with message catalogs, ICU MessageFormat, and locale-aware formatting.
- [String Localization](https://awesome-repositories.com/f/development-tools-productivity/localization-support/string-localization.md) — Loads a set of translated messages for a given locale and replaces source strings with their localized equivalents. ([source](https://cdn.jsdelivr.net/gh/symfony/translation@8.2/README.md))
- [String Translation Mappers](https://awesome-repositories.com/f/development-tools-productivity/localization-support/string-localization/ui-string-localizations/string-translation-mappers.md) — Translates a given message into the current language using the active locale and an optional translation domain. ([source](https://symfony.com/doc/current/reference/twig_reference.html))
- [Provider Push-Pull Interfaces](https://awesome-repositories.com/f/development-tools-productivity/interface-translation-providers/provider-push-pull-interfaces.md) — Provides a push-pull abstraction for synchronizing translation catalogs with third-party localization services.
- [Unused Translation Key Detectors](https://awesome-repositories.com/f/development-tools-productivity/missing-translation-captures/unused-translation-key-detectors.md) — Scans templates and code to identify translation keys that are missing from catalogs or no longer used. ([source](https://symfony.com/doc/current/translation.html))

### DevOps & Infrastructure

- [Automatic Service Registration](https://awesome-repositories.com/f/devops-infrastructure/cloud-infrastructure/cloud-computing-serverless/backend-as-a-service/authentication-as-a-service/automatic-service-registration.md) — Makes any class in the source directory available as a service that is instantiated only when requested and reused across the application. ([source](https://symfony.com/doc/current/service_container.html))
- [Callable Service Injectors](https://awesome-repositories.com/f/devops-infrastructure/cloud-infrastructure/cloud-computing-serverless/backend-as-a-service/authentication-as-a-service/callable-service-injectors.md) — Provides the ability to inject invokable services or closures as constructor arguments in the dependency injection container. ([source](https://symfony.com/doc/current/service_container.html))
- [Directory Service Importers](https://awesome-repositories.com/f/devops-infrastructure/cloud-infrastructure/cloud-computing-serverless/backend-as-a-service/authentication-as-a-service/directory-service-importers.md) — Provides a configuration method to register all classes in a directory as services using glob patterns. ([source](https://symfony.com/doc/current/service_container.html))
- [Service Containers](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/dependency-injection-systems/service-containers.md) — Provides a service container with autowiring, parameter injection, and service definition management.
- [Functional Interface Adapters](https://awesome-repositories.com/f/devops-infrastructure/function-as-a-service-platforms/functional-interface-adapters.md) — Provides a way to generate adapter classes that implement a single-method interface by forwarding to another service. ([source](https://symfony.com/doc/current/service_container.html))

### Programming Languages & Runtimes

- [Multiple Instance Registrators](https://awesome-repositories.com/f/programming-languages-runtimes/dynamic-class-creation/class-loading-mechanisms/shared-class-instance-loading/multiple-instance-registrators.md) — Provides the ability to register multiple services from the same class with different arguments and unique identifiers. ([source](https://symfony.com/doc/current/service_container.html))
- [Global Argument Binders](https://awesome-repositories.com/f/programming-languages-runtimes/function-argument-passing/default-arguments/global-argument-binders.md) — Provides global argument binding for constructor arguments across all services in the dependency injection container. ([source](https://symfony.com/doc/current/service_container.html))
- [Internationalized Templates](https://awesome-repositories.com/f/programming-languages-runtimes/templating-languages/internationalized-templates.md) — Applies the translation filter or tag to strings and variables inside Twig templates to output localized text. ([source](https://symfony.com/doc/current/translation.html))

### Security & Cryptography

- [HTTP Method Restrictions](https://awesome-repositories.com/f/security-cryptography/domain-access-restrictions/request-access-restrictions/controller-method-access-restrictions/http-method-restrictions.md) — Restricts which HTTP verbs a route responds to, enabling different behavior for GET, POST, and other methods. ([source](https://symfony.com/doc/current/routing.html))
- [Controller Argument Resolvers](https://awesome-repositories.com/f/security-cryptography/encryption-as-a-service/controller-argument-resolvers.md) — Provides automatic service injection into controller arguments via type-hinted parameters. ([source](https://symfony.com/doc/current/controller.html))
- [XLIFF File Loaders](https://awesome-repositories.com/f/security-cryptography/oauth-authentication/oauth-2-1-implementations/xliff-file-loaders.md) — Loads translation strings from XLIFF files supporting versions 1.2 through 2.2. ([source](https://symfony.com/doc/current/reference/formats/xliff.html))

### Software Engineering & Architecture

- [Locale Translation Files](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-formats-and-schemas/yaml-configuration-files/locale-translation-files.md) — Organizes translations into domain.locale.format files with override priority across application bundles. ([source](https://symfony.com/doc/current/translation.html))
- [Locale Fallback Chains](https://awesome-repositories.com/f/software-engineering-architecture/dependency-graph-resolution/concurrent-dependency-resolution/multi-source-dependency-resolution/fallback-resolution-strategies/locale-fallback-chains.md) — Defines prioritized fallback locale chains consulted when a translation key is missing from the primary locale.
- [Automatic Constructor Injection](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-providers/automatic-constructor-injection.md) — Resolves constructor type-hints to the matching service from the container without manual wiring. ([source](https://symfony.com/doc/current/service_container.html))
- [Pluralization and Interpolation Engines](https://awesome-repositories.com/f/software-engineering-architecture/localization-variable-injection/pluralization-and-interpolation-engines.md) — Converts XLIFF 2.2 PGS attributes into ICU MessageFormat strings for locale-aware plural, gender, and select handling. ([source](https://symfony.com/doc/current/reference/formats/xliff.html))
- [Pluralization Rules](https://awesome-repositories.com/f/software-engineering-architecture/localization/pluralization-rules.md) — Applies language-specific plural rules to select the correct grammatical form for a numeric count. ([source](https://symfony.com/doc/current/reference/formats/message_format.html))
- [ICU Message Parsing](https://awesome-repositories.com/f/software-engineering-architecture/parsing-strategies/icu-message-parsing.md) — Provides ICU MessageFormat parsing and processing for pluralization, gender, and conditional selection in translations.
- [Translation Message Domains](https://awesome-repositories.com/f/software-engineering-architecture/project-management-governance/repository-maintenance/project-organization/organization-ownership/data-domain-organizations/translation-message-domains.md) — Organizes translatable strings into named domains for modular translation catalogs across application parts.
- [Automatic Service Taggers](https://awesome-repositories.com/f/software-engineering-architecture/service-implementation-overriding/interface-based-service-swapping/automatic-service-taggers.md) — Provides automatic service tagging based on implemented interfaces for dependency injection configuration. ([source](https://symfony.com/doc/current/service_container.html))
- [Translation Keys](https://awesome-repositories.com/f/software-engineering-architecture/string-validation-and-normalization/translation-keys.md) — Translates strings by looking up semantic keys instead of source text. ([source](https://symfony.com/doc/current/best_practices.html))
- [Enabled Locale Restrictions](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-formats-and-schemas/yaml-configuration-files/locale-translation-files/enabled-locale-restrictions.md) — Restricts translation generation and routing to a configured set of enabled locales. ([source](https://symfony.com/doc/current/reference/configuration/framework.html))
- [Translation File Validators](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-formats-and-schemas/yaml-configuration-files/locale-translation-files/translation-file-validators.md) — Ships console commands to lint and validate YAML and XLIFF translation file syntax.
- [Conditional Message Selectors](https://awesome-repositories.com/f/software-engineering-architecture/conditional-branching/conditional-expression-returns/conditional-value-selection/conditional-message-selectors.md) — Selects between alternative translations based on a variable's value for gendered or conditional text. ([source](https://symfony.com/doc/current/reference/formats/message_format.html))
- [Translation Extraction](https://awesome-repositories.com/f/software-engineering-architecture/extensible-architectures/dashboard-extensions/translation-extraction.md) — Scans templates and code for translatable strings and updates translation files via console commands. ([source](https://symfony.com/doc/current/translation.html))
- [Source Code Translation Extractors](https://awesome-repositories.com/f/software-engineering-architecture/extensible-architectures/dashboard-extensions/translation-extraction/source-code-translation-extractors.md) — Scans PHP and Twig source files to extract translatable strings and synchronize translation catalogs.
- [Ordinal Formatters](https://awesome-repositories.com/f/software-engineering-architecture/number-to-word-converters/ordinal-formatters.md) — Provides locale-aware ordinal number formatting via the IntlNumberFormatter component. ([source](https://symfony.com/doc/current/reference/formats/message_format.html))

### User Interface & Experience

- [Accept-Language Locale Settings](https://awesome-repositories.com/f/user-interface-experience/localization-settings/accept-language-locale-settings.md) — Automatically sets the request locale from the Accept-Language header for locale-aware routing. ([source](https://symfony.com/doc/current/reference/configuration/framework.html))

### Part of an Awesome List

- [Dynamic Locale Switching](https://awesome-repositories.com/f/awesome-lists/devtools/internationalization-and-localization/dynamic-locale-switching.md) — Changes the application locale for a block of code or callback without affecting the rest of the request. ([source](https://symfony.com/doc/current/translation.html))

### Networking & Communication

- [Deferred Translation Objects](https://awesome-repositories.com/f/networking-communication/in-app-message-translators/deferred-translation-objects.md) — Provides Translatable objects that store message IDs and parameters for deferred rendering in templates. ([source](https://symfony.com/doc/current/translation.html))
