You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Lübbe Onken <l....@rac.de> on 2004/04/20 12:51:15 UTC

Preparing files for translation

Hi Folks,

thanks to Erik's hint I was able to extract the strings from the svn 
sources. There are some things that I'd like to see improved however:

example 1) props.c lines 45/46
---SNIP---
svn_cl__revprop_no_rev_error (apr_pool_t *pool)
{
   return svn_error_create
     (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
      _("Must specify revision explicitly when operating on a "
        "revision property"));
}
---SNIP---
are extracted as two separate strings, which is hard to translate, since 
the context might get lost.

Better:
---SNAP---
svn_cl__revprop_no_rev_error (apr_pool_t *pool)
{
   return svn_error_create
     (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
     _("Must specify revision explicitly when operating on a revision 
property"));
}
---SNAP---
even though it might violate formatting guidelines.

Worse than the above example is the following
example 2) locks.c lines 276...
---SNIP---
return svn_error_createf
   (SVN_ERR_WC_BAD_PATH, NULL,
     _("Path '%s' ends in '%s', "
       "which is unsupported for this operation"),
     svn_path_local_style (path, pool), base_name);
---SNIP---
Same basic formatting problem, worse impact because this phrase might 
become impossible to translate when its in two pieces. The placement of 
the '%s' inside the phrase might be somewhere else in another language.

The order of verbs, nouns etc. inside a phrase is different in different 
languages, so it could happen that a half sentence as above is 
translatable in context with the other half. Maybe one of the two 
snippets is reused somewhere else (looks good at a first glance), but it 
requires the noun to be in a different place to make sense with its new 
partner.

I don't know if xgettext has an option to glue these strings back 
together, but I strongly suggest not to tear phrases apart in the first 
place.

Cheers
-Lübbe


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Preparing files for translation

Posted by Lübbe Onken <l....@rac.de>.
Andy Whitcroft wrote:

> Therefore when they are parsed for translation in _() there will
> only be a single string.
I don't know what goes wrong when I try to extract the strings from the 
command line. Even though I set the -k_ and -kN_ paramater they are torn 
apart by xgettext. So the problem is again sitting in front of the 
keyboard :-)
In the meantime I found out that using poEdit to extract the strings 
behaves the way I expect.

Cheers
-Lübbe


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Preparing files for translation

Posted by Andy Whitcroft <ap...@shadowen.org>.
--On 20 April 2004 14:51 +0200 Lübbe Onken <l....@rac.de> wrote:

> example 1) props.c lines 45/46
> ---SNIP---
> svn_cl__revprop_no_rev_error (apr_pool_t *pool)
> {
>    return svn_error_create
>      (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
>       _("Must specify revision explicitly when operating on a "
>         "revision property"));
> }
> ---SNIP---
> are extracted as two separate strings, which is hard to translate, since
> the context might get lost.
> 
> Better:
> ---SNAP---
> svn_cl__revprop_no_rev_error (apr_pool_t *pool)
> {
>    return svn_error_create
>      (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
>      _("Must specify revision explicitly when operating on a revision
> property"));
> }
> ---SNAP---
> even though it might violate formatting guidelines.
> 
> Worse than the above example is the following
> example 2) locks.c lines 276...
> ---SNIP---
> return svn_error_createf
>    (SVN_ERR_WC_BAD_PATH, NULL,
>      _("Path '%s' ends in '%s', "
>        "which is unsupported for this operation"),
>      svn_path_local_style (path, pool), base_name);
> ---SNIP---
> Same basic formatting problem, worse impact because this phrase might
> become impossible to translate when its in two pieces. The placement of
> the '%s' inside the phrase might be somewhere else in another language.
> 
> The order of verbs, nouns etc. inside a phrase is different in different
> languages, so it could happen that a half sentence as above is
> translatable in context with the other half. Maybe one of the two
> snippets is reused somewhere else (looks good at a first glance), but it
> requires the noun to be in a different place to make sense with its new
> partner.
> 
> I don't know if xgettext has an option to glue these strings back
> together, but I strongly suggest not to tear phrases apart in the first
> place.

Both of these examples are effectivly "xxx yyy" "zzz" (there is no ,
between them) which are concatenated into a single real string in the
compiler.  Therefore when they are parsed for translation in _() there will
only be a single string.

-apw

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Preparing files for translation

Posted by Lübbe Onken <l....@rac.de>.
Lübbe Onken wrote:

> I don't know if xgettext has an option to glue these strings back 
> together, but I strongly suggest not to tear phrases apart in the first 
> place.
Hm, it looks like poEdit knows how to tell xgettext to extract these 
strings properly. I still don't understand which xgettext parameter does 
the trick, but now it works for me.

So apart from not 'knowing how to' I'm happy now. Please dump my 
previous request.

Cheers
-Lübbe


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org