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/querydesign/SelectionBrowseBox.cxx | |
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/querydesign/SelectionBrowseBox.cxx')
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 3d9f49ec3a7c..4c66586c9a8e 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -30,10 +30,11 @@ #include <comphelper/string.hxx> #include <comphelper/types.hxx> #include "TableFieldInfo.hxx" -#include "dbu_qry.hrc" +#include "strings.hrc" +#include "strings.hxx" #include "dbaccess_helpid.hrc" #include <com/sun/star/container/XNameAccess.hpp> -#include "dbustrings.hrc" +#include "stringconstants.hxx" #include "QTableWindow.hxx" #include <vcl/msgbox.hxx> #include <vcl/settings.hxx> @@ -98,7 +99,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) BrowserMode::HIDECURSOR | BrowserMode::HLINES | BrowserMode::VLINES ) ,m_nSeekRow(0) ,m_nMaxColumns(0) - ,m_aFunctionStrings(ModuleRes(STR_QUERY_FUNCTIONS)) + ,m_aFunctionStrings(DBA_RES(STR_QUERY_FUNCTIONS)) ,m_nVisibleCount(0) ,m_nLastSortColumn(SORT_COLUMN_NONE) ,m_bOrderByUnRelated(true) @@ -135,7 +136,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) aTitleFont.SetFontSize(Size(0, 6)); SetTitleFont(aTitleFont); - OUString aTxt(ModuleRes(STR_QUERY_SORTTEXT)); + OUString aTxt(DBA_RES(STR_QUERY_SORTTEXT)); sal_Int32 nCount = comphelper::string::getTokenCount(aTxt, ';'); for (sal_Int32 nIdx = 0; nIdx < nCount; nIdx++) m_pOrderCell->InsertEntry(aTxt.getToken(nIdx, ';')); @@ -498,11 +499,11 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon for(;aIter != aEnd;++aIter) m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second.get())->GetAliasName()); - m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0); + m_pTableCell->InsertEntry(DBA_RES(STR_QUERY_NOTABLE), 0); if (!pEntry->GetAlias().isEmpty()) m_pTableCell->SelectEntry(pEntry->GetAlias()); else - m_pTableCell->SelectEntry(OUString(ModuleRes(STR_QUERY_NOTABLE))); + m_pTableCell->SelectEntry(DBA_RES(STR_QUERY_NOTABLE)); } } break; case BROW_VIS_ROW: @@ -520,7 +521,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon m_pVisibleCell->GetBox().SaveValue(); m_pVisibleCell->GetBox().Disable(); m_pVisibleCell->GetBox().EnableInput(false); - OUString aMessage(ModuleRes(STR_QRY_ORDERBY_UNRELATED)); + OUString aMessage(DBA_RES(STR_QRY_ORDERBY_UNRELATED)); OQueryDesignView* paDView = getDesignView(); ScopedVclPtrInstance<InfoBox>(paDView, aMessage)->Execute(); } @@ -610,7 +611,7 @@ bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName, const OUSt sal_uInt16 nTabCount = 0; if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occurred: column not in table window { - OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST)); + OUString sErrorMsg(DBA_RES(RID_STR_FIELD_DOESNT_EXIST)); sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName); ScopedVclPtrInstance<OSQLErrorBox>(this, sErrorMsg)->Execute(); bError = true; @@ -714,7 +715,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _ if ( pParseNode == nullptr ) { // something different which we have to check - OUString sErrorMessage( ModuleRes( STR_QRY_COLUMN_NOT_FOUND ) ); + OUString sErrorMessage( DBA_RES( STR_QRY_COLUMN_NOT_FOUND ) ); sErrorMessage = sErrorMessage.replaceFirst("$name$",_sFieldName); ScopedVclPtrInstance<OSQLErrorBox>(this, sErrorMessage)->Execute(); @@ -870,7 +871,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _ if ( i > 0 && !InsertField(aSelEntry,BROWSER_INVALIDID,true,false).is() ) // may we have to append more than one field { // the field could not be inserted - OUString sErrorMessage( ModuleRes( RID_STR_FIELD_DOESNT_EXIST ) ); + OUString sErrorMessage( DBA_RES( RID_STR_FIELD_DOESNT_EXIST ) ); sErrorMessage = sErrorMessage.replaceFirst("$name$",aSelEntry->GetField()); ScopedVclPtrInstance<OSQLErrorBox>(this, sErrorMessage)->Execute(); bError = true; @@ -1231,7 +1232,7 @@ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const tools::Recta { tools::Rectangle aRect(rRect); aRect.TopLeft().Y() -= 2; - OUString aLabel(ModuleRes(STR_QUERY_HANDLETEXT)); + OUString aLabel(DBA_RES(STR_QUERY_HANDLETEXT)); // from BROW_CRIT2_ROW onwards all rows are shown "or" sal_Int32 nToken = (m_nSeekRow >= GetBrowseRow(BROW_CRIT2_ROW)) @@ -2127,7 +2128,7 @@ OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const } break; case BROW_ORDER_ROW: if (pEntry->GetOrderDir() != ORDER_NONE) - aText = OUString(ModuleRes(STR_QUERY_SORTTEXT)).getToken(sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir()), ';'); + aText = DBA_RES(STR_QUERY_SORTTEXT).getToken(sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir()), ';'); break; case BROW_VIS_ROW: break; @@ -2560,7 +2561,7 @@ void OSelectionBrowseBox::DeactivateCell(bool _bUpdate) OUString OSelectionBrowseBox::GetRowDescription( sal_Int32 _nRow ) const { - OUString aLabel(ModuleRes(STR_QUERY_HANDLETEXT)); + OUString aLabel(DBA_RES(STR_QUERY_HANDLETEXT)); // from BROW_CRIT2_ROW onwards all rows are shown as "or" sal_Int32 nToken = (_nRow >= GetBrowseRow(BROW_CRIT2_ROW)) |