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

Re: Localization of schedule_str() values?

From: Karl Fogel <kfogel_at_google.com>
Date: 2006-08-22 11:06:57 CEST

Karl Fogel <kfogel@google.com> writes:
> 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?

As maxb pointed out to me in IRC, localizing the XML would be crazy.
(Really, I didn't mean that, I was just being, uh, rhetorical). What
I was really asking was, is there a factorization opportunity here?

But since r21177 turned out not to be as similar to the scheduling
code as I expected, the question is not so urgent anymore anyway.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 22 11:09:33 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.