summaryrefslogtreecommitdiff
path: root/fpicker/source/office
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 /fpicker/source/office
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 'fpicker/source/office')
-rw-r--r--fpicker/source/office/OfficeFilePicker.hrc19
-rw-r--r--fpicker/source/office/OfficeFilePicker.src92
-rw-r--r--fpicker/source/office/PlacesListBox.cxx2
-rw-r--r--fpicker/source/office/RemoteFilesDialog.hxx6
-rw-r--r--fpicker/source/office/fpsofficeResMgr.hxx47
-rw-r--r--fpicker/source/office/iodlg.cxx24
-rw-r--r--fpicker/source/office/iodlg.hrc38
-rw-r--r--fpicker/source/office/iodlg.src101
-rw-r--r--fpicker/source/office/iodlgimp.cxx35
9 files changed, 19 insertions, 345 deletions
diff --git a/fpicker/source/office/OfficeFilePicker.hrc b/fpicker/source/office/OfficeFilePicker.hrc
deleted file mode 100644
index c61593f4193f..000000000000
--- a/fpicker/source/office/OfficeFilePicker.hrc
+++ /dev/null
@@ -1,19 +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/.
- */
-#ifndef INCLUDED_FPICKER_SOURCE_OFFICE_OFFICEFILEPICKER_HRC
-#define INCLUDED_FPICKER_SOURCE_OFFICE_OFFICEFILEPICKER_HRC
-
-#include <vcl/fpicker.hrc>
-
-#define STR_SVT_NEW_FOLDER (RID_FPICKER_START+19)
-#define RID_FILEOPEN_NOTEXISTENTFILE (RID_FPICKER_START+24)
-#define STR_SVT_NOREMOVABLEDEVICE (RID_FPICKER_START+25)
-
-#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/OfficeFilePicker.src b/fpicker/source/office/OfficeFilePicker.src
deleted file mode 100644
index 4f6fe4b764b9..000000000000
--- a/fpicker/source/office/OfficeFilePicker.src
+++ /dev/null
@@ -1,92 +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 "OfficeFilePicker.hrc"
-
-String STR_SVT_FILEPICKER_AUTO_EXTENSION
-{
- Text [ en-US ] = "~Automatic file name extension" ;
-};
-
-String STR_SVT_FILEPICKER_PASSWORD
-{
- Text [ en-US ] = "Save with pass~word" ;
-};
-
-String STR_SVT_FILEPICKER_FILTER_OPTIONS
-{
- Text [ en-US ] = "~Edit filter settings";
-};
-
-String STR_SVT_FILEPICKER_READONLY
-{
- Text [ en-US ] = "~Read-only" ;
-};
-
-String STR_SVT_FILEPICKER_INSERT_AS_LINK
-{
- Text [ en-US ] = "~Link" ;
-};
-
-String STR_SVT_FILEPICKER_SHOW_PREVIEW
-{
- Text [ en-US ] = "Pr~eview" ;
-};
-
-String STR_SVT_FILEPICKER_PLAY
-{
- Text [ en-US ] = "~Play" ;
-};
-
-String STR_SVT_FILEPICKER_VERSION
-{
- Text [ en-US ] = "~Version:";
-};
-
-String STR_SVT_FILEPICKER_TEMPLATES
-{
- Text [ en-US ] = "S~tyles:" ;
-};
-
-String STR_SVT_FILEPICKER_IMAGE_TEMPLATE
-{
- Text [ en-US ] = "Style:";
-};
-
-String STR_SVT_FILEPICKER_SELECTION
-{
- Text [ en-US ] = "~Selection" ;
-};
-
-String STR_SVT_FILEPICKER_FILTER_TITLE
-{
- Text [ en-US ] = "File ~type:" ;
-};
-
-String STR_SVT_FOLDERPICKER_DEFAULT_TITLE
-{
- Text [ en-US ] = "Select Path" ;
-};
-
-String STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION
-{
- Text [ en-US ] = "Please select a folder.";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index f42a0440154a..c0bbc68235eb 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <iodlg.hrc>
+#include <strings.hrc>
#include <PlacesListBox.hxx>
#include <svtools/PlaceEditDialog.hxx>
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index 36dbe624ccb1..1b92732e3239 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -20,12 +20,11 @@
#include <svtools/fileview.hxx>
#include <vcl/errinf.hxx>
-#include <tools/resid.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/button.hxx>
-#include <vcl/fpicker.hrc>
+#include <fpicker/fpicker.hrc>
#include <vcl/menubtn.hxx>
#include <vcl/dialog.hxx>
#include <vcl/vclptr.hxx>
@@ -42,9 +41,8 @@
#include "fpdialogbase.hxx"
#include "fpsofficeResMgr.hxx"
-#include "OfficeFilePicker.hrc"
#include "QueryFolderName.hxx"
-#include "iodlg.hrc"
+#include "strings.hrc"
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::task;
diff --git a/fpicker/source/office/fpsofficeResMgr.hxx b/fpicker/source/office/fpsofficeResMgr.hxx
deleted file mode 100644
index 0fcbe4cab629..000000000000
--- a/fpicker/source/office/fpsofficeResMgr.hxx
+++ /dev/null
@@ -1,47 +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/.
- */
-#ifndef INCLUDED_FPICKER_SOURCE_OFFICE_FPSOFFICERESMGR_HXX
-#define INCLUDED_FPICKER_SOURCE_OFFICE_FPSOFFICERESMGR_HXX
-
-#include <rtl/instance.hxx>
-#include <osl/getglobalmutex.hxx>
-#include <tools/resmgr.hxx>
-
-namespace fpicker
-{
- struct ResMgrHolder
- {
- ResMgr * operator ()()
- {
- return ResMgr::CreateResMgr ("fps_office");
- }
-
- static ResMgr * getOrCreate()
- {
- return rtl_Instance<
- ResMgr, ResMgrHolder,
- osl::MutexGuard, osl::GetGlobalMutex >::create (
- ResMgrHolder(), osl::GetGlobalMutex());
- }
- };
-
- struct SvtResId : public ResId
- {
- explicit SvtResId (sal_uInt16 nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {}
- };
-}
-
-inline OUString FpsResId(sal_uInt16 nId)
-{
- return fpicker::SvtResId(nId);
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index df21d5f00d7f..3415f2e2d06c 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -42,10 +42,10 @@
#include "svtools/treelistentry.hxx"
#include <toolkit/helper/vclunohelper.hxx>
+#include "fpicker/fpicker.hrc"
#include "svtools/helpid.hrc"
-#include <svtools/svtools.hrc>
-#include "OfficeFilePicker.hrc"
-#include "iodlg.hrc"
+#include <svtools/strings.hrc>
+#include "strings.hrc"
#include "bitmaps.hlst"
#include "asyncfilepicker.hxx"
#include "iodlgimp.hxx"
@@ -646,26 +646,26 @@ void SvtFileDialog::Init_Impl
AddControls_Impl( );
// adjust the labels to the mode
- sal_uInt16 nResId = STR_EXPLORERFILE_OPEN;
- sal_uInt16 nButtonResId = 0;
+ const char* pResId = STR_EXPLORERFILE_OPEN;
+ const char* pButtonResId = nullptr;
if ( nStyle & PickerFlags::SaveAs )
{
- nResId = STR_EXPLORERFILE_SAVE;
- nButtonResId = STR_EXPLORERFILE_BUTTONSAVE;
+ pResId = STR_EXPLORERFILE_SAVE;
+ pButtonResId = STR_EXPLORERFILE_BUTTONSAVE;
}
if ( nStyle & PickerFlags::PathDialog )
{
pImpl->_pFtFileName->SetText( FpsResId( STR_PATHNAME ) );
- nResId = STR_PATHSELECT;
- nButtonResId = STR_BUTTONSELECT;
+ pResId = STR_PATHSELECT;
+ pButtonResId = STR_BUTTONSELECT;
}
- SetText( FpsResId( nResId ) );
+ SetText( FpsResId( pResId ) );
- if ( nButtonResId )
- pImpl->_pBtnFileOpen->SetText( FpsResId( nButtonResId ) );
+ if ( pButtonResId )
+ pImpl->_pBtnFileOpen->SetText( FpsResId( pButtonResId ) );
if ( FILEDLG_TYPE_FILEDLG != pImpl->_eDlgType )
{
diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc
deleted file mode 100644
index 467114efb2f9..000000000000
--- a/fpicker/source/office/iodlg.hrc
+++ /dev/null
@@ -1,38 +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_FPICKER_SOURCE_OFFICE_IODLG_HRC
-#define INCLUDED_FPICKER_SOURCE_OFFICE_IODLG_HRC
-
-#include "svtools/helpid.hrc"
-#include <vcl/fpicker.hrc>
-
-#define STR_EXPLORERFILE_OPEN (RID_FPICKER_START+31)
-#define STR_EXPLORERFILE_SAVE (RID_FPICKER_START+32)
-#define STR_EXPLORERFILE_BUTTONSAVE (RID_FPICKER_START+33)
-#define STR_PATHNAME (RID_FPICKER_START+34)
-#define STR_PATHSELECT (RID_FPICKER_START+35)
-#define STR_BUTTONSELECT (RID_FPICKER_START+36)
-#define STR_PREVIEW (RID_FPICKER_START+38)
-#define STR_DEFAULT_DIRECTORY (RID_FPICKER_START+39)
-#define STR_PLACES_TITLE (RID_FPICKER_START+40)
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src
deleted file mode 100644
index 74408ad7aaac..000000000000
--- a/fpicker/source/office/iodlg.src
+++ /dev/null
@@ -1,101 +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/helpid.hrc"
-#include "svtools/svtools.hrc"
-#include "iodlg.hrc"
-#include "OfficeFilePicker.hrc"
-
-// strings *******************************************************************
-
-String STR_EXPLORERFILE_OPEN
-{
- Text [ en-US ] = "Open" ;
-};
-String STR_EXPLORERFILE_SAVE
-{
- Text [ en-US ] = "Save as" ;
-};
-String STR_EXPLORERFILE_BUTTONSAVE
-{
- Text [ en-US ] = "~Save" ;
-};
-String STR_PATHNAME
-{
- Text [ en-US ] = "~Path:" ;
-};
-String STR_PATHSELECT
-{
- Text [ en-US ] = "Select path" ;
-};
-String STR_BUTTONSELECT
-{
- Text [ en-US ] = "~Select";
-};
-String STR_PREVIEW
-{
- Text [ en-US ] = "File Preview";
-};
-String STR_DEFAULT_DIRECTORY
-{
- Text [ en-US ] = "My Documents" ;
-};
-String STR_PLACES_TITLE
-{
- Text [ en-US ] = "Places" ;
-};
-
-String RID_FILEOPEN_NOTEXISTENTFILE
-{
- Text [ en-US ] = "The file $name$ does not exist.\nMake sure you have entered the correct file name.";
-};
-
-String STR_FILTERNAME_ALL
-{
- Text [ en-US ] = "All files" ;
-};
-
-String STR_SVT_ALREADYEXISTOVERWRITE
-{
- Text [ en-US ] = "A file named \"$filename$\" already exists.\n\nDo you want to replace it?" ;
-};
-
-String STR_SVT_DELETESERVICE
-{
- Text [ en-US ] = "Are you sure you want to delete the service?\n\"$servicename$\"" ;
-};
-
-String STR_SVT_ROOTLABEL
-{
- Text [ en-US ] = "Root" ;
-};
-
-String STR_SVT_NEW_FOLDER
-{
- Text [ en-US ] = "Folder" ;
-};
-
-String STR_SVT_NOREMOVABLEDEVICE
-{
- Text [ en-US ] = "No removable storage device detected.\nMake sure it is plugged in properly and try again." ;
-};
-
-//******************************************************************** EOF
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index e45764e7782e..9ee48838fc54 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -20,6 +20,7 @@
#include "iodlgimp.hxx"
#include "svtools/headbar.hxx"
#include <tools/debug.hxx>
+#include <tools/resmgr.hxx>
#include <tools/urlobj.hxx>
#include <vcl/menu.hxx>
#include <vcl/msgbox.hxx>
@@ -31,45 +32,17 @@
#include "svtools/fileview.hxx"
#include "svtools/inettbc.hxx"
#include "iodlg.hxx"
-#include "iodlg.hrc"
+#include "strings.hrc"
#include "bitmaps.hlst"
#include "svtools/imagemgr.hxx"
#include <unotools/localfilehelper.hxx>
#include "unotools/useroptions.hxx"
-#include "rtl/instance.hxx"
-#include <osl/getglobalmutex.hxx>
#include <svl/svl.hrc>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::utl;
-
-// ResMgrHolder / SvtSimpleResId
-
-namespace
-{
- struct ResMgrHolder
- {
- ResMgr * operator ()()
- {
- return ResMgr::CreateResMgr ("svl");
- }
- static ResMgr * getOrCreate()
- {
- return rtl_Instance<
- ResMgr, ResMgrHolder,
- osl::MutexGuard, osl::GetGlobalMutex >::create (
- ResMgrHolder(), osl::GetGlobalMutex());
- }
- };
-
- struct SvtSimpleResId : public ResId
- {
- explicit SvtSimpleResId (sal_uInt16 nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {}
- };
-}
-
SvtFileDialogFilter_Impl::SvtFileDialogFilter_Impl( const OUString& rName, const OUString& rType )
:m_aName( rName )
,m_aType( rType )
@@ -171,13 +144,13 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu )
if ( nCount == 1 )
{
// adjust the title of the top level entry (the workspace)
- _pMenu->SetItemText( --nItemId, SvtSimpleResId(STR_SVT_MIMETYPE_CNT_FSYSBOX).toString() );
+ std::locale loc = Translate::Create("svl", Application::GetSettings().GetUILanguageTag());
+ _pMenu->SetItemText(--nItemId, Translate::get(STR_SVT_MIMETYPE_CNT_FSYSBOX, loc));
}
--nCount;
}
}
-
void SvtUpButton_Impl::Select()
{
sal_uInt16 nId = GetCurItemId();