You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADE-4.2.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -156,6 +156,7 @@ FrameworkBundle
156
156
set the "APP_DEBUG" environment variable to "0" instead.
157
157
* The `Templating\Helper\TranslatorHelper::transChoice()` method has been deprecated, use the `trans()` one instead with a `%count%` parameter.
158
158
* Deprecated support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
159
+
* Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been deprecated.
Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,7 @@ FrameworkBundle
170
170
set the "APP_DEBUG" environment variable to "0" instead.
171
171
* The `Templating\Helper\TranslatorHelper::transChoice()` method has been removed, use the `trans()` one instead with a `%count%` parameter.
172
172
* Removed support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
173
+
* Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been removed.
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ CHANGELOG
25
25
* Deprecated `CachePoolPass`. Use `Symfony\Component\Cache\DependencyInjection\CachePoolPass` instead.
26
26
* Deprecated `CachePoolPrunerPass`. Use `Symfony\Component\Cache\DependencyInjection\CachePoolPrunerPass` instead.
27
27
* Deprecated support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
28
+
* Deprecated support for the legacy directory structure in `translation:update` and `debug:translation` commands.
if (is_dir($dir = $rootDir.'/Resources/translations')) {
136
+
if ($dir !== $this->defaultTransPath) {
137
+
$notice = sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
138
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('use the "%s" directory instead.', $this->defaultTransPath) : 'configure and use "framework.translator.default_path" instead.'), E_USER_DEPRECATED);
139
+
}
140
+
$transPaths[] = $dir;
141
+
}
135
142
if ($this->defaultTransPath) {
136
143
$transPaths[] = $this->defaultTransPath;
137
144
}
138
-
$viewsPaths = array($rootDir.'/Resources/views');
145
+
$viewsPaths = array();
146
+
if (is_dir($dir = $rootDir.'/Resources/views')) {
147
+
if ($dir !== $this->defaultViewsPath) {
148
+
$notice = sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
149
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : 'configure and use "twig.default_path" instead.'), E_USER_DEPRECATED);
150
+
}
151
+
$viewsPaths[] = $dir;
152
+
}
139
153
if ($this->defaultViewsPath) {
140
154
$viewsPaths[] = $this->defaultViewsPath;
141
155
}
@@ -146,35 +160,60 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (is_dir($dir = $path.'/Resources/translations')) {
185
+
if ($dir !== $this->defaultTransPath) {
186
+
@trigger_error(sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2, use the "%s" directory instead.', $dir, $path.'/translations'), E_USER_DEPRECATED);
187
+
}
188
+
$transPaths[] = $dir;
189
+
}
161
190
162
-
if (!is_dir($transPaths[0])) {
191
+
$viewsPaths = array($path.'/templates');
192
+
if (is_dir($dir = $path.'/Resources/views')) {
193
+
if ($dir !== $this->defaultViewsPath) {
194
+
@trigger_error(sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2, use the "%s" directory instead.', $dir, $path.'/templates'), E_USER_DEPRECATED);
195
+
}
196
+
$viewsPaths[] = $dir;
197
+
}
198
+
199
+
if (!is_dir($transPaths[0]) && !isset($transPaths[1])) {
163
200
thrownewInvalidArgumentException(sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0]));
if (is_dir($deprecatedPath = sprintf('%s/Resources/%s/translations', $rootDir, $bundle->getName()))) {
207
+
$transPaths[] = $deprecatedPath;
208
+
$notice = sprintf('Storing translations files for "%s" in the "%s" directory is deprecated since Symfony 4.2, ', $bundle->getName(), $deprecatedPath);
209
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('use the "%s" directory instead.', $this->defaultTransPath) : 'configure and use "framework.translator.default_path" instead.'), E_USER_DEPRECATED);
if (is_dir($dir = $rootDir.'/Resources/translations')) {
126
+
if ($dir !== $this->defaultTransPath) {
127
+
$notice = sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
128
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('use the "%s" directory instead.', $this->defaultTransPath) : 'configure and use "framework.translator.default_path" instead.'), E_USER_DEPRECATED);
129
+
}
130
+
$transPaths[] = $dir;
131
+
}
125
132
if ($this->defaultTransPath) {
126
133
$transPaths[] = $this->defaultTransPath;
127
134
}
128
-
$viewsPaths = array($rootDir.'/Resources/views');
135
+
$viewsPaths = array();
136
+
if (is_dir($dir = $rootDir.'/Resources/views')) {
137
+
if ($dir !== $this->defaultViewsPath) {
138
+
$notice = sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
139
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : 'configure and use "twig.default_path" instead.'), E_USER_DEPRECATED);
140
+
}
141
+
$viewsPaths[] = $dir;
142
+
}
129
143
if ($this->defaultViewsPath) {
130
144
$viewsPaths[] = $this->defaultViewsPath;
131
145
}
@@ -137,22 +151,44 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (is_dir($dir = sprintf('%s/Resources/%s/translations', $rootDir, $foundBundle->getName()))) {
157
+
$transPaths[] = $dir;
158
+
$notice = sprintf('Storing translations files for "%s" in the "%s" directory is deprecated since Symfony 4.2, ', $foundBundle->getName(), $dir);
159
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('use the "%s" directory instead.', $this->defaultTransPath) : 'configure and use "framework.translator.default_path" instead.'), E_USER_DEPRECATED);
if (is_dir($dir = $path.'/Resources/translations')) {
177
+
if ($dir !== $this->defaultTransPath) {
178
+
@trigger_error(sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2, use the "%s" directory instead.', $dir, $path.'/translations'), E_USER_DEPRECATED);
179
+
}
180
+
$transPaths[] = $dir;
181
+
}
182
+
183
+
$viewsPaths = array($path.'/templates');
184
+
if (is_dir($dir = $path.'/Resources/views')) {
185
+
if ($dir !== $this->defaultViewsPath) {
186
+
@trigger_error(sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2, use the "%s" directory instead.', $dir, $path.'/templates'), E_USER_DEPRECATED);
187
+
}
188
+
$viewsPaths[] = $dir;
189
+
}
154
190
155
-
if (!is_dir($transPaths[0])) {
191
+
if (!is_dir($transPaths[0]) && !isset($transPaths[1])) {
156
192
thrownewInvalidArgumentException(sprintf('<error>"%s" is neither an enabled bundle nor a directory.</error>', $transPaths[0]));
* @expectedDeprecation Storing translations in the "%ssf_translation%s/Resources/translations" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/translations" directory instead.
71
+
* @expectedDeprecation Storing templates in the "%ssf_translation%s/Resources/views" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/templates" directory instead.
@@ -80,6 +81,23 @@ public function testWriteMessagesInRootDirectory()
80
81
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
81
82
}
82
83
84
+
/**
85
+
* @group legacy
86
+
* @expectedDeprecation Storing translations in the "%ssf_translation%s/Resources/translations" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/translations" directory instead.
87
+
* @expectedDeprecation Storing templates in the "%ssf_translation%s/Resources/views" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/templates" directory instead.
0 commit comments