-
Notifications
You must be signed in to change notification settings - Fork 47
Ezp 26835 : use ezplatform i18n to handle translations #777
Conversation
Could you please find a more meaningful title for the PR ? :) |
We should probably wait until the french package is available and tested to merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the title and the fact that we should wait, it looks good !
Just a minor remark on the shell script.
../../../app/console translation:extract en -v \ | ||
--dir=. \ | ||
--exclude-dir=vendor --exclude-dir=Tests --exclude-dir=Features --exclude-dir=node_modules --exclude-dir=Resources/public/vendors \ | ||
--output-dir=./Resources/translations \ | ||
--keep | ||
"$@" | ||
|
||
# Clean corresponding ezplatform-i18n folder | ||
rm ../../ezsystems/ezplatform-i18n/source/platform-ui-bundle/*.xlf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should output something to say what is being done. The extraction script will output stuff, but the system commands below won't.
c248108
to
5a9cb74
Compare
@bdunogier done |
5a9cb74
to
27f6648
Compare
@bdunogier @dpobel as discused this morning I remove the updatestring script to implement it on ezplatform directly. This PR is now just file deletion and a small fix on HandleBarsFileVisitorTest.php |
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below: Loaded config from "/jenkins/jenkins.std/jobs/PlatformUIBundle-Pull-Request-checker/workspace/.php_cs"
F.
Legend: ?-unknown, I-invalid file syntax, file ignored, .-no changes, F-fixed, E-error
1) Tests/Translation/HandleBarsFileVisitorTest.php (multiline_array_trailing_comma)
---------- begin diff ----------
--- Original
+++ New
@@ @@
//variable as translation string
- array("{{ translate fieldGroupName 'ezplatform_fields_groups' }}", array())
+ array("{{ translate fieldGroupName 'ezplatform_fields_groups' }}", array()),
);
}
/**
* @dataProvider resourceProvider
*/
public function testExtractWithFiles($resource)
{
$visitor = new HandleBarsFileVisitor();
$catalogue = new MessageCatalogue('en');
$visitor->visitFile($resource, $catalogue);
$this->assertTrue($catalogue->has(new Message('test.translation.title', 'testdomain')));
$this->assertEquals(
'test.translation.title',
$catalogue->get('test.translation.title', 'testdomain')
);
}
/**
* @return array
*/
public function resourceProvider()
{
return [[new SplFileInfo(__DIR__ . '/../fixtures/extractor/Resources/public/templates/with_translations.hbt')]];
}
}
---------- end diff ----------
Fixed all files in 2.761 seconds, 6.750 MB memory used |
@bdunogier I added extract script in this PR not to be in conflict filestypes has been moved to kernel as we discus this morning |
e46548a
to
878068e
Compare
You have a conflict : |
00263ff
to
a5f9a9e
Compare
a5f9a9e
to
149b4fd
Compare
Jira : https://jira.ez.no/browse/EZP-26835
Description
Translations (other than en) will be stored in ezplatform-i18n repository.
So this PR :