[Libreoffice-commits] core.git: sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Nov 11 19:29:07 UTC 2018
sc/inc/globstr.hrc | 8 +++++++-
sc/source/ui/view/cellsh.cxx | 10 +++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
New commits:
commit 960f9045568317399b0dae4fd059a41566d8d3e9
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Nov 9 16:29:18 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Nov 11 20:28:46 2018 +0100
Resolves: tdf#83128 translate row/col counts as separate n_gettext args
Change-Id: I2aadeb92bbe482c766b1debf6278928d38dcc5d0
Reviewed-on: https://gerrit.libreoffice.org/63202
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 88e059d3270f..849db2c574d0 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -156,7 +156,13 @@
#define STR_PIVOT_TOTAL NC_("STR_PIVOT_TOTAL", "Total")
#define STR_PIVOT_DATA NC_("STR_PIVOT_DATA", "Data")
#define STR_PIVOT_GROUP NC_("STR_PIVOT_GROUP", "Group")
-#define STR_ROWCOL_SELCOUNT NC_("STR_ROWCOL_SELCOUNT", "$1 rows, $2 columns selected")
+/* To translators: $1 == will be replaced by STR_SELCOUNT_ROWARG, and $2 by STR_SELCOUNT_COLARG
+ e.g. Selected: 1 row, 2 columns */
+#define STR_SELCOUNT NC_("STR_SELCOUNT", "Selected: $1, $2")
+// To translators: STR_SELCOUNT_ROWARG is $1 of STR_SELCOUNT. $1 of STR_SELCOUNT_ROWARG is number of rows
+#define STR_SELCOUNT_ROWARG NNC_("STR_SELCOUNT_ROWARG", "$1 row", "$1 rows")
+// To translators: STR_SELCOUNT_COLARG is $1 of STR_SELCOUNT. $1 of STR_SELCOUNT_ROWARG is number of columns
+#define STR_SELCOUNT_COLARG NNC_("STR_SELCOUNT_COLARG", "$1 column", "$1 columns")
#define STR_FILTER_SELCOUNT NC_("STR_FILTER_SELCOUNT", "$1 of $2 records found")
#define STR_COLUMN NC_("STR_COLUMN", "Column")
#define STR_ROW NC_("STR_ROW", "Row")
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index d73fc4ad2f07..63228e880b9f 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -769,9 +769,13 @@ void ScCellShell::GetState(SfxItemSet &rSet)
nRow2 = aMarkRange.aEnd.Row();
if( nCol2 != nCol1 || nRow1 != nRow2 )
{
- OUString aStr = ScResId( STR_ROWCOL_SELCOUNT );
- aStr = aStr.replaceAll( "$1", OUString::number( nRow2 - nRow1 + 1 ));
- aStr = aStr.replaceAll( "$2", OUString::number( nCol2 - nCol1 + 1 ));
+ const auto nRows = nRow2 - nRow1 + 1;
+ OUString aRowArg = ScResId(STR_SELCOUNT_ROWARG, nRows).replaceAll("$1", OUString::number(nRows));
+ const auto nCols = nCol2 - nCol1 + 1;
+ OUString aColArg = ScResId(STR_SELCOUNT_COLARG, nCols).replaceAll("$1", OUString::number(nCols));
+ OUString aStr = ScResId(STR_SELCOUNT);
+ aStr = aStr.replaceAll("$1", aRowArg);
+ aStr = aStr.replaceAll("$2", aColArg);
rSet.Put( SfxStringItem( nWhich, aStr ) );
}
else
More information about the Libreoffice-commits
mailing list