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

[PATCH] Make conflict message translatable

From: Mattias Engdegård <mattiase_at_bredband.net>
Date: Fri, 29 Mar 2013 00:15:45 +0100

The conflict message "local %s %s, incoming %s %s upon %s" in
svn_cl__get_human_readable_tree_conflict_description is not correctly
prepared for localisation.
First, two of the parameters are inserted untranslated (in English),
making proper translation impossible; second, piecing together a
string from individual words does not work in general for many
translations, because of varying word order and concord.

The standard solution is to provide whole strings for each case, but
the number of combinations is probably just too big for that:
2*9*2*4*3 = 432, if all are possible (probably untrue). As a
compromise to keep it manageable, this patch only translates each sub-
phrase separately, resulting in 2*9 + 2*4 + 3 = 29 short strings.

The patch assumes that svn_node_none, svn_node_unknown or
svn_wc_operation_none cannot occur here. Please confirm or refute.

The produced (English) strings are not changed, although doing so
should perhaps be considered since these particular messages seem to
be particularly difficult to understand.

Implementation-wise, I preferred using switch statements to mucking
about with tables, since it made the code simpler and statically safer
(thanks to gcc's exhaustiveness check when switching on enums).

[[[
Make the conflict message "local %s %s, incoming %s %s upon %s"
translatable by constructing it from longer parts, each translated,
instead of single words (some of which were not translated at all).

* subversion/svn/cl-conflicts.c
   (svn_cl__get_human_readable_tree_conflict_description): Build
string out
    of translated sub-phrases rather than from single words.
   (local_reason_str, incoming_action_str, operation_str): New.
   (map_conflict_action_human, map_conflict_reason_human,
    action_str, reason_str): Removed.
]]]

Received on 2013-03-29 00:16:22 CET

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