Skip to content

Commit dba6a21

Browse files
codegainnicolas-grekas
authored andcommitted
[Translation] XliffLintCommand: allow .xliff file extension
1 parent 046aff2 commit dba6a21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Translation/Command/XliffLintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function validate(string $content, $file = null)
126126
// otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed
127127
// also, the regexp matching must be case-insensitive, as defined for 'target-language' values
128128
// http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#target-language
129-
$expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.(?i:%s)\.xlf/', $normalizedLocale) : sprintf('/^(.*\.(?i:%s)\.xlf|(?i:%s)\..*\.xlf)/', $normalizedLocale, $normalizedLocale);
129+
$expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.(?i:%s)\.(?:xlf|xliff)/', $normalizedLocale) : sprintf('/^(?:.*\.(?i:%s)|(?i:%s)\..*)\.(?:xlf|xliff)/', $normalizedLocale, $normalizedLocale);
130130

131131
if (0 === preg_match($expectedFilenamePattern, basename($file))) {
132132
$errors[] = [

0 commit comments

Comments
 (0)