summaryrefslogtreecommitdiff
path: root/sw/source/uibase/ribbar
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-11 20:56:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-21 08:20:50 +0100
commit00657aef09d854c74fb426a935a3e8b1fc390bb0 (patch)
treefd1a9bb264fe15dcc129498e62060ecd256b1ee7 /sw/source/uibase/ribbar
parentfa987cbb813cfd729fe490f2f1258b7c8d7fb174 (diff)
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 'sw/source/uibase/ribbar')
-rw-r--r--sw/source/uibase/ribbar/drawbase.cxx2
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx3
-rw-r--r--sw/source/uibase/ribbar/inputwin.src63
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx117
-rw-r--r--sw/source/uibase/ribbar/workctrl.src261
5 files changed, 90 insertions, 356 deletions
diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx
index f4a1078a6b99..1831acac18d1 100644
--- a/sw/source/uibase/ribbar/drawbase.cxx
+++ b/sw/source/uibase/ribbar/drawbase.cxx
@@ -36,7 +36,7 @@
#include "swmodule.hxx"
#include "swundo.hxx"
#include <SwRewriter.hxx>
-#include "comcore.hrc"
+#include "strings.hrc"
using namespace ::com::sun::star;
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index 36df87eac29d..b7b89547aba9 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -42,14 +42,13 @@
#include "cellatr.hxx"
#include "edtwin.hxx"
#include "helpid.h"
-#include "access.hrc"
+#include "strings.hrc"
#include "bitmaps.hlst"
// Only for the UpdateRange: Delete the box in which the stacked cursor is positioned.
#include "pam.hxx"
#include "swundo.hxx"
-#include "ribbar.hrc"
#include "dbui.hrc"
#include <IDocumentContentOperations.hxx>
diff --git a/sw/source/uibase/ribbar/inputwin.src b/sw/source/uibase/ribbar/inputwin.src
deleted file mode 100644
index 8f57dfb894d3..000000000000
--- a/sw/source/uibase/ribbar/inputwin.src
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-/* HelpID resource file */
-/* HelpID resource file */
-
-#include "cmdid.h"
-#include "helpid.h"
-#include "globals.hrc"
-#include "ribbar.hrc"
-#include "access.hrc"
-
-String STR_FORMULA_CALC
-{
- Text [ en-US ] = "Functions" ;
-};
-
-String STR_FORMULA_CANCEL
-{
- Text [ en-US ] = "Cancel" ;
-};
-
-String STR_FORMULA_APPLY
-{
- Text [ en-US ] = "Apply" ;
-};
-
-String STR_ACCESS_FORMULA_TOOLBAR
-{
- Text [ en-US ] = "Formula Tool Bar" ;
-};
-
-String STR_ACCESS_FORMULA_TYPE
-{
- Text [ en-US ] = "Formula Type" ;
-};
-
-String STR_ACCESS_FORMULA_TEXT
-{
- Text [ en-US ] = "Formula Text" ;
-};
-
-String STR_TBL_FORMULA
-{
- Text [ en-US ] = "Text Formula" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index c9090674893b..d6c7d3c8643d 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -34,7 +34,7 @@
#include <glosdoc.hxx>
#include <gloslst.hxx>
#include <workctrl.hxx>
-#include <ribbar.hrc>
+#include <strings.hrc>
#include <cmdid.h>
#include <helpid.h>
#include <wrtsh.hxx>
@@ -48,6 +48,7 @@
#include <vcl/svapp.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
+#include <svx/strings.hrc>
#include "bitmaps.hlst"
// Size check
@@ -234,6 +235,77 @@ static const char* aNavigationHelpIds[ NAVI_ENTRIES ] =
HID_NID_NEXT
};
+static const char* aNavigationStrIds[ NAVI_ENTRIES ] =
+{
+ // -- first line
+ ST_TBL,
+ ST_FRM,
+ ST_GRF,
+ ST_OLE,
+ ST_PGE,
+ ST_OUTL,
+ ST_MARK,
+ ST_DRW,
+ ST_CTRL,
+ STR_IMGBTN_PGE_UP,
+ // -- second line
+ ST_REG,
+ ST_BKM,
+ ST_SEL,
+ ST_FTN,
+ ST_POSTIT,
+ ST_SRCH_REP,
+ ST_INDEX_ENTRY,
+ ST_TABLE_FORMULA,
+ ST_TABLE_FORMULA_ERROR,
+ STR_IMGBTN_PGE_DOWN
+};
+
+// these are global strings
+static const char* STR_IMGBTN_ARY[] =
+{
+ nullptr,
+ nullptr,
+ STR_IMGBTN_TBL_DOWN,
+ STR_IMGBTN_FRM_DOWN,
+ STR_IMGBTN_PGE_DOWN,
+ STR_IMGBTN_DRW_DOWN,
+ STR_IMGBTN_CTRL_DOWN,
+ STR_IMGBTN_REG_DOWN,
+ STR_IMGBTN_BKM_DOWN,
+ STR_IMGBTN_GRF_DOWN,
+ STR_IMGBTN_OLE_DOWN,
+ STR_IMGBTN_OUTL_DOWN,
+ STR_IMGBTN_SEL_DOWN,
+ STR_IMGBTN_FTN_DOWN,
+ STR_IMGBTN_MARK_DOWN,
+ STR_IMGBTN_POSTIT_DOWN,
+ STR_IMGBTN_SRCH_REP_DOWN,
+ STR_IMGBTN_INDEX_ENTRY_DOWN,
+ STR_IMGBTN_TBLFML_DOWN,
+ STR_IMGBTN_TBLFML_ERR_DOWN,
+ nullptr,
+ nullptr,
+ STR_IMGBTN_TBL_UP,
+ STR_IMGBTN_FRM_UP,
+ STR_IMGBTN_PGE_UP,
+ STR_IMGBTN_DRW_UP,
+ STR_IMGBTN_CTRL_UP,
+ STR_IMGBTN_REG_UP,
+ STR_IMGBTN_BKM_UP,
+ STR_IMGBTN_GRF_UP,
+ STR_IMGBTN_OLE_UP,
+ STR_IMGBTN_OUTL_UP,
+ STR_IMGBTN_SEL_UP,
+ STR_IMGBTN_FTN_UP,
+ STR_IMGBTN_MARK_UP,
+ STR_IMGBTN_POSTIT_UP,
+ STR_IMGBTN_SRCH_REP_UP,
+ STR_IMGBTN_INDEX_ENTRY_UP,
+ STR_IMGBTN_TBLFML_UP,
+ STR_IMGBTN_TBLFML_ERR_UP
+};
+
SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window *pParent)
: SfxPopupWindow(nId, pParent, "FloatingNavigation",
"modules/swriter/ui/floatingnavigation.ui", rFrame)
@@ -249,34 +321,22 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >&
for( i = 0; i < NID_COUNT; i++)
{
sal_uInt16 nNaviId = aNavigationInsertIds[i];
- OUString sText;
- ToolBoxItemBits nTbxBits = ToolBoxItemBits::NONE;
- if((NID_PREV != nNaviId) && (NID_NEXT != nNaviId))
- {
- // -2, there's no string for Next/Prev
- sal_uInt16 nResStr = ST_TBL - 2 + nNaviId - NID_START;
- sText = SwResId(nResStr);
+ ToolBoxItemBits nTbxBits = ToolBoxItemBits::NONE;
+ if ((NID_PREV != nNaviId) && (NID_NEXT != nNaviId))
nTbxBits = ToolBoxItemBits::CHECKABLE;
- }
- else
- {
- if (nNaviId == NID_PREV)
- sText = SwResId(STR_IMGBTN_PGE_UP);
- else if (nNaviId == NID_NEXT)
- sText = SwResId(STR_IMGBTN_PGE_DOWN);
- }
-
m_pToolBox->InsertItem(nNaviId, Image(BitmapEx(aNavigationImgIds[i])),
- sText, nTbxBits);
+ SwResId(aNavigationStrIds[i]), nTbxBits);
m_pToolBox->SetHelpId(nNaviId, aNavigationHelpIds[i]);
}
m_pToolBox->InsertBreak(NID_COUNT/2);
- // these are global strings
- for( i = 0; i < 2 * NID_COUNT; i++)
+ for (i = 0; i < SAL_N_ELEMENTS(STR_IMGBTN_ARY); ++i)
{
- sQuickHelp[i] = SwResId(STR_IMGBTN_START + i);
+ const char* id = STR_IMGBTN_ARY[i];
+ if (!id)
+ continue;
+ sQuickHelp[i] = SwResId(id);
}
sal_uInt16 nItemId = SwView::GetMoveType();
@@ -354,11 +414,11 @@ void SwScrollNaviToolBox::RequestHelp( const HelpEvent& rHEvt )
OUString SwScrollNaviPopup::GetToolTip(bool bNext)
{
- sal_uInt16 nResId = STR_IMGBTN_START;
- nResId += SwView::GetMoveType() - NID_START;
- if(!bNext)
+ sal_uInt16 nResId = SwView::GetMoveType();
+ if (!bNext)
nResId += NID_COUNT;
- return SwResId(nResId);
+ const char* id = STR_IMGBTN_ARY[nResId];
+ return id ? SwResId(id): OUString();
}
class SwZoomBox_Impl : public ComboBox
@@ -387,18 +447,17 @@ SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
SetHelpId(HID_PVIEW_ZOOM_LB);
SetSizePixel(LogicToPixel(Size(30, 86), MapUnit::MapAppFont));
EnableAutocomplete( false );
- sal_uInt16 aZoomValues[] =
+ const char* aZoomValues[] =
{ RID_SVXSTR_ZOOM_25 , RID_SVXSTR_ZOOM_50 ,
RID_SVXSTR_ZOOM_75 , RID_SVXSTR_ZOOM_100 ,
RID_SVXSTR_ZOOM_150 , RID_SVXSTR_ZOOM_200 ,
RID_SVXSTR_ZOOM_WHOLE_PAGE, RID_SVXSTR_ZOOM_PAGE_WIDTH ,
RID_SVXSTR_ZOOM_OPTIMAL_VIEW };
- for(sal_uInt16 aZoomValue : aZoomValues)
+ for(const char* pZoomValue : aZoomValues)
{
- OUString sEntry = SvxResId( aZoomValue );
+ OUString sEntry = SvxResId(pZoomValue);
InsertEntry(sEntry);
}
-
}
void SwZoomBox_Impl::Select()
diff --git a/sw/source/uibase/ribbar/workctrl.src b/sw/source/uibase/ribbar/workctrl.src
deleted file mode 100644
index 3e1d2236db26..000000000000
--- a/sw/source/uibase/ribbar/workctrl.src
+++ /dev/null
@@ -1,261 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <svx/svxids.hrc>
-#include "globals.hrc"
-#include "ribbar.hrc"
-#include "helpid.h"
-#include "cmdid.h"
-
-String ST_TBL
-{
- Text [ en-US ] = "Table" ;
-};
-String ST_FRM
-{
- Text [ en-US ] = "Text Frame" ;
-};
-String ST_PGE
-{
- Text [ en-US ] = "Page" ;
-};
-String ST_DRW
-{
- Text [ en-US ] = "Drawing" ;
-};
-String ST_CTRL
-{
- Text [ en-US ] = "Control" ;
-};
-String ST_REG
-{
- Text [ en-US ] = "Section" ;
-};
-String ST_BKM
-{
- Text [ en-US ] = "Bookmark" ;
-};
-String ST_GRF
-{
- Text [ en-US ] = "Graphics" ;
-};
-String ST_OLE
-{
- Text [ en-US ] = "OLE object" ;
-};
-String ST_OUTL
-{
- Text [ en-US ] = "Headings" ;
-};
-String ST_SEL
-{
- Text [ en-US ] = "Selection" ;
-};
-String ST_FTN
-{
- Text [ en-US ] = "Footnote" ;
-};
-String ST_MARK
-{
- Text [ en-US ] = "Reminder" ;
-};
-String ST_POSTIT
-{
- Text [ en-US ] = "Comment" ;
-};
-String ST_SRCH_REP
-{
- Text [ en-US ] = "Repeat search" ;
-};
-String ST_INDEX_ENTRY
-{
- Text [ en-US ] = "Index entry";
-};
-String ST_TABLE_FORMULA
-{
- Text [ en-US ] = "Table formula";
-};
-String ST_TABLE_FORMULA_ERROR
-{
- Text [ en-US ] = "Wrong table formula";
-};
-
-// Strings for the quickhelp of the View-PgUp/Down-Buttons
-
-String STR_IMGBTN_NEXT_DOWN
-{
- Text = "" ;
-};
-String STR_IMGBTN_PREV_DOWN
-{
- Text = "" ;
-};
-String STR_IMGBTN_TBL_DOWN
-{
- Text [ en-US ] = "Next table" ;
-};
-String STR_IMGBTN_FRM_DOWN
-{
- Text [ en-US ] = "Next text frame" ;
-};
-String STR_IMGBTN_PGE_DOWN
-{
- Text [ en-US ] = "Next page" ;
-};
-String STR_IMGBTN_DRW_DOWN
-{
- Text [ en-US ] = "Next drawing" ;
-};
-String STR_IMGBTN_CTRL_DOWN
-{
- Text [ en-US ] = "Next control" ;
-};
-String STR_IMGBTN_REG_DOWN
-{
- Text [ en-US ] = "Next section" ;
-};
-String STR_IMGBTN_BKM_DOWN
-{
- Text [ en-US ] = "Next bookmark" ;
-};
-String STR_IMGBTN_GRF_DOWN
-{
- Text [ en-US ] = "Next graphic" ;
-};
-String STR_IMGBTN_OLE_DOWN
-{
- Text [ en-US ] = "Next OLE object" ;
-};
-String STR_IMGBTN_OUTL_DOWN
-{
- Text [ en-US ] = "Next heading" ;
-};
-String STR_IMGBTN_SEL_DOWN
-{
- Text [ en-US ] = "Next selection" ;
-};
-String STR_IMGBTN_FTN_DOWN
-{
- Text [ en-US ] = "Next footnote" ;
-};
-String STR_IMGBTN_MARK_DOWN
-{
- Text [ en-US ] = "Next Reminder" ;
-};
-String STR_IMGBTN_POSTIT_DOWN
-{
- Text [ en-US ] = "Next Comment" ;
-};
-String STR_IMGBTN_SRCH_REP_DOWN
-{
- Text [ en-US ] = "Continue search forward" ;
-};
-String STR_IMGBTN_INDEX_ENTRY_DOWN
-{
- Text [ en-US ] = "Next index entry";
-};
-String STR_IMGBTN_NEXT_UP
-{
- Text = "" ;
-};
-String STR_IMGBTN_PREV_UP
-{
- Text = "" ;
-};
-String STR_IMGBTN_TBL_UP
-{
- Text [ en-US ] = "Previous table" ;
-};
-String STR_IMGBTN_FRM_UP
-{
- Text [ en-US ] = "Previous text frame" ;
-};
-String STR_IMGBTN_PGE_UP
-{
- Text [ en-US ] = "Previous page" ;
-};
-String STR_IMGBTN_DRW_UP
-{
- Text [ en-US ] = "Previous drawing" ;
-};
-String STR_IMGBTN_CTRL_UP
-{
- Text [ en-US ] = "Previous control" ;
-};
-String STR_IMGBTN_REG_UP
-{
- Text [ en-US ] = "Previous section" ;
-};
-String STR_IMGBTN_BKM_UP
-{
- Text [ en-US ] = "Previous bookmark" ;
-};
-String STR_IMGBTN_GRF_UP
-{
- Text [ en-US ] = "Previous graphic" ;
-};
-String STR_IMGBTN_OLE_UP
-{
- Text [ en-US ] = "Previous OLE object" ;
-};
-String STR_IMGBTN_OUTL_UP
-{
- Text [ en-US ] = "Previous heading" ;
-};
-String STR_IMGBTN_SEL_UP
-{
- Text [ en-US ] = "Previous selection" ;
-};
-String STR_IMGBTN_FTN_UP
-{
- Text [ en-US ] = "Previous footnote" ;
-};
-String STR_IMGBTN_MARK_UP
-{
- Text [ en-US ] = "Previous Reminder" ;
-};
-String STR_IMGBTN_POSTIT_UP
-{
- Text [ en-US ] = "Previous Comment" ;
-};
-String STR_IMGBTN_SRCH_REP_UP
-{
- Text [ en-US ] = "Continue search backwards" ;
-};
-String STR_IMGBTN_INDEX_ENTRY_UP
-{
- Text [ en-US ] = "Previous index entry";
-};
-String STR_IMGBTN_TBLFML_UP
-{
- Text [ en-US ] = "Previous table formula";
-};
-String STR_IMGBTN_TBLFML_DOWN
-{
- Text [ en-US ] = "Next table formula";
-};
-String STR_IMGBTN_TBLFML_ERR_UP
-{
- Text [ en-US ] = "Previous faulty table formula";
-};
-String STR_IMGBTN_TBLFML_ERR_DOWN
-{
- Text [ en-US ] = "Next faulty table formula";
-};
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */