summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign/querycontroller.cxx
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 /dbaccess/source/ui/querydesign/querycontroller.cxx
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 'dbaccess/source/ui/querydesign/querycontroller.cxx')
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx40
1 files changed, 19 insertions, 21 deletions
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index f2a3300374e0..4472d9375441 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -19,9 +19,12 @@
#include "adtabdlg.hxx"
#include "browserids.hxx"
-#include "dbu_qry.hrc"
+#include "core_resource.hxx"
+#include "strings.hrc"
+#include "query.hrc"
#include "dbu_reghelper.hxx"
-#include "dbustrings.hrc"
+#include "dbu_pageids.hxx"
+#include "stringconstants.hxx"
#include "defaultobjectnamecheck.hxx"
#include "dlgsave.hxx"
#include "uiservices.hxx"
@@ -72,7 +75,6 @@
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <sfx2/sfxsids.hrc>
-#include <tools/resary.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
#include <osl/diagnose.h>
@@ -209,12 +211,10 @@ namespace dbaui
namespace
{
- OUString lcl_getObjectResourceString( sal_uInt16 _nResId, sal_Int32 _nCommandType )
+ OUString lcl_getObjectResourceString(const char* pResId, sal_Int32 _nCommandType)
{
- OUString sMessageText = ModuleRes( _nResId );
- ModuleRes aResId(RSC_QUERY_OBJECT_TYPE);
- ResStringArray aResList(aResId);
- OUString sObjectType = aResList.GetString(_nCommandType);
+ OUString sMessageText = DBA_RES(pResId);
+ OUString sObjectType = DBA_RES(RSC_QUERY_OBJECT_TYPE[_nCommandType]);
sMessageText = sMessageText.replaceFirst( "$object$", sObjectType );
return sMessageText;
}
@@ -601,7 +601,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
if ( m_pSqlIterator->getStatementType() != OSQLStatementType::Select || rTabs.begin() == rTabs.end() )
{
aError = SQLException(
- ModuleRes( STR_QRY_NOSELECT ),
+ DBA_RES(STR_QRY_NOSELECT),
nullptr,
"S1000",
1000,
@@ -624,7 +624,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
else
{
aError = SQLException(
- ModuleRes( STR_QRY_SYNTAX ),
+ DBA_RES(STR_QRY_SYNTAX),
nullptr,
"S1000",
1000,
@@ -654,7 +654,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
break;
case SID_BROWSER_CLEAR_QUERY:
{
- GetUndoManager().EnterListAction( OUString( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString(), 0, ViewShellId(-1) );
+ GetUndoManager().EnterListAction(DBA_RES(STR_QUERY_UNDO_TABWINDELETE), OUString(), 0, ViewShellId(-1) );
getContainer()->clear();
GetUndoManager().LeaveListAction();
@@ -938,8 +938,8 @@ void OQueryController::impl_initialize()
m_nCommandType = CommandType::QUERY;
bool bClose = false;
{
- OUString aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) );
- OUString aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) );
+ OUString aTitle(DBA_RES(STR_QUERYDESIGN_NO_VIEW_SUPPORT));
+ OUString aMessage(DBA_RES(STR_QUERYDESIGN_NO_VIEW_ASK));
ODataView* pWindow = getView();
ScopedVclPtrInstance< OSQLMessageBox > aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query );
bClose = aDlg->Execute() == RET_NO;
@@ -956,7 +956,7 @@ void OQueryController::impl_initialize()
if ( !( aView >>= m_xAlterView ) )
{
throw IllegalArgumentException(
- ModuleRes( STR_NO_ALTER_VIEW_SUPPORT ),
+ DBA_RES(STR_NO_ALTER_VIEW_SUPPORT),
*this,
1
);
@@ -1034,7 +1034,7 @@ OUString OQueryController::getPrivateTitle( ) const
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
- OUString aDefaultName = ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE );
+ OUString aDefaultName = DBA_RES(editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE);
sName = aDefaultName.getToken(0,' ');
sName += OUString::number(getCurrentStartNumber());
}
@@ -1331,7 +1331,7 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b
aDefaultName = m_sName;
else
{
- OUString sName = ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE );
+ OUString sName = DBA_RES(editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE);
aDefaultName = sName.getToken(0,' ');
aDefaultName = ::dbtools::createUniqueName(_xElements,aDefaultName);
}
@@ -1365,7 +1365,7 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs)
OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!");
if ( !editingCommand() && !haveDataSource() )
{
- OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED));
+ OUString aMessage(DBA_RES(STR_DATASOURCE_DELETED));
ScopedVclPtrInstance<OSQLWarningBox>(getView(), aMessage)->Execute();
return false;
}
@@ -1715,9 +1715,7 @@ OUString OQueryController::translateStatement( bool _bFireStatementChange )
}
else if(m_sStatement.isEmpty())
{
- ModuleRes aModuleRes(STR_QRY_NOSELECT);
- OUString sTmpStr(aModuleRes);
- showError(SQLException(sTmpStr,nullptr,"S1000",1000,Any()));
+ showError(SQLException(DBA_RES(STR_QRY_NOSELECT), nullptr, "S1000", 1000, Any()));
}
else
sTranslatedStmt = m_sStatement;
@@ -1851,7 +1849,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings
{
if ( !i_bForceCurrentControllerSettings && !editingView() )
{
- OUString aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR));
+ OUString aTitle(DBA_RES(STR_SVT_SQL_SYNTAX_ERROR));
ScopedVclPtrInstance< OSQLMessageBox > aDlg(getView(),aTitle,aErrorMsg);
aDlg->Execute();
}