packagist gettext/gettext v3.5.9
3.5.9

latest releases: 4.x-dev, v4.8.10, dev-master...
8 years ago

Special thanks to @mlocati for the hard work:

phpCode extractor fixes:

The phpCode extractor has been deeptly rewritten to be fully compatible with GNU gettext #92 (comment). It means:

  • Fixed string containing backslashes #91:

    __("Hello \n world");
    __("Hello \t world");
    __('Hello \' world');
    __('Hello \\\t world');
    //etc...
  • Fixed when the arguments contains concatenated strings or variables (to be fully compatible with xgettext behaviour) #98:

    __('string1 '.'string 2');
    __('hello '.$name);
  • Allow to collect comments #100 #102:

    echo __(/* i18n: Test comment 1 */'test 1');
    
    /* i18n: Test comment 2 */
    echo __('test 2');
    
    /* i18n: Test comment 3 */
    
    echo __('test 3');
    
    /* i18n: Test comment 4 */
    echo __(
        'test 4'
    );

    To configure comment extraction:

    Gettext\Extractors\PhpCode::$extractComments = false; //disable the comment extraction (by default)
    Gettext\Extractors\PhpCode::$extractComments = 'i18n:'; //collect only the comments begining with "i18n:"
    Gettext\Extractors\PhpCode::$extractComments = ''; //collect all comments

Other fixes:

  • Fixed po generation/extraction with special chars #95 #92

Don't miss a new gettext release

NewReleases is sending notifications on new releases.