Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Ezp 26835 : use ezplatform i18n to handle translations #777

Merged
merged 5 commits into from Jan 18, 2017

Conversation

nicolas-bastien
Copy link
Contributor

@nicolas-bastien nicolas-bastien commented Jan 13, 2017

Jira : https://jira.ez.no/browse/EZP-26835

Description

Translations (other than en) will be stored in ezplatform-i18n repository.

So this PR :

  • remove empty fr_FR translation files
  • remove updatestring.shas it will be handled in ezplatform
  • remove crowdin configuration file as it's not used anymore
  • fix HandleBarsFileVisitorTest for translation with variable as translation key
  • add extract translation script + update files

@bdunogier
Copy link
Member

Could you please find a more meaningful title for the PR ? :)

@bdunogier
Copy link
Member

bdunogier commented Jan 13, 2017

We should probably wait until the french package is available and tested to merge this.

Copy link
Member

@bdunogier bdunogier left a 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
Copy link
Member

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.

@nicolas-bastien nicolas-bastien changed the title Ezp 26835 ezplatform i18n Ezp 26835 : use ezplatform i18n to handle translations Jan 16, 2017
@nicolas-bastien
Copy link
Contributor Author

@bdunogier done
So I'm just waiting for https://github.com/ezsystems/ezplatform-i18n to be published on packagist to finish this PR

@nicolas-bastien
Copy link
Contributor Author

@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

@ezrobot
Copy link

ezrobot commented Jan 17, 2017

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

@nicolas-bastien
Copy link
Contributor Author

@bdunogier I added extract script in this PR not to be in conflict

filestypes has been moved to kernel as we discus this morning

@bdunogier
Copy link
Member

You have a conflict :

@nicolas-bastien nicolas-bastien force-pushed the EZP-26835-ezplatform-i18n branch 3 times, most recently from 00263ff to a5f9a9e Compare January 18, 2017 11:04
@nicolas-bastien nicolas-bastien merged commit 5e2e60c into master Jan 18, 2017
@nicolas-bastien nicolas-bastien deleted the EZP-26835-ezplatform-i18n branch January 18, 2017 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants