diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-11 20:56:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-21 08:20:50 +0100 |
commit | 00657aef09d854c74fb426a935a3e8b1fc390bb0 (patch) | |
tree | fd1a9bb264fe15dcc129498e62060ecd256b1ee7 /sc/source/ui/undo | |
parent | osl: Unix pipe converted from OSL_ASSERT to assert/SAL_WARNs (diff) | |
download | core-00657aef09d854c74fb426a935a3e8b1fc390bb0.tar.gz core-00657aef09d854c74fb426a935a3e8b1fc390bb0.zip |
migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
results in inserting the english original so something can be found, now the
standard fallback of using the english original from the source key is used, so
partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
com::sun::star::resource::OfficeResourceLoader
com::sun::star::resource::XResourceBundleLoader
com::sun::star::resource::XResourceBundle
when translating strings via uno apis
com.sun.star.resource.StringResourceWithLocation
can continue to be used
Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/undo/undocell.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/undo/undodat.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/undo/undostyl.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/undo/undotab.cxx | 19 |
5 files changed, 26 insertions, 25 deletions
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index f4ad5170139a..8573e1768485 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1934,8 +1934,8 @@ ScUndoIndent::~ScUndoIndent() OUString ScUndoIndent::GetComment() const { - sal_uInt16 nId = bIsIncrement ? STR_UNDO_INC_INDENT : STR_UNDO_DEC_INDENT; - return ScGlobal::GetRscString( nId ); + const char* pId = bIsIncrement ? STR_UNDO_INC_INDENT : STR_UNDO_DEC_INDENT; + return ScGlobal::GetRscString(pId); } void ScUndoIndent::Undo() diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index df07b286bd04..173a569a8002 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -874,18 +874,18 @@ ScUndoDetective::~ScUndoDetective() OUString ScUndoDetective::GetComment() const { - sal_uInt16 nId = STR_UNDO_DETDELALL; + const char* pId = STR_UNDO_DETDELALL; if ( !bIsDelete ) switch ( (ScDetOpType) nAction ) { - case SCDETOP_ADDSUCC: nId = STR_UNDO_DETADDSUCC; break; - case SCDETOP_DELSUCC: nId = STR_UNDO_DETDELSUCC; break; - case SCDETOP_ADDPRED: nId = STR_UNDO_DETADDPRED; break; - case SCDETOP_DELPRED: nId = STR_UNDO_DETDELPRED; break; - case SCDETOP_ADDERROR: nId = STR_UNDO_DETADDERROR; break; + case SCDETOP_ADDSUCC: pId = STR_UNDO_DETADDSUCC; break; + case SCDETOP_DELSUCC: pId = STR_UNDO_DETDELSUCC; break; + case SCDETOP_ADDPRED: pId = STR_UNDO_DETADDPRED; break; + case SCDETOP_DELPRED: pId = STR_UNDO_DETDELPRED; break; + case SCDETOP_ADDERROR: pId = STR_UNDO_DETADDERROR; break; } - return ScGlobal::GetRscString( nId ); + return ScGlobal::GetRscString(pId); } void ScUndoDetective::Undo() diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index c1a19e9ec490..965fcf6f912e 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -1376,15 +1376,15 @@ ScUndoDataPilot::ScUndoDataPilot( ScDocShell* pNewDocShell, OUString ScUndoDataPilot::GetComment() const { - sal_uInt16 nIndex; + const char* pResId; if (xOldUndoDoc && xNewUndoDoc) - nIndex = STR_UNDO_PIVOT_MODIFY; + pResId = STR_UNDO_PIVOT_MODIFY; else if (xNewUndoDoc) - nIndex = STR_UNDO_PIVOT_NEW; + pResId = STR_UNDO_PIVOT_NEW; else - nIndex = STR_UNDO_PIVOT_DELETE; + pResId = STR_UNDO_PIVOT_DELETE; - return ScGlobal::GetRscString( nIndex ); + return ScGlobal::GetRscString(pResId); } void ScUndoDataPilot::Undo() diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index a021422bdf25..1af29c7bc135 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -80,10 +80,10 @@ ScUndoModifyStyle::~ScUndoModifyStyle() OUString ScUndoModifyStyle::GetComment() const { - sal_uInt16 nId = (eFamily == SfxStyleFamily::Para) ? + const char* pId = (eFamily == SfxStyleFamily::Para) ? STR_UNDO_EDITCELLSTYLE : STR_UNDO_EDITPAGESTYLE; - return ScGlobal::GetRscString( nId ); + return ScGlobal::GetRscString(pId); } static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bool bRemoved ) diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index f3dc9aa6fe5d..09bcd659431b 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -28,7 +28,8 @@ #include "tabvwsh.hxx" #include "globstr.hrc" #include "global.hxx" -#include "scres.hrc" +#include "sc.hrc" +#include "strings.hrc" #include "undoolk.hxx" #include "target.hxx" #include "uiitems.hxx" @@ -1143,17 +1144,17 @@ bool ScUndoShowHideTab::CanRepeat(SfxRepeatTarget& rTarget) const OUString ScUndoShowHideTab::GetComment() const { - sal_uInt16 nId; + const char* pId; if (undoTabs.size() > 1) { - nId = bShow ? STR_UNDO_SHOWTABS : STR_UNDO_HIDETABS; + pId = bShow ? STR_UNDO_SHOWTABS : STR_UNDO_HIDETABS; } else { - nId = bShow ? STR_UNDO_SHOWTAB : STR_UNDO_HIDETAB; + pId = bShow ? STR_UNDO_SHOWTAB : STR_UNDO_HIDETAB; } - return ScGlobal::GetRscString( nId ); + return ScGlobal::GetRscString(pId); } ScUndoDocProtect::ScUndoDocProtect(ScDocShell* pShell, unique_ptr<ScDocProtection> && pProtectSettings) : @@ -1219,8 +1220,8 @@ bool ScUndoDocProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const OUString ScUndoDocProtect::GetComment() const { - sal_uInt16 nId = mpProtectSettings->isProtected() ? STR_UNDO_PROTECT_DOC : STR_UNDO_UNPROTECT_DOC; - return ScGlobal::GetRscString( nId ); + const char* pId = mpProtectSettings->isProtected() ? STR_UNDO_PROTECT_DOC : STR_UNDO_UNPROTECT_DOC; + return ScGlobal::GetRscString(pId); } ScUndoTabProtect::ScUndoTabProtect(ScDocShell* pShell, SCTAB nTab, unique_ptr<ScTableProtection> && pProtectSettings) : @@ -1287,8 +1288,8 @@ bool ScUndoTabProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const OUString ScUndoTabProtect::GetComment() const { - sal_uInt16 nId = mpProtectSettings->isProtected() ? STR_UNDO_PROTECT_TAB : STR_UNDO_UNPROTECT_TAB; - return ScGlobal::GetRscString( nId ); + const char* pId = mpProtectSettings->isProtected() ? STR_UNDO_PROTECT_TAB : STR_UNDO_UNPROTECT_TAB; + return ScGlobal::GetRscString(pId); } ScUndoPrintRange::ScUndoPrintRange( ScDocShell* pShell, SCTAB nNewTab, |