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/relationdesign | |
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/relationdesign')
5 files changed, 23 insertions, 76 deletions
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index 1cdcc075e11d..18edc5813369 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx @@ -26,10 +26,12 @@ #include <com/sun/star/sdbcx/XAppend.hpp> #include <com/sun/star/sdbcx/XDrop.hpp> #include <com/sun/star/container/XIndexAccess.hpp> -#include "dbustrings.hrc" -#include "dbu_rel.hrc" +#include "stringconstants.hxx" +#include "strings.hrc" +#include "strings.hxx" #include "UITools.hxx" -#include "moduledbu.hxx" +#include "core_resource.hxx" +#include "core_resource.hxx" #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> @@ -373,7 +375,7 @@ xKey.clear(); if ( bDropRelation ) { DropRelation(); - OUString sError(ModuleRes(STR_QUERY_REL_COULD_NOT_CREATE)); + OUString sError(DBA_RES(STR_QUERY_REL_COULD_NOT_CREATE)); ::dbtools::throwGenericSQLException(sError,nullptr); } diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 0f171ef16410..5c9d57ff2cb9 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -25,11 +25,13 @@ #include "dbu_reghelper.hxx" #include "uiservices.hxx" #include <sfx2/sfxsids.hrc> -#include "dbu_rel.hrc" +#include "strings.hrc" +#include "strings.hxx" #include <vcl/svapp.hxx> #include "browserids.hxx" #include <comphelper/types.hxx> -#include "dbustrings.hrc" +#include "core_resource.hxx" +#include "stringconstants.hxx" #include <connectivity/dbtools.hxx> #include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> @@ -158,7 +160,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!"); if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), getORB())) { - OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED)); + OUString aMessage(DBA_RES(STR_DATASOURCE_DELETED)); ScopedVclPtrInstance<OSQLWarningBox>(getView(), aMessage)->Execute(); } else @@ -202,9 +204,9 @@ void ORelationController::impl_initialize() setEditable(false); m_bRelationsPossible = false; { - OUString sTitle(ModuleRes(STR_RELATIONDESIGN)); + OUString sTitle(DBA_RES(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - ScopedVclPtrInstance< OSQLMessageBox > aDlg(nullptr,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE)); + ScopedVclPtrInstance< OSQLMessageBox > aDlg(nullptr,sTitle,DBA_RES(STR_RELATIONDESIGN_NOT_AVAILABLE)); aDlg->Execute(); } disconnect(); diff --git a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx index 377687dae9e8..56759e745b81 100644 --- a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx @@ -24,7 +24,7 @@ #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> #include "browserids.hxx" -#include "dbu_rel.hrc" +#include "strings.hrc" #include <comphelper/types.hxx> #include <connectivity/dbtools.hxx> #include <com/sun/star/sdbc/DataType.hpp> @@ -33,7 +33,7 @@ #include "ConnectionLine.hxx" #include "ConnectionLineData.hxx" #include "RTableConnectionData.hxx" -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include <comphelper/extract.hxx> #include "UITools.hxx" diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index 9a898328d11c..988347f399cf 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -20,6 +20,7 @@ #include "RelationTableView.hxx" #include "JoinExchange.hxx" #include <comphelper/extract.hxx> +#include "core_resource.hxx" #include "browserids.hxx" #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbc/XConnection.hpp> @@ -29,7 +30,7 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include <connectivity/dbtools.hxx> #include <comphelper/sequence.hxx> #include "dbaccess_helpid.hrc" @@ -41,7 +42,7 @@ #include "RTableConnectionData.hxx" #include "RelationDlg.hxx" #include "sqlmessage.hxx" -#include "dbu_rel.hrc" +#include "strings.hrc" #include "UITools.hxx" #include <connectivity/dbexception.hxx> #include "RTableWindow.hxx" @@ -322,7 +323,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) { - ScopedVclPtrInstance< OSQLWarningBox > aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ); + ScopedVclPtrInstance< OSQLWarningBox > aDlg( this, DBA_RES( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ); if ( m_bInRemove || aDlg->Execute() == RET_YES ) { m_pView->getController().ClearUndoManager(); @@ -338,13 +339,13 @@ void ORelationTableView::lookForUiActivities() { if(m_pExistingConnection) { - OUString sTitle(ModuleRes(STR_RELATIONDESIGN)); + OUString sTitle(DBA_RES(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0); + ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,DBA_RES(STR_QUERY_REL_EDIT_RELATION),OUString(),0); aDlg->SetText(sTitle); aDlg->RemoveButton(aDlg->GetButtonId(0)); - aDlg->AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, ButtonDialogFlags::Default | ButtonDialogFlags::Focus); - aDlg->AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES); + aDlg->AddButton( DBA_RES(STR_QUERY_REL_EDIT), RET_OK, ButtonDialogFlags::Default | ButtonDialogFlags::Focus); + aDlg->AddButton( DBA_RES(STR_QUERY_REL_CREATE), RET_YES); aDlg->AddButton( StandardButtonType::Cancel,RET_CANCEL); sal_uInt16 nRet = aDlg->Execute(); if( nRet == RET_CANCEL) diff --git a/dbaccess/source/ui/relationdesign/relation.src b/dbaccess/source/ui/relationdesign/relation.src deleted file mode 100644 index d40689dc433c..000000000000 --- a/dbaccess/source/ui/relationdesign/relation.src +++ /dev/null @@ -1,58 +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_rel.hrc" -#include "browserids.hxx" -#include "dbaccess_helpid.hrc" - -String STR_QUERY_REL_EDIT_RELATION -{ - Text [ en-US ] = "This relation already exists. Do you want to edit it or create a new one?" ; -}; - -String STR_QUERY_REL_EDIT -{ - Text [ en-US ] = "Edit..." ; -}; - -String STR_QUERY_REL_CREATE -{ - Text [ en-US ] = "Create..." ; -}; - -String STR_RELATIONDESIGN -{ - Text [ en-US ] = " - %PRODUCTNAME Base: Relation design" ; -}; - -String STR_RELATIONDESIGN_NOT_AVAILABLE -{ - Text [ en-US ] = "The database does not support relations." ; -}; - -String STR_QUERY_REL_DELETE_WINDOW -{ - Text [ en-US ] = "When you delete this table all corresponding relations will be deleted as well. Continue?"; -}; - -String STR_QUERY_REL_COULD_NOT_CREATE -{ - Text [ en-US ] = "The database could not create the relation. Maybe foreign keys for this kind of table aren't supported.\nPlease check your documentation of the database."; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |