summaryrefslogtreecommitdiff
path: root/svtools/source/contnr
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 /svtools/source/contnr
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 'svtools/source/contnr')
-rw-r--r--svtools/source/contnr/DocumentInfoPreview.cxx11
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svtools/source/contnr/fileview.src65
-rw-r--r--svtools/source/contnr/svcontnr.src49
-rw-r--r--svtools/source/contnr/svimpbox.cxx2
-rw-r--r--svtools/source/contnr/svtabbx.cxx2
-rw-r--r--svtools/source/contnr/templwin.cxx26
-rw-r--r--svtools/source/contnr/templwin.hrc37
-rw-r--r--svtools/source/contnr/templwin.hxx9
-rw-r--r--svtools/source/contnr/templwin.src44
10 files changed, 22 insertions, 225 deletions
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
index 7b44cb4f69d2..7a5df2ad4614 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -45,10 +45,9 @@
namespace svtools {
-ODocumentInfoPreview::ODocumentInfoPreview(vcl::Window * pParent, WinBits nBits):
- Window(pParent, WB_DIALOGCONTROL),
- m_pEditWin( VclPtr<ExtMultiLineEdit>::Create(this, nBits) ),
- m_xInfoTable(new SvtDocInfoTable_Impl)
+ODocumentInfoPreview::ODocumentInfoPreview(vcl::Window * pParent, WinBits nBits)
+ : Window(pParent, WB_DIALOGCONTROL)
+ , m_pEditWin( VclPtr<ExtMultiLineEdit>::Create(this, nBits) )
{
m_pEditWin->SetLeftMargin(10);
m_pEditWin->Show();
@@ -141,7 +140,7 @@ void ODocumentInfoPreview::insertEntry(
void ODocumentInfoPreview::insertNonempty(long id, OUString const & value)
{
if (!value.isEmpty()) {
- insertEntry(m_xInfoTable->GetString(id), value);
+ insertEntry(SvtDocInfoTable_Impl::GetString(id), value);
}
}
@@ -157,7 +156,7 @@ void ODocumentInfoPreview::insertDateTime(
OUStringBuffer buf(rLocaleWrapper.getDate(aToolsDT));
buf.append(", ");
buf.append(rLocaleWrapper.getTime(aToolsDT));
- insertEntry(m_xInfoTable->GetString(id), buf.makeStringAndClear());
+ insertEntry(SvtDocInfoTable_Impl::GetString(id), buf.makeStringAndClear());
}
}
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index a85e6d1d392d..c940a789b1ca 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -27,7 +27,7 @@
#include <svtools/imagemgr.hxx>
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
-#include <svtools/svtools.hrc>
+#include <svtools/strings.hrc>
#include "bitmaps.hlst"
#include <svtools/viewdataentry.hxx>
#include <toolkit/helper/vclunohelper.hxx>
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
deleted file mode 100644
index 73ab0a340842..000000000000
--- a/svtools/source/contnr/fileview.src
+++ /dev/null
@@ -1,65 +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 <svtools/svtools.hrc>
-#include <svtools/helpid.hrc>
-
-// strings --------------------------------------------------------------------
-
-String STR_SVT_FILEVIEW_COLUMN_TITLE
-{
- Text [ en-US ] = "Name";
-};
-
-String STR_SVT_FILEVIEW_COLUMN_SIZE
-{
- Text [ en-US ] = "Size";
-};
-
-String STR_SVT_FILEVIEW_COLUMN_DATE
-{
- Text [ en-US ] = "Date modified";
-};
-
-String STR_SVT_FILEVIEW_COLUMN_TYPE
-{
- Text [ en-US ] = "Type";
-};
-
-String STR_SVT_BYTES
-{
- Text [ en-US ] = "Bytes" ;
-};
-
-String STR_SVT_KB
-{
- Text [ en-US ] = "KB" ;
-};
-
-String STR_SVT_MB
-{
- Text [ en-US ] = "MB" ;
-};
-
-String STR_SVT_GB
-{
- Text [ en-US ] = "GB" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/svcontnr.src b/svtools/source/contnr/svcontnr.src
deleted file mode 100644
index d486cb6e3eb7..000000000000
--- a/svtools/source/contnr/svcontnr.src
+++ /dev/null
@@ -1,49 +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 <svtools/svtools.hrc>
-
-// descriptions of accessible objects
-
-String STR_SVT_ACC_DESC_TABLISTBOX
-{
- Text [ en-US ] = "Row: %1, Column: %2";
-};
-
-String STR_SVT_ACC_DESC_FILEVIEW
-{
- Text [ en-US ] = ", Type: %1, URL: %2";
-};
-
-String STR_SVT_ACC_DESC_FOLDER
-{
- Text [ en-US ] = "Folder";
-};
-
-String STR_SVT_ACC_DESC_FILE
-{
- Text [ en-US ] = "File";
-};
-
-String STR_SVT_ACC_EMPTY_FIELD
-{
- Text [ en-US ] = "Empty Field";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 7d8e130b1db1..b0e3132596ff 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -34,7 +34,7 @@
#include <rtl/instance.hxx>
#include <svtools/svtresid.hxx>
#include <tools/wintypes.hxx>
-#include <svtools/svtools.hrc>
+#include <svtools/strings.hrc>
#include "bitmaps.hlst"
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index 93fb4403e007..af846b52381c 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -22,7 +22,7 @@
#include <svtools/headbar.hxx>
#include <svtools/svtresid.hxx>
#include <svtools/svlbitm.hxx>
-#include <svtools/svtools.hrc>
+#include <svtools/strings.hrc>
#include <svtools/treelistentry.hxx>
#include <vcl/builderfactory.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx
index d88d0e134826..bd4433fd443b 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -17,25 +17,23 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <svtools/svtools.hrc>
+#include <svtools/strings.hrc>
#include <svtools/svtresid.hxx>
#include "templwin.hxx"
+#include "templwin.hrc"
-// class SvtDocInfoTable_Impl --------------------------------------------
-SvtDocInfoTable_Impl::SvtDocInfoTable_Impl()
- : ResStringArray(ResId(STRARY_SVT_DOCINFO, *SvtResMgr::GetResMgr()))
-
+namespace SvtDocInfoTable_Impl
{
-}
-
-OUString SvtDocInfoTable_Impl::GetString( long nId ) const
-{
- sal_uInt32 nPos( FindIndex( nId ) );
-
- if ( RESARRAY_INDEX_NOTFOUND != nPos )
- return ResStringArray::GetString( nPos );
+ OUString GetString(int nId)
+ {
+ for (size_t i = 0; i < SAL_N_ELEMENTS(STRARY_SVT_DOCINFO); ++i)
+ {
+ if (STRARY_SVT_DOCINFO[i].second == nId)
+ return SvtResId(STRARY_SVT_DOCINFO[i].first);
+ }
- return OUString();
+ return OUString();
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/templwin.hrc b/svtools/source/contnr/templwin.hrc
deleted file mode 100644
index 665a05779ca2..000000000000
--- a/svtools/source/contnr/templwin.hrc
+++ /dev/null
@@ -1,37 +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 .
- */
-#ifndef INCLUDED_SVTOOLS_SOURCE_CONTNR_TEMPLWIN_HRC
-#define INCLUDED_SVTOOLS_SOURCE_CONTNR_TEMPLWIN_HRC
-
-#define DI_TITLE 1
-#define DI_FROM 2
-#define DI_DATE 3
-#define DI_KEYWORDS 4
-#define DI_DESCRIPTION 5
-#define DI_MIMETYPE 6
-#define DI_MODIFIEDDATE 7
-#define DI_MODIFIEDBY 8
-#define DI_PRINTDATE 9
-#define DI_PRINTBY 10
-#define DI_THEME 11
-#define DI_SIZE 12
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx
index edbbb3beef83..066972b98d8f 100644
--- a/svtools/source/contnr/templwin.hxx
+++ b/svtools/source/contnr/templwin.hxx
@@ -19,14 +19,9 @@
#ifndef INCLUDED_SVTOOLS_SOURCE_CONTNR_TEMPLWIN_HXX
#define INCLUDED_SVTOOLS_SOURCE_CONTNR_TEMPLWIN_HXX
-#include <tools/resary.hxx>
-
-class SvtDocInfoTable_Impl : public ResStringArray
+namespace SvtDocInfoTable_Impl
{
-public:
- SvtDocInfoTable_Impl();
-
- OUString GetString( long nId ) const;
+ OUString GetString(int nId);
};
#endif // INCLUDED_SVTOOLS_SOURCE_CONTNR_TEMPLWIN_HXX
diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src
deleted file mode 100644
index 24e8ae991ece..000000000000
--- a/svtools/source/contnr/templwin.src
+++ /dev/null
@@ -1,44 +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 "templwin.hrc"
-#include <svtools/controldims.hrc>
-#include <svtools/helpid.hrc>
-#include <svtools/svtools.hrc>
-
-StringArray STRARY_SVT_DOCINFO
-{
- ItemList [ en-US ] =
- {
- < "Title" ; DI_TITLE ; > ;
- < "By" ; DI_FROM ; > ;
- < "Date" ; DI_DATE ; > ;
- < "Keywords" ; DI_KEYWORDS ; > ;
- < "Description" ; DI_DESCRIPTION ; > ;
- < "Type" ; DI_MIMETYPE ; > ;
- < "Modified on" ; DI_MODIFIEDDATE ; > ;
- < "Modified by" ; DI_MODIFIEDBY ; > ;
- < "Printed on" ; DI_PRINTDATE ; > ;
- < "Printed by" ; DI_PRINTBY ; > ;
- < "Subject" ; DI_THEME ; > ;
- < "Size" ; DI_SIZE ; > ;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */