[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Preparing files for translation

From: Andy Whitcroft <apw_at_shadowen.org>
Date: 2004-04-20 15:23:19 CEST

--On 20 April 2004 14:51 +0200 Lübbe Onken <l.onken@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
Received on Tue Apr 20 15:20:06 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.