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 282cafb093 Merge branch '3.4' into 4.4
* 3.4:
  Various cleanups
2020-05-30 22:06:45 +02:00
..
Catalogue Merge branch '3.4' into 4.4 2020-03-16 09:56:54 +01:00
Command [Translation] Add missing use statement 2020-02-04 08:15:38 +01:00
DataCollector Merge branch '4.3' into 4.4 2019-12-28 16:00:14 +01:00
DependencyInjection fixed CS 2019-06-13 13:03:18 +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 '3.4' into 4.4 2020-05-30 22:06:45 +02:00
Loader Merge branch '3.4' into 4.4 2020-05-30 22:06:45 +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 '3.4' into 4.4 2020-05-16 11:03:35 +02:00
Util Add missing dots at the end of exception messages 2020-03-15 15:17:26 +01:00
Writer Merge branch '3.4' into 4.4 2020-03-15 11:05:03 +01:00
.gitattributes add missing gitattributes for phpunit-bridge 2020-03-27 17:54:36 +01:00
.gitignore
CHANGELOG.md Deprecate things that prevent \Throwable from bubbling down 2019-11-05 18:23:20 +01:00
composer.json Use ">=" for the "php" requirement 2020-05-20 10:37:50 +02:00
DataCollectorTranslator.php Fix quotes in exception messages 2020-03-16 12:24:17 +01:00
IdentityTranslator.php Fix CS 2020-02-04 10:32:40 +01:00
Interval.php Add types to constructors and private/final/internal methods (Batch II) 2019-10-03 13:24:03 +02:00
LICENSE Update year in license files 2020-01-01 12:03:25 +01:00
LoggingTranslator.php Fix quotes in exception messages 2020-03-16 12:24:17 +01:00
MessageCatalogue.php [Translation] Fix for translation:update command updating ICU messages 2020-04-30 20:05:09 +02:00
MessageCatalogueInterface.php [Translation] make intl+icu format seamless by handling it in MessageCatalogue 2018-11-14 17:25:09 +01:00
MessageSelector.php Merge branch '4.1' into 4.2 2019-01-16 21:31:39 +01:00
MetadataAwareInterface.php
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
PluralizationRules.php fixed CS 2019-06-13 12:57:15 +02:00
README.md [Translation][Debug] Add installation and minimal example to README 2020-02-03 16:10:40 +01:00
Translator.php Merge branch '3.4' into 4.4 2020-05-16 11:03:35 +02:00
TranslatorBagInterface.php Adding use statement for InvalidArgumentException 2017-03-03 07:24:16 -08:00
TranslatorInterface.php Merge branch '4.1' into 4.2 2019-01-16 21:31:39 +01: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