develooper Front page | perl.i18n | Postings from November 2005

long strings and xgettext.pl

Thread Next
From:
Sava Chankov
Date:
November 3, 2005 09:56
Subject:
long strings and xgettext.pl
Message ID:
20051103175215.11372.qmail@lists.develooper.com
Hello,

I've written an i18n-ed web application which has some quite long strings in the code like this one:

"If you want to receive mail in the folder, add addresses.
A message sent to an address that you add will be delivered to the folder.
If you don't want to receive mail in the folder, click 'Next' button
You will still be able to drag'n'drop messages into it."

However, they doesn't look good in indented code. So I split them in smaller strings, as C gettext allows:

_(   "If you want to receive mail in the folder, add addresses."
     "A message sent to an address that you add will be delivered to the folder."
     "If you don't want to receive mail in the folder, click 'Next' button"
     "You will still be able to drag'n'drop messages into it."  
); 

Unfortunately, xgettext.pl [or Locale::Maketext::Extract::extract, to be precise] doesn't understand that gettext is variadic function and the result looks like this (comment
line truncated by me to 80 characters):

#. ("A message sent to an address that you add will be delivered to the folder."                                              "If you don't want to receive mail in the folder, click 'Next' button."                                             
"You will still be able to drag'n'drop messages into it.")
msgid "If you want to receive mail in the folder, add addresses."
msgstr ""

I think that Locale::Maketext::Extract::extract() should be patched to deal with the case. What's your opinion?

best wishes,
Sava Chankov

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About