Kaydet (Commit) 41d58883 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#83128 translate word/char counts as separate n_gettext args

Change-Id: I2033f4ef51a861c7634dccdae885a842bb079913
Reviewed-on: https://gerrit.libreoffice.org/63465
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 890afecb
...@@ -770,9 +770,10 @@ void ScCellShell::GetState(SfxItemSet &rSet) ...@@ -770,9 +770,10 @@ void ScCellShell::GetState(SfxItemSet &rSet)
if( nCol2 != nCol1 || nRow1 != nRow2 ) if( nCol2 != nCol1 || nRow1 != nRow2 )
{ {
const auto nRows = nRow2 - nRow1 + 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; const auto nCols = nCol2 - nCol1 + 1;
OUString aColArg = ScResId(STR_SELCOUNT_COLARG, nCols).replaceAll("$1", OUString::number(nCols)); const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
OUString aRowArg = ScResId(STR_SELCOUNT_ROWARG, nRows).replaceAll("$1", rLocaleData.getNum(nRows, 0));
OUString aColArg = ScResId(STR_SELCOUNT_COLARG, nCols).replaceAll("$1", rLocaleData.getNum(nCols, 0));
OUString aStr = ScResId(STR_SELCOUNT); OUString aStr = ScResId(STR_SELCOUNT);
aStr = aStr.replaceAll("$1", aRowArg); aStr = aStr.replaceAll("$1", aRowArg);
aStr = aStr.replaceAll("$2", aColArg); aStr = aStr.replaceAll("$2", aColArg);
......
...@@ -281,8 +281,22 @@ ...@@ -281,8 +281,22 @@
#define STR_DELETE_NOTE_AUTHOR NC_("STR_DELETE_NOTE_AUTHOR", "Delete ~All Comments by $1") #define STR_DELETE_NOTE_AUTHOR NC_("STR_DELETE_NOTE_AUTHOR", "Delete ~All Comments by $1")
#define STR_HIDE_NOTE_AUTHOR NC_("STR_HIDE_NOTE_AUTHOR", "H~ide All Comments by $1") #define STR_HIDE_NOTE_AUTHOR NC_("STR_HIDE_NOTE_AUTHOR", "H~ide All Comments by $1")
#define STR_OUTLINE_NUMBERING NC_("STR_OUTLINE_NUMBERING", "Outline Numbering") #define STR_OUTLINE_NUMBERING NC_("STR_OUTLINE_NUMBERING", "Outline Numbering")
#define STR_STATUSBAR_WORDCOUNT_NO_SELECTION NC_("STR_STATUSBAR_WORDCOUNT_NO_SELECTION", "%1 words, %2 characters") /* To translators: $1 == will be replaced by STR_WORDCOUNT_WORDARG, and $2 by STR_WORDCOUNT_COLARG
#define STR_STATUSBAR_WORDCOUNT NC_("STR_STATUSBAR_WORDCOUNT", "%1 words, %2 characters selected") e.g. Selected: 1 word, 2 characters */
#define STR_WORDCOUNT NC_("STR_WORDCOUNT", "Selected: $1, $2")
// To translators: STR_WORDCOUNT_WORDARG is $1 of STR_WORDCOUNT. $1 of STR_WORDCOUNT is number of words
#define STR_WORDCOUNT_WORDARG NNC_("STR_WORDCOUNT_WORDARG", "$1 word", "$1 words")
// To translators: STR_WORDCOUNT_CHARARG is $1 of STR_WORDCOUNT. $1 of STR_WORDCOUNT_CHARARG is number of characters
#define STR_WORDCOUNT_CHARARG NNC_("STR_WORDCOUNT_CHARARG", "$1 character", "$1 characters")
/* To translators: $1 == will be replaced by STR_WORDCOUNT_WORDARG, and $2 by STR_WORDCOUNT_COLARG
e.g. 1 word, 2 characters */
#define STR_WORDCOUNT_NO_SELECTION NC_("STR_WORDCOUNT_NO_SELECTION", "$1, $2")
/* To translators: STR_WORDCOUNT_WORDARG_NO_SELECTION is $1 of STR_WORDCOUNT_NO_SELECTION.
$1 of STR_WORDCOUNT_NO_SELECTION is number of words */
#define STR_WORDCOUNT_WORDARG_NO_SELECTION NNC_("STR_WORDCOUNT_WORDARG_NO_SELECTION", "$1 word", "$1 words")
/* To translators: STR_WORDCOUNT_CHARARG_NO_SELECTION is $1 of STR_WORDCOUNT_NO_SELECTION.
$1 of STR_WORDCOUNT_CHARARG_NO_SELECTION is number of characters */
#define STR_WORDCOUNT_CHARARG_NO_SELECTION NNC_("STR_WORDCOUNT_CHARARG_NO_SELECTION", "$1 character", "$1 characters")
#define STR_CONVERT_TEXT_TABLE NC_("STR_CONVERT_TEXT_TABLE", "Convert Text to Table") #define STR_CONVERT_TEXT_TABLE NC_("STR_CONVERT_TEXT_TABLE", "Convert Text to Table")
#define STR_ADD_AUTOFORMAT_TITLE NC_("STR_ADD_AUTOFORMAT_TITLE", "Add AutoFormat") #define STR_ADD_AUTOFORMAT_TITLE NC_("STR_ADD_AUTOFORMAT_TITLE", "Add AutoFormat")
#define STR_ADD_AUTOFORMAT_LABEL NC_("STR_ADD_AUTOFORMAT_LABEL", "Name") #define STR_ADD_AUTOFORMAT_LABEL NC_("STR_ADD_AUTOFORMAT_LABEL", "Name")
......
...@@ -1335,10 +1335,17 @@ void SwView::StateStatusLine(SfxItemSet &rSet) ...@@ -1335,10 +1335,17 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
sal_uLong nWord = selectionStats.nWord ? selectionStats.nWord : documentStats.nWord; sal_uLong nWord = selectionStats.nWord ? selectionStats.nWord : documentStats.nWord;
sal_uLong nChar = selectionStats.nChar ? selectionStats.nChar : documentStats.nChar; sal_uLong nChar = selectionStats.nChar ? selectionStats.nChar : documentStats.nChar;
OUString aWordCount( SwResId( selectionStats.nWord ? STR_STATUSBAR_WORDCOUNT : STR_STATUSBAR_WORDCOUNT_NO_SELECTION ) ); const char* pResId = selectionStats.nWord ? STR_WORDCOUNT : STR_WORDCOUNT_NO_SELECTION;
const char* pWordResId = selectionStats.nWord ? STR_WORDCOUNT_WORDARG : STR_WORDCOUNT_WORDARG_NO_SELECTION;
const char* pCharResId = selectionStats.nWord ? STR_WORDCOUNT_CHARARG : STR_WORDCOUNT_CHARARG_NO_SELECTION;
const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper(); const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
aWordCount = aWordCount.replaceFirst( "%1", rLocaleData.getNum( nWord, 0 ) ); OUString aWordArg = SwResId(pWordResId, nWord).replaceAll("$1", rLocaleData.getNum(nWord, 0));
aWordCount = aWordCount.replaceFirst( "%2", rLocaleData.getNum( nChar, 0 ) ); OUString aCharArg = SwResId(pCharResId, nChar).replaceAll("$1", rLocaleData.getNum(nChar, 0));
OUString aWordCount(SwResId(pResId));
aWordCount = aWordCount.replaceAll("$1", aWordArg);
aWordCount = aWordCount.replaceAll("$2", aCharArg);
rSet.Put( SfxStringItem( FN_STAT_WORDCOUNT, aWordCount ) ); rSet.Put( SfxStringItem( FN_STAT_WORDCOUNT, aWordCount ) );
SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId())); SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment