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

Localization of schedule_str() values?

From: Karl Fogel <kfogel_at_google.com>
Date: 2006-08-22 10:09:08 CEST

Should we localize this code in subversion/svn/info-cmd.c:

   /* Return string representation of SCHEDULE */
   static const char *
   schedule_str(svn_wc_schedule_t schedule)
   {
     switch (schedule)
       {
       case svn_wc_schedule_normal:
         return "normal";
       case svn_wc_schedule_add:
         return "add";
       case svn_wc_schedule_delete:
         return "delete";
       case svn_wc_schedule_replace:
         return "replace";
       default:
         return "none";
       }
   }

By which I mean wrapping the return values like this:

   _("normal")
   _("add")
   _("delete")
   _("replace")
   _("none")

Is there a localization best practice that counsels against this?

You might answer that the schedule strings are only used in
print_info_xml(), and of course none of the XML output is localized,
because the DTD is only in English on purpose, and therefore the
possible cdata values are likewise in English.

But here's what I was thinking: I wanted to factor some code by using
schedule_str() to replace the 'switch (info->schedule)' block in the
non-XML function, print_info(). (I noticed the unfactored code while
adding similar code for printing depths.)

It might be that the code is currently unfactored precisely because it
is appropriate to localize the human-oriented output, but not the XML
output. Is that what's going on here?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 22 10:09:47 2006

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.