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 605a5674a8 Merge branch '5.1' into 5.x
* 5.1:
  fix merge
  fix merge
  Remove branch-version (keep them for contracts only)
  [HttpClient] relax auth bearer format requirements
  [PHPUnitBridge] Silence errors from mkdir()
  [DependencyInjection] Preload classes with union types correctly.
  [Serializer] fix decoding float XML attributes starting with 0
  add missing dutch translations
  [TwigBridge] Remove "transchoice" from the code base
  Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
  Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
  [String] fix before/after[Last]() returning the empty string instead of the original one on non-match
  Add missing exporter function for PHPUnit 7
  [Validator] Add missing romanian translations
  [String] fix slicing in UnicodeString
  [Cache] Use correct expiry in ChainAdapter
  do not translate null placeholders or titles
2020-10-24 14:08: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.1 2020-09-02 18:23:27 +02:00
DataCollector Merge branch '4.4' into 5.0 2019-12-28 16:09:49 +01:00
DependencyInjection Enable "native_constant_invocation" CS rule 2020-09-02 18:06:40 +02:00
Dumper Merge branch '4.4' into 5.1 2020-09-02 18:23:27 +02:00
Exception Mark ExceptionInterfaces throwable 2018-08-29 17:58:00 +02:00
Extractor Rename Translatable class to TranslatableMessage 2020-10-07 07:51:02 +02:00
Formatter Merge branch '4.4' into 5.0 2020-05-30 22:12:43 +02:00
Loader Merge branch '4.4' into 5.1 2020-09-02 18:23:27 +02:00
Reader Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
Resources Rename Translatable class to TranslatableMessage 2020-10-07 07:51:02 +02:00
Tests Merge branch '5.1' into 5.x 2020-10-14 19:08:19 +02:00
Util Merge branch '4.4' into 5.1 2020-09-02 18:23:27 +02:00
Writer Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
.gitattributes add missing gitattributes for phpunit-bridge 2020-03-27 17:54:36 +01:00
.gitignore
CHANGELOG.md Rename Translatable class to TranslatableMessage 2020-10-07 07:51:02 +02:00
composer.json Merge branch '5.1' into 5.x 2020-10-24 14:08: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 Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
LICENSE Update year in license files 2020-01-01 12:03:25 +01:00
LoggingTranslator.php Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
MessageCatalogue.php Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +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
PseudoLocalizationTranslator.php Merge branch '5.1' 2020-09-02 18:27:44 +02:00
README.md [Translation][Debug] Add installation and minimal example to README 2020-02-03 16:10:40 +01:00
TranslatableMessage.php Rename Translatable class to TranslatableMessage 2020-10-07 07:51:02 +02:00
Translator.php Merge branch '5.1' 2020-09-27 05:44:38 +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