Skip to content

Commit 953d529

Browse files
committed
Merge branch 'master' of github.com:php-translation/symfony-bundle into chore/twig-from-aliases-to-namespaces
2 parents 9b76644 + 0051c9f commit 953d529

File tree

10 files changed

+28
-17
lines changed

10 files changed

+28
-17
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
global:
1414
- TEST_COMMAND="composer test"
1515
- SYMFONY_PHPUNIT_VERSION="6.3"
16+
- COMPOSER_MEMORY_LIMIT=-1
1617

1718
matrix:
1819
fast_finish: true
@@ -24,11 +25,11 @@ matrix:
2425
# Test with lowest dependencies
2526
- php: 7.1
2627
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7"
27-
- php: 5.5
28+
- php: 5.6
2829
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7"
2930

3031
# Test the latest stable release
31-
- php: 5.5
32+
- php: 5.6
3233
env: SYMFONY_PHPUNIT_VERSION="5.7"
3334
- php: 5.6
3435
env: SYMFONY_PHPUNIT_VERSION="5.7"
@@ -44,7 +45,7 @@ matrix:
4445
- php: 7.2
4546
env: DEPENDENCIES="dunglas/symfony-lock:^4"
4647
- php: 7.0
47-
env: DEPENDENCIES="dunglas/symfony-lock:^2 twig/twig:^1.34 symfony/property-access:^2.8"
48+
env: DEPENDENCIES="dunglas/symfony-lock:^2 twig/twig:^1.34,<1.39 symfony/property-access:^2.8"
4849

4950
# Latest commit to master
5051
- php: 7.2

Command/DeleteObsoleteCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
*/
2929
class DeleteObsoleteCommand extends Command
3030
{
31-
use BundleTrait, StorageTrait;
31+
use BundleTrait;
32+
use StorageTrait;
3233

3334
protected static $defaultName = 'translation:delete-obsolete';
3435

@@ -72,7 +73,7 @@ protected function configure()
7273
->setName(self::$defaultName)
7374
->setDescription('Delete all translations marked as obsolete.')
7475
->addArgument('configuration', InputArgument::OPTIONAL, 'The configuration to use', 'default')
75-
->addArgument('locale', InputArgument::OPTIONAL, 'The locale ot use. If omitted, we use all configured locales.', null)
76+
->addArgument('locale', InputArgument::OPTIONAL, 'The locale to use. If omitted, we use all configured locales.', null)
7677
->addOption('bundle', 'b', InputOption::VALUE_REQUIRED, 'The bundle you want remove translations from.')
7778
;
7879
}

Command/DownloadCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
use Translation\Bundle\Service\CacheClearer;
2121
use Translation\Bundle\Service\ConfigurationManager;
2222
use Translation\Bundle\Service\StorageManager;
23-
use Translation\Bundle\Model\Configuration;
2423

2524
/**
2625
* @author Tobias Nyholm <[email protected]>
2726
*/
2827
class DownloadCommand extends Command
2928
{
30-
use BundleTrait, StorageTrait;
29+
use BundleTrait;
30+
use StorageTrait;
3131

3232
protected static $defaultName = 'translation:download';
3333

Command/ExtractCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function configure()
8989
->setName(self::$defaultName)
9090
->setDescription('Extract translations from source code.')
9191
->addArgument('configuration', InputArgument::OPTIONAL, 'The configuration to use', 'default')
92-
->addArgument('locale', InputArgument::OPTIONAL, 'The locale ot use. If omitted, we use all configured locales.', false)
92+
->addArgument('locale', InputArgument::OPTIONAL, 'The locale to use. If omitted, we use all configured locales.', false)
9393
->addOption('hide-errors', null, InputOption::VALUE_NONE, 'If we should print error or not')
9494
->addOption('bundle', 'b', InputOption::VALUE_REQUIRED, 'The bundle you want extract translations from.')
9595
;

Command/StatusCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ protected function configure()
6868
->setName(self::$defaultName)
6969
->setDescription('Show status about your translations.')
7070
->addArgument('configuration', InputArgument::OPTIONAL, 'The configuration to use', 'default')
71-
->addArgument('locale', InputArgument::OPTIONAL, 'The locale ot use. If omitted, we use all configured locales.', false)
71+
->addArgument('locale', InputArgument::OPTIONAL, 'The locale to use. If omitted, we use all configured locales.', false)
7272
->addOption('json', null, InputOption::VALUE_NONE, 'If we should output in Json format')
73-
->addOption('bundle', 'b', InputOption::VALUE_REQUIRED, 'The translations for bundle you want to check.')
73+
->addOption('bundle', 'b', InputOption::VALUE_REQUIRED, 'The bundle for which you want to check the translations.')
7474
;
7575
}
7676

Controller/WebUIController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpFoundation\Response;
1717
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1818
use Symfony\Component\Intl\Intl;
19+
use Symfony\Component\Intl\Locales;
1920
use Symfony\Component\Translation\MessageCatalogue;
2021
use Translation\Bundle\Exception\MessageValidationException;
2122
use Translation\Bundle\Service\StorageService;
@@ -250,7 +251,9 @@ private function getMessageFromRequest(Request $request)
250251
private function getLocale2LanguageMap()
251252
{
252253
$configuredLocales = $this->getParameter('php_translation.locales');
253-
$names = Intl::getLocaleBundle()->getLocaleNames('en');
254+
$names = class_exists(Locales::class)
255+
? Locales::getNames('en')
256+
: Intl::getLocaleBundle()->getLocaleNames('en');
254257
$map = [];
255258
foreach ($configuredLocales as $l) {
256259
$map[$l] = isset($names[$l]) ? $names[$l] : $l;

Resources/views/SymfonyProfiler/translation.html.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@
120120
{% include "@Translation/SymfonyProfiler/javascripts.html.twig" %}
121121
{% endblock %}
122122

123+
{% block panel %}
124+
{{ block('panelContent') }}
125+
{% endblock %}
126+
123127
{% macro render_table(messages, checkedByDefault = false) %}
124128
<table>
125129
<thead>

Tests/Unit/Twig/BaseTwigTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ final protected function parse($file, $debug = false)
3333
$env->addExtension(new SymfonyTranslationExtension($translator = new IdentityTranslator(new MessageSelector())));
3434
$env->addExtension(new TranslationExtension($translator, $debug));
3535

36-
return $env->parse($env->tokenize(new Source($content, null)))->getNode('body');
36+
return $env->parse($env->tokenize(new Source($content, '')))->getNode('body');
3737
}
3838
}

composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@
1313
"php": "^5.5 || ^7.0",
1414
"symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0",
1515
"symfony/validator": "^2.7 || ^3.0 || ^4.0",
16-
"symfony/translation": "^2.7 || ^3.0 || ^4.0",
16+
"symfony/translation": "^2.7 || ^3.0 || ^4.0,<4.2",
1717
"symfony/twig-bundle": "^2.7 || ^3.0 || ^4.0",
1818
"symfony/finder": "^2.7 || ^3.0 || ^4.0",
1919
"symfony/intl": "^2.7 || ^3.0 || ^4.0",
2020

2121
"php-translation/common": "^1.0",
2222
"php-translation/symfony-storage": "^1.0",
2323
"php-translation/extractor": "^1.3",
24-
"nyholm/nsa": "^1.1"
24+
"nyholm/nsa": "^1.1",
25+
"twig/twig": "<1.39 || ^2.0,<2.8"
2526
},
2627
"require-dev": {
27-
"symfony/phpunit-bridge": "^3.4 || ^4.0",
28+
"symfony/phpunit-bridge": "^3.4.19 || ^4.0",
2829
"php-translation/translator": "^1.0",
2930
"php-http/curl-client": "^1.7",
3031
"php-http/message": "^1.6",
@@ -35,8 +36,8 @@
3536
"symfony/templating": "^2.7 || ^3.0 || ^4.0",
3637
"symfony/dependency-injection": "^2.7 || ^3.0 || ^4.0",
3738
"symfony/web-profiler-bundle": "^2.7 || ^3.0 || ^4.0",
38-
"matthiasnoback/symfony-dependency-injection-test": "^1.2 || ^2.3",
39-
"matthiasnoback/symfony-config-test": "^2.2 || ^3.1",
39+
"matthiasnoback/symfony-dependency-injection-test": "^1.2 || ^2.3 || ^3.0",
40+
"matthiasnoback/symfony-config-test": "^2.2 || ^3.1 || ^4.0",
4041
"guzzlehttp/psr7": "^1.4",
4142
"nyholm/symfony-bundle-test": "^1.2.3"
4243
},

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<php>
1717
<env name="ENV" value="test" />
18+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="verbose=1" />
1819
</php>
1920

2021
<formatter type="clover" usefile="false"/>

0 commit comments

Comments
 (0)