summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2014-05-14 16:57:01 +0000
committerJazzyNico <nicoduf@yahoo.fr>2014-05-14 16:57:01 +0000
commit4fd60580e1dd021f5a16845ff9e580044835cbb0 (patch)
tree2e5272addc5a5a5c1bf8c7a38b7c5a31f197493b /src
parentDocumentation. Replace old menu items in the Tips and Basic tutorials. (diff)
downloadinkscape-4fd60580e1dd021f5a16845ff9e580044835cbb0.tar.gz
inkscape-4fd60580e1dd021f5a16845ff9e580044835cbb0.zip
i18n. Fix for Bug #1318929 (untranslatable string in trunk-r13370).
Translations. PO template update. Translations. French translation update. (bzr r13374)
Diffstat (limited to 'src')
-rw-r--r--src/selection-describer.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp
index 88450dfdf..1cb96fed0 100644
--- a/src/selection-describer.cpp
+++ b/src/selection-describer.cpp
@@ -56,6 +56,21 @@ char* collect_terms (GSList *items)
return g_strdup(ss.str().c_str());
}
+// Returns the number of terms in the list
+static int count_terms (GSList *items)
+{
+ GSList *check = NULL;
+ int count=0;
+ for (GSList *i = (GSList *)items; i != NULL; i = i->next) {
+ const char *term = SP_ITEM(i->data)->displayName();
+ if (term != NULL && g_slist_find (check, term) == NULL) {
+ check = g_slist_prepend (check, (void *) term);
+ count++;
+ }
+ }
+ return count;
+}
+
// Returns the number of filtered items in the list
static int count_filtered (GSList *items)
{
@@ -194,9 +209,12 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select
} else { // multiple items
int objcount = g_slist_length((GSList *)items);
char *terms = collect_terms ((GSList *)items);
-
- gchar *objects_str = g_strdup_printf(
- "<b>%i</b> objects selected of types %s", objcount, terms);
+ int n_terms = count_terms((GSList *)items);
+
+ gchar *objects_str = g_strdup_printf(ngettext(
+ "<b>%i</b> objects selected of type %s",
+ "<b>%i</b> objects selected of types %s", n_terms),
+ objcount, terms);
g_free(terms);