6 mars 2018 kl. 14.00 skrev Julian Foad <julianf...@apache.org>:
> > What really needs to be done to make life for translators somewhat bearable 
> > is to split the long strings into individual paragraphs; this is standard 
> > practice. Right now, even if only a single word has changed in the 
> > documentation of "svn merge", for example, all we are told is that 
> > something in this 300-line string has changed. One ends up having to go 
> > back to the source code and spend quite some time to figure out what part 
> > needs updating.
> Yes please let's fix this. I am happy to do the grunt work if that helps. Can 
> you figure out how to rewrite the source? Try it (if you are able to compile 
> and test) or find docs or examples? I could figure it out if necessary but 
> would really like some help.
> My first guess is
> _("paragraph1 line1\n"
>   "paragraph1 line2\n"
>   "\n")
> _("paragraph2 line1\n")

Static string concatenation won't work; the strings need to be looked up 
separately. This usually means that what was a single string before now becomes 
an array of strings.

Thus, instead of

N_("paragraph 1 line 1\n"
   "paragraph 1 line 2\n"
   "paragraph 2 line 1\n"
   "paragraph 2 line 2\n")

we would have

{N_("paragraph 1 line 1\n"
    "paragraph 1 line 2\n"),
 N_("paragraph 2 line 1\n"
    "paragraph 2 line 2\n"),

assuming the strings are static initialisers. The blank line separating the 
paragraphs can either be included in the paragraph strings or be emitted by the 
code that translates and prints them.

Reply via email to