Re: [bug-gettext] Hardcoded escaping

2015-10-29 Thread Bruno Haible
Hi Serj,

You have well described the issue.

> we'll have to maintain slightly different strings in source code (escaped)
> and in `.pot` files (unescaped), which feels kinda wrong.
> ...
> we will have different strings in source code and l10n files, which is
> against consistency

This "feels kinda wrong" is the wrong part of your expectation.

The PO file format and its string-escaping syntax has been defined once,
and it is independent of the syntax in any programming programming language.

If we had done it like you wish, namely to copy strings including their
delimiters and escaping to the PO file, then - since a project can contain
C, Shell, Python, Lisp, Java, JavaScript, etc. files and xgettext can
extract strings from all of this files - the resulting PO file would
becomes a syntactic mix between C, Shell, Python, Lisp, Java, JavaScript, etc.
With so many different (and contradictory) escape syntaxes such a file
could not be parsed correctly any more.

A second reason why your expectation is wrong is:
- The strings in source code are viewed by the developer.
- The strings in the PO file are viewed by the translator (if she is not
  actually using some translation tool that hides the escaping from her).
Since these are usually different persons, it does not matter if the syntaxes
are different.

Bruno




Re: [bug-gettext] Duplicated words in gettext-runtime/m4/*.m4

2015-10-29 Thread Daiki Ueno
Jakub Wilk  writes:

> There are some duplicated words in the copying permission statements
> in gettext-runtime/m4/*.m4:
>
> ... This file can can be used ...
> ... gettext package package is covered ...

Thanks, fixed.

Regards,
-- 
Daiki Ueno



Re: [bug-gettext] Hardcoded escaping

2015-10-29 Thread Daiki Ueno
Serj Lavrin  writes:

> There seems to be an issue with hardcoded escaping in
> http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/src/po-lex.c?id=b75a50bc5f30666fb36469a90245e1d7856d672c#n750
>
> If I will explain an issue, is there any chances that it will be fixed?

Please go ahead and describe the issue.  We will try to fix it if it is
a real bug.

Regards,
-- 
Daiki Ueno



Re: [bug-gettext] Hardcoded escaping

2015-10-29 Thread Daiki Ueno
Serj Lavrin  writes:

> ```
> gettext('My magic ain\'t working string')
> ```
> Not big deal — now that works.
> But then comes into play `xgettext`. During extraction `xgettext` will get 
> string as it is — with
> escaped single quote.

For the record, this is not the case.  xgettext recognizes character
escapes and canonicalize strings before writing.  So the output
shouldn't contain escaped single quote:

$ cat a.js
gettext('My magic ain\'t working string')

$ xgettext -L JavaScript --no-location --omit-header -o - a.js
msgid "My magic ain't working string"
msgstr ""

Regards,
-- 
Daiki Ueno