You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Nicolás Lichtmaier <ni...@reloco.com.ar> on 2004/05/23 00:49:52 UTC

[PATCH] More po updates

When I'm bored I do this:

More updates for i18n.

  *  Added more _()'s everywhere.



Re: [PATCH] More po updates

Posted by Erik Hülsmann <e....@gmx.net>.

>Index: subversion/libsvn_client/diff.c
>===================================================================
>--- subversion/libsvn_client/diff.c	(revisión: 9860)
>+++ subversion/libsvn_client/diff.c	(copia de trabajo)
>@@ -654,12 +654,12 @@
> {
>   struct merge_cmd_baton *merge_b = baton;
>   apr_pool_t *subpool = svn_pool_create (merge_b->pool);
>-  const char *target_label = ".working";
>+  const char *target_label = _(".working");
>   const char *left_label = apr_psprintf (subpool,
>-                                         ".merge-left.r%ld",
>+                                         _(".merge-left.r%ld"),
>                                          older_rev);
>   const char *right_label = apr_psprintf (subpool,
>-                                          ".merge-right.r%ld",
>+                                          _(".merge-right.r%ld"),
>                                           yours_rev);
>   svn_boolean_t has_local_mods;
>   svn_boolean_t merge_required = TRUE;

I think the _() above require xgettext comments to explain their
function to translators.


>@@ -3426,7 +3429,7 @@
>     {
>       svn_pool_destroy (subpool);
>       return svn_error_create (SVN_ERR_FS_TXN_OUT_OF_DATE, NULL,
>-                               "Transaction out of date.");
>+                               _("Transaction out of date."));
>     }
> 
>   /* Get the next node_id and copy_id to use. */
>@@ -3673,7 +3676,7 @@
>   /* Did we find it? */
>   if (kind != svn_node_dir)
>     return svn_error_create (SVN_ERR_FS_NO_SUCH_TRANSACTION, NULL,
>-                             "No such transaction.");
>+                             _("No such transaction."));
>       
>   txn = apr_pcalloc (pool, sizeof (*txn));

The above messages can be set to NULL as they duplicate the general
message. They are - erm - somewhere in libsvn_fs_fs... Right before:
 
>Index: subversion/libsvn_fs_fs/err.c
>===================================================================
>--- subversion/libsvn_fs_fs/err.c	(revisión: 9860)
>+++ subversion/libsvn_fs_fs/err.c	(copia de trabajo)
>@@ -37,7 +37,7 @@
>     return SVN_NO_ERROR;
>   else
>     return svn_error_create (SVN_ERR_FS_NOT_OPEN, 0,
>-                             "filesystem object has not been opened yet");
>+                             _("filesystem object has not been opened yet"));
> }
> 
> 

So can this one.


bye,


Erik.

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

Re: [PATCH] More po updates

Posted by Branko Čibej <br...@xbc.nu>.
Peter N. Lundblad wrote:

>Index: subversion/clients/cmdline/log-cmd.c
>===================================================================
>--- subversion/clients/cmdline/log-cmd.c	(revisión: 9860)
>+++ subversion/clients/cmdline/log-cmd.c	(copia de trabajo)
>@@ -252,8 +253,9 @@
>     {
>       lines = num_lines (msg_stdout);
>       SVN_ERR (svn_stream_printf (lb->out, pool,
>-                                  " | %d line%s", lines,
>-                                  (lines > 1) ? "s" : ""));
>+                                  (lines == 1) ?
>+                                          _(" | %d line") : _(" | %d lines"),
>+                                  lines));
>     }
>
>Hmmm... Did we reach consensus about using ngettext? According to the gettext
>manual, this doesn't work for all languages, i.e. languages with more than
>two plural forms.
>  
>
Oh yes. Or obscure languages from out-of-the way places with a dual form.




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

Re: [PATCH] More po updates

Posted by Nicolás Lichtmaier <ni...@reloco.com.ar>.
>And you push work on all the translators, too:-)
>
>Here are some comments. Mostly too long lines, but a few others. Also, I
>didn't mention all cases with long lines. You have to look through the
>last half of the patch for some more. Otherwise, it looks fine.
>  
>

I'll fix them.

>Hmmm... Did we reach consensus about using ngettext? According to the gettext
>manual, this doesn't work for all languages, i.e. languages with more than
>two plural forms.
>  
>
Isn't ngettext() GNU only?


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

Re: [PATCH] More po updates

Posted by Nicolás Lichtmaier <ni...@reloco.com.ar>.
>   SVN_ERR (file_printf_from_utf8 (file,
>-                                  APR_EOL_STR "Property changes on: %s"
>-                                  APR_EOL_STR, path));
>+                                  _("%sProperty changes on: %s%s"),
>+                                  APR_EOL_STR, APR_EOL_STR, path));
>
>The last two args should be swapped. BTW, I don't know if this is part of the
>diff "format", so should it really be translated? This last question
>applies to the whole file, I think. Maybe others have an opinion?
>  
>

Uhn, to me this is English text. Parsing English description is not a 
good practice. In many programs, if you want to parse the output you 
must set LANG=C. Remember that a user might not understand at all what 
"Property changes on" means!


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

Re: [PATCH] More po updates

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Sat, 22 May 2004, Nicolás Lichtmaier wrote:

> When I'm bored I do this:
>
And you push work on all the translators, too:-)

Here are some comments. Mostly too long lines, but a few others. Also, I
didn't mention all cases with long lines. You have to look through the
last half of the patch for some more. Otherwise, it looks fine.

Index: subversion/libsvn_client/checkout.c
===================================================================
--- subversion/libsvn_client/checkout.c	(revisión: 9860)
+++ subversion/libsvn_client/checkout.c	(copia de trabajo)
@@ -93,10 +94,10 @@
       SVN_ERR (ra_lib->check_path (session, "", revnum, &kind, pool));
       if (kind == svn_node_none)
         return svn_error_createf (SVN_ERR_RA_ILLEGAL_URL, NULL,
-                                  "URL '%s' doesn't exist", URL);
+                                  _("URL '%s' doesn't exist"), URL);
       else if (kind == svn_node_file)
         return svn_error_createf (SVN_ERR_UNSUPPORTED_FEATURE , NULL,
-                                  "URL '%s' refers to a file, not a directory",
+                                  _("URL '%s' refers to a file, not a directory"),


Line length >80.


Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c	(revisión: 9860)
+++ subversion/libsvn_client/diff.c	(copia de trabajo)
@@ -89,8 +89,8 @@
   int i;

   SVN_ERR (file_printf_from_utf8 (file,
-                                  APR_EOL_STR "Property changes on: %s"
-                                  APR_EOL_STR, path));
+                                  _("%sProperty changes on: %s%s"),
+                                  APR_EOL_STR, APR_EOL_STR, path));

The last two args should be swapped. BTW, I don't know if this is part of the
diff "format", so should it really be translated? This last question
applies to the whole file, I think. Maybe others have an opinion?

Index: subversion/libsvn_client/commit_util.c
@@ -217,7 +217,7 @@
       && (kind != svn_node_none))
     {
       return svn_error_createf
-        (SVN_ERR_NODE_UNKNOWN_KIND, NULL, "Unknown entry kind for '%s'", path);
+        (SVN_ERR_NODE_UNKNOWN_KIND, NULL, _("Unknown entry kind for '%s'"), path);

Line length.

@@ -586,10 +586,10 @@
       SVN_ERR (svn_wc_entry (&entry, target, adm_access, FALSE, subpool));
       if (! entry)
         return svn_error_createf (SVN_ERR_ENTRY_NOT_FOUND, NULL,
-                                  "'%s' is not under version control", target);
+                                  _("'%s' is not under version control"), target);

Dito.

@@ -640,9 +640,9 @@
       if ((entry->copied) && (entry->schedule == svn_wc_schedule_normal))
         return svn_error_createf
           (SVN_ERR_ILLEGAL_TARGET, NULL,
-           "Entry for '%s' is marked as 'copied' but is not itself scheduled\n"
-           "for addition.  Perhaps you're committing a target that this\n"
-           "inside of an unversioned (or not-yet-versioned) directory?",
+           _("Entry for '%s' is marked as 'copied' but is not itself scheduled\n"
+             "for addition.  Perhaps you're committing a target that this\n"
+             "inside of an unversioned (or not-yet-versioned) directory?"),

Dito.

@@ -1334,10 +1334,10 @@
   const char *copystuffs = "";
   if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_revision))
     copystuffs = apr_psprintf (pool,
-                               " (copied from %s:%ld)",
+                               _(" (copied from %s:%ld)"),
                                copyfrom_path,
                                copyfrom_revision);
-  fprintf (stderr, "   Adding  : %s%s\n", path, copystuffs);
+  fprintf (stderr, _("   Adding  : %s%s\n"), path, copystuffs);
   *baton = new_baton;
   return (*db->eb->real_editor->add_file) (path, db->real_baton,
                                            copyfrom_path, copyfrom_revision,

This and the rest of this file is used for debugging only. We don't need to
internationalize that, do we? :-)

Index: subversion/clients/cmdline/propdel-cmd.c
===================================================================
--- subversion/clients/cmdline/propdel-cmd.c	(revisión: 9860)
+++ subversion/clients/cmdline/propdel-cmd.c	(copia de trabajo)
@@ -80,12 +82,12 @@
          which needs to be converted to a URL. */
       if (targets->nelts <= 0)
         return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, NULL,
-                                "No URL target available");
+                                _("No URL target available"));
       target = ((const char **) (targets->elts))[0];
       SVN_ERR (svn_client_url_from_path (&URL, target, pool));
       if (URL == NULL)
         return svn_error_create(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                                "Either a URL or versioned item is required");
+                                _("Either a URL or versioned item is required"));

Line length.

Index: subversion/clients/cmdline/log-cmd.c
===================================================================
--- subversion/clients/cmdline/log-cmd.c	(revisión: 9860)
+++ subversion/clients/cmdline/log-cmd.c	(copia de trabajo)
@@ -252,8 +253,9 @@
     {
       lines = num_lines (msg_stdout);
       SVN_ERR (svn_stream_printf (lb->out, pool,
-                                  " | %d line%s", lines,
-                                  (lines > 1) ? "s" : ""));
+                                  (lines == 1) ?
+                                          _(" | %d line") : _(" | %d lines"),
+                                  lines));
     }

Hmmm... Did we reach consensus about using ngettext? According to the gettext
manual, this doesn't work for all languages, i.e. languages with more than
two plural forms.

//Peter

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