This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Translation
Nicolas Grekas 430b884570 Merge branch '5.1'
* 5.1:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
  [DI] Remove preload primitive types
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
  [Validator] allow passing a validator to Validation::createCallable()
2020-05-20 19:44:07 +02:00
..
Catalogue Merge branch '4.4' into 5.0 2020-03-16 13:10:54 +01:00
Command Merge branch '4.4' into 5.0 2020-02-04 08:41:34 +01:00
DataCollector Merge branch '4.4' into 5.0 2019-12-28 16:09:49 +01:00
DependencyInjection [Translation] Bump dependencies and apply upstream parameter types. 2019-08-16 01:12:56 +02:00
Dumper Use some PHP 5.4 constants unconditionally 2020-03-05 10:39:55 +01:00
Exception Mark ExceptionInterfaces throwable 2018-08-29 17:58:00 +02:00
Extractor Fix CS 2020-02-04 10:32:40 +01:00
Formatter Merge branch '4.4' into 5.0 2020-04-12 18:45:47 +02:00
Loader Merge branch '5.0' 2020-05-04 17:54:21 +02:00
Reader Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
Resources bump icu 67.1 2020-05-19 19:12:53 +02:00
Tests Merge branch '5.0' 2020-05-16 11:12:54 +02:00
Util Merge branch '4.4' into 5.0 2020-03-15 15:33:06 +01:00
Writer Merge branch '4.4' into 5.0 2020-03-15 15:33:06 +01:00
.gitattributes add missing gitattributes for phpunit-bridge 2020-03-27 17:54:36 +01:00
.gitignore
CHANGELOG.md Support name attribute on the xliff2 translator loader 2020-01-20 13:02:40 +01:00
composer.json Merge branch '5.1' 2020-05-20 19:44:07 +02:00
DataCollectorTranslator.php [HttpKernel] allow cache warmers to add to the list of preloaded classes and files 2020-04-04 11:52:45 +02:00
IdentityTranslator.php Fix CS 2020-02-04 10:32:40 +01:00
LICENSE Update year in license files 2020-01-01 12:03:25 +01:00
LoggingTranslator.php Leverage PHP8's get_debug_type() 2020-03-16 17:46:21 +01:00
MessageCatalogue.php Merge branch '4.4' into 5.0 2020-05-04 16:05:24 +02:00
MessageCatalogueInterface.php [5.0] [Translator] Add parameter type-hints where possible 2019-07-05 07:31:44 +02:00
MetadataAwareInterface.php [5.0] [Translator] Add parameter type-hints where possible 2019-07-05 07:31:44 +02:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
README.md [Translation][Debug] Add installation and minimal example to README 2020-02-03 16:10:40 +01:00
Translator.php Merge branch '5.0' 2020-05-16 11:12:54 +02:00
TranslatorBagInterface.php [5.0] [Translator] Add parameter type-hints where possible 2019-07-05 07:31:44 +02:00

Translation Component

The Translation component provides tools to internationalize your application.

Getting Started

$ composer require symfony/translation
use Symfony\Component\Translation\Translator;

$translator = new Translator('fr_FR');
$translator->addResource('array', [
    'Hello World!' => 'Bonjour !',
], 'fr_FR');

echo $translator->trans('Hello World!'); // outputs « Bonjour ! »

Resources