[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comment processing behavior when using line breaks in PHP
From: |
Bruno Haible |
Subject: |
Re: Comment processing behavior when using line breaks in PHP |
Date: |
Fri, 18 Oct 2024 21:47:55 +0200 |
Hi,
Steven wrote in
<https://lists.gnu.org/archive/html/bug-gettext/2021-04/msg00006.html>:
> I'd like to clarify if there may be a bug (or feature) when processing
> translator comments within PHP code that contains a line break (Unix style -
> LF) before the first function argument (which is valid PHP syntax).
>
> For example, given the following PHP file (Filename: test.php, Unix line
> breaks, UTF-8 encoding):
>
> <?php
> /// TRANSLATORS: Test comment
> _(
> 'Test');
>
> If we run the following command (using Windows 10):
>
> .\xgettext.exe -L PHP --add-comments=TRANSLATORS: test.php
>
> ...the resulting messages.po output file is missing the translator comment:
>
> #: test.php:5
> msgid "Test"
> msgstr ""
>
> However, if we modify the PHP file (test.php) to the following:
>
> <?php
> /// TRANSLATORS: Test comment
> _(''.
> 'Test');
>
> ...and run the same xgettext command, the resulting messages.po output file
> now contains the comment:
>
> #. TRANSLATORS: Test comment
> #: test.php:4
> msgid "Test"
> msgstr ""
>
> We expected the comment to appear in the first messages.po file, given the
> first PHP file uses valid PHP syntax.
Thanks for reporting this. The issue has been addressed through documentation:
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=911ad043076c777c712f4d85b05d34a94661badf
Bruno
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Comment processing behavior when using line breaks in PHP,
Bruno Haible <=