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 /dbaccess/source/ui/uno | |
parent | fa987cbb813cfd729fe490f2f1258b7c8d7fb174 (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/uno')
-rw-r--r-- | dbaccess/source/ui/uno/ColumnControl.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/ColumnModel.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/ColumnPeer.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/composerdialogs.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/composerdialogs.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/copytablewizard.cxx | 34 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/copytablewizard.src | 77 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/dbinteraction.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/dbinteraction.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/textconnectionsettings_uno.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/unoDirectSql.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/unoDirectSql.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/unoadmin.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/unosqlmessage.cxx | 3 |
14 files changed, 37 insertions, 110 deletions
diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index e5b94f995e51..deb5184edf53 100644 --- a/dbaccess/source/ui/uno/ColumnControl.cxx +++ b/dbaccess/source/ui/uno/ColumnControl.cxx @@ -19,7 +19,7 @@ #include "ColumnControl.hxx" #include "ColumnPeer.hxx" -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include "uiservices.hxx" #include "apitools.hxx" #include <com/sun/star/awt/PosSize.hpp> diff --git a/dbaccess/source/ui/uno/ColumnModel.cxx b/dbaccess/source/ui/uno/ColumnModel.cxx index c42af2059b46..0556c0e6b61a 100644 --- a/dbaccess/source/ui/uno/ColumnModel.cxx +++ b/dbaccess/source/ui/uno/ColumnModel.cxx @@ -25,7 +25,7 @@ #include <cppuhelper/queryinterface.hxx> #include <comphelper/extract.hxx> -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include "dbu_reghelper.hxx" #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/property.hxx> diff --git a/dbaccess/source/ui/uno/ColumnPeer.cxx b/dbaccess/source/ui/uno/ColumnPeer.cxx index 1e7bae1ca536..7ae3187fb240 100644 --- a/dbaccess/source/ui/uno/ColumnPeer.cxx +++ b/dbaccess/source/ui/uno/ColumnPeer.cxx @@ -20,7 +20,8 @@ #include "ColumnPeer.hxx" #include "ColumnControlWindow.hxx" #include <vcl/svapp.hxx> -#include "dbustrings.hrc" +#include "stringconstants.hxx" +#include "strings.hxx" #include "FieldDescriptions.hxx" namespace dbaui diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 1cdc2984e090..42d71cea3199 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -22,7 +22,7 @@ #include "dbu_reghelper.hxx" #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include "queryfilter.hxx" #include "queryorder.hxx" #include <comphelper/processfactory.hxx> diff --git a/dbaccess/source/ui/uno/composerdialogs.hxx b/dbaccess/source/ui/uno/composerdialogs.hxx index 4d59b432f596..c274edca67b7 100644 --- a/dbaccess/source/ui/uno/composerdialogs.hxx +++ b/dbaccess/source/ui/uno/composerdialogs.hxx @@ -27,7 +27,7 @@ #include <com/sun/star/sdbc/XRowSet.hpp> #include <svtools/genericunodialog.hxx> -#include "moduledbu.hxx" +#include "core_resource.hxx" #include "apitools.hxx" namespace dbaui @@ -41,7 +41,7 @@ namespace dbaui :public svt::OGenericUnoDialog ,public ComposerDialog_PBASE { - OModuleClient m_aModuleClient; + dbaccess::OModuleClient m_aModuleClient; protected: // <properties> css::uno::Reference< css::sdb::XSingleSelectQueryComposer > diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index f1f81c6d3991..60462ff3781c 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -19,10 +19,12 @@ #include <memory> #include "dbu_reghelper.hxx" -#include "dbu_resource.hrc" -#include "dbu_uno.hrc" -#include "dbustrings.hrc" -#include "moduledbu.hxx" +#include "dbu_pageids.hxx" +#include "strings.hrc" +#include "strings.hxx" +#include "stringconstants.hxx" +#include "core_resource.hxx" +#include "core_resource.hxx" #include "sqlmessage.hxx" #include "uiservices.hxx" #include "WCopyTable.hxx" @@ -460,7 +462,7 @@ void SAL_CALL CopyTableWizard::setOperation( ::sal_Int16 _operation ) && !OCopyTableWizard::supportsViews( m_xDestConnection ) ) throw IllegalArgumentException( - ModuleRes( STR_CTW_NO_VIEWS_SUPPORT ), + DBA_RES( STR_CTW_NO_VIEWS_SUPPORT ), *this, 1 ); @@ -492,7 +494,7 @@ void SAL_CALL CopyTableWizard::setCreatePrimaryKey( const Optional< OUString >& if ( _newPrimaryKey.IsPresent && !OCopyTableWizard::supportsPrimaryKey( m_xDestConnection ) ) throw IllegalArgumentException( - ModuleRes( STR_CTW_NO_PRIMARY_KEY_SUPPORT ), + DBA_RES( STR_CTW_NO_PRIMARY_KEY_SUPPORT ), *this, 1 ); @@ -657,7 +659,7 @@ Reference< XPropertySet > CopyTableWizard::impl_ensureDataAccessDescriptor_throw if ( !bIsValid ) { throw IllegalArgumentException( - ModuleRes( STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR ), + DBA_RES( STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR ), *const_cast< CopyTableWizard* >( this ), _nArgPos + 1 ); @@ -701,7 +703,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X if ( !sUnsupportedSetting.isEmpty() ) { OUString sMessage( - OUString(ModuleRes(STR_CTW_ERROR_UNSUPPORTED_SETTING)). + DBA_RES(STR_CTW_ERROR_UNSUPPORTED_SETTING). replaceFirst("$name$", sUnsupportedSetting)); throw IllegalArgumentException( sMessage, @@ -749,7 +751,7 @@ std::unique_ptr< ICopyTableSourceObject > CopyTableWizard::impl_extractSourceObj break; default: throw IllegalArgumentException( - ModuleRes( STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT ), + DBA_RES( STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT ), *const_cast< CopyTableWizard* >( this ), 1 ); @@ -768,7 +770,7 @@ std::unique_ptr< ICopyTableSourceObject > CopyTableWizard::impl_extractSourceObj if ( _out_rCommandType == CommandType::QUERY ) // we cannot copy a query if the connection cannot provide it ... throw IllegalArgumentException( - ModuleRes( STR_CTW_ERROR_NO_QUERY ), + DBA_RES( STR_CTW_ERROR_NO_QUERY ), *const_cast< CopyTableWizard* >( this ), 1 ); @@ -806,7 +808,7 @@ void CopyTableWizard::impl_extractSourceResultSet_throw( const Reference< XPrope if ( !xRowLocate.is() ) { ::dbtools::throwGenericSQLException( - OUString( ModuleRes( STR_CTW_COPY_SOURCE_NEEDS_BOOKMARKS ) ), + DBA_RES(STR_CTW_COPY_SOURCE_NEEDS_BOOKMARKS), *this ); } @@ -1045,7 +1047,7 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r { SQLContext aError; aError.Context = *this; - aError.Message = OUString( ModuleRes( STR_ERROR_OCCURRED_WHILE_COPYING ) ); + aError.Message = DBA_RES(STR_ERROR_OCCURRED_WHILE_COPYING); ::dbtools::SQLExceptionInfo aInfo( _rEvent.Error ); if ( aInfo.isValid() ) @@ -1276,7 +1278,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou default: { - OUString aMessage( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ); + OUString aMessage( DBA_RES( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ); aMessage = aMessage.replaceFirst( "$type$", OUString::number( aSourceColTypes[ nSourceColumn ] ) ); aMessage = aMessage.replaceFirst( "$pos$", OUString::number( nSourceColumn ) ); @@ -1458,7 +1460,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) sal_Int32 nArgCount( _rArguments.getLength() ); if ( ( nArgCount != 2 ) && ( nArgCount != 3 ) ) throw IllegalArgumentException( - ModuleRes( STR_CTW_ILLEGAL_PARAMETER_COUNT ), + DBA_RES( STR_CTW_ILLEGAL_PARAMETER_COUNT ), *this, 1 ); @@ -1469,7 +1471,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) { // ->createWithInteractionHandler if ( !( _rArguments[2] >>= m_xInteractionHandler ) ) throw IllegalArgumentException( - ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER ), + DBA_RES( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER ), *this, 3 ); @@ -1494,7 +1496,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) catch( const Exception& ) { throw WrappedTargetException( - ModuleRes( STR_CTW_ERROR_DURING_INITIALIZATION ), + DBA_RES( STR_CTW_ERROR_DURING_INITIALIZATION ), *this, ::cppu::getCaughtException() ); diff --git a/dbaccess/source/ui/uno/copytablewizard.src b/dbaccess/source/ui/uno/copytablewizard.src deleted file mode 100644 index 4d5a09b6cf01..000000000000 --- a/dbaccess/source/ui/uno/copytablewizard.src +++ /dev/null @@ -1,77 +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 "dbu_uno.hrc" - -String STR_CTW_NO_VIEWS_SUPPORT -{ - Text [ en-US ] = "The destination database does not support views."; -}; - -String STR_CTW_NO_PRIMARY_KEY_SUPPORT -{ - Text [ en-US ] = "The destination database does not support primary keys."; -}; - -String STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR -{ - Text [ en-US ] = "no data access descriptor found, or no data access descriptor able to provide all necessary information"; -}; - -String STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT -{ - Text [ en-US ] = "Only tables and queries are supported at the moment."; -}; - -String STR_CTW_COPY_SOURCE_NEEDS_BOOKMARKS -{ - Text [ en-US ] = "The copy source's result set must support bookmarks."; -}; - -String STR_CTW_UNSUPPORTED_COLUMN_TYPE -{ - Text [ en-US ] = "Unsupported source column type ($type$) at column position $pos$."; -}; - -String STR_CTW_ILLEGAL_PARAMETER_COUNT -{ - Text [ en-US ] = "Illegal number of initialization parameters."; -}; - -String STR_CTW_ERROR_DURING_INITIALIZATION -{ - Text [ en-US ] = "An error occurred during initialization."; -}; - -String STR_CTW_ERROR_UNSUPPORTED_SETTING -{ - Text [ en-US ] = "Unsupported setting in the copy source descriptor: $name$."; -}; - -String STR_CTW_ERROR_NO_QUERY -{ - Text [ en-US ] = "To copy a query, your connection must be able to provide queries."; -}; - -String STR_CTW_ERROR_INVALID_INTERACTIONHANDLER -{ - Text [ en-US ] = "The given interaction handler is invalid."; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index f4e413fd1273..119a729f699b 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -33,7 +33,7 @@ #include <com/sun/star/sdb/XInteractionSupplyParameters.hpp> #include <com/sun/star/sdb/XInteractionDocumentSave.hpp> #include <sfx2/QuerySaveDocument.hxx> -#include "dbu_uno.hrc" +#include "strings.hrc" #include "paramdialog.hxx" #include <vcl/svapp.hxx> #include "CollectionView.hxx" diff --git a/dbaccess/source/ui/uno/dbinteraction.hxx b/dbaccess/source/ui/uno/dbinteraction.hxx index 5166a6bde184..a3ebfeb8100b 100644 --- a/dbaccess/source/ui/uno/dbinteraction.hxx +++ b/dbaccess/source/ui/uno/dbinteraction.hxx @@ -22,7 +22,7 @@ #include <cppuhelper/implbase.hxx> -#include "moduledbu.hxx" +#include "core_resource.hxx" #include "apitools.hxx" #include <com/sun/star/lang/XServiceInfo.hpp> @@ -62,7 +62,7 @@ namespace dbaui class BasicInteractionHandler :public BasicInteractionHandler_Base { - const OModuleClient m_aModuleClient; + const dbaccess::OModuleClient m_aModuleClient; const css::uno::Reference< css::uno::XComponentContext > m_xContext; const bool m_bFallbackToGeneric; diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx index 7f6c4a6eb5e8..7ad3241312f1 100644 --- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx +++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx @@ -20,10 +20,10 @@ #include "textconnectionsettings.hxx" #include "uiservices.hxx" #include "dbu_reghelper.hxx" -#include "moduledbu.hxx" +#include "core_resource.hxx" #include "apitools.hxx" #include "unoadmin.hxx" -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include "propertystorage.hxx" #include <com/sun/star/beans/XPropertySetInfo.hpp> @@ -63,7 +63,7 @@ namespace dbaui ,public OTextConnectionSettingsDialog_PBASE ,public ::cppu::WeakImplHelper< css::sdb::XTextConnectionSettings > { - OModuleClient m_aModuleClient; + dbaccess::OModuleClient m_aModuleClient; PropertyValues m_aPropertyValues; protected: diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx index 1858bf9de2ce..3c3360d82268 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.cxx +++ b/dbaccess/source/ui/uno/unoDirectSql.cxx @@ -27,7 +27,7 @@ #include <com/sun/star/connection/XConnection.hpp> #include <com/sun/star/container/XNamed.hpp> #include "directsql.hxx" -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include "datasourceconnector.hxx" #include <tools/diagnose_ex.h> #include <comphelper/processfactory.hxx> diff --git a/dbaccess/source/ui/uno/unoDirectSql.hxx b/dbaccess/source/ui/uno/unoDirectSql.hxx index 96e198e8a34a..5b1e9d126ff0 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.hxx +++ b/dbaccess/source/ui/uno/unoDirectSql.hxx @@ -25,7 +25,7 @@ #include <com/sun/star/sdb/XSQLQueryComposer.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> -#include "moduledbu.hxx" +#include "core_resource.hxx" #include <com/sun/star/sdbc/XConnection.hpp> namespace dbaui @@ -40,7 +40,7 @@ namespace dbaui :public ODirectSQLDialog_BASE ,public ODirectSQLDialog_PBASE { - OModuleClient m_aModuleClient; + dbaccess::OModuleClient m_aModuleClient; OUString m_sInitialSelection; css::uno::Reference< css::sdbc::XConnection > m_xActiveConnection; protected: diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index fde168b9fa21..59e2647324c6 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include <toolkit/awt/vclxwindow.hxx> #include "dbu_reghelper.hxx" #include "unoadmin.hxx" diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index 4494a2eedda3..7d7f003a5f57 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -21,7 +21,8 @@ #include "uiservices.hxx" #include "unosqlmessage.hxx" #include "dbu_reghelper.hxx" -#include "dbustrings.hrc" +#include "stringconstants.hxx" +#include "strings.hxx" #include <comphelper/processfactory.hxx> #include <cppuhelper/typeprovider.hxx> #include <connectivity/dbexception.hxx> |