Kaydet (Commit) 101a79cc authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Michael Meeks

lokdialog: Allow switching language of some of the ResMgr's.

This way, it is possible to have all the strings translated in dialogs even
when different users use different languages.  [It was already possible
to have different languages previously, but not everything in the dialog has
switched - like the buttons at the bottom of the dialogs etc.]

Change-Id: I29a5ae6d31a370eec60397884200b684ec1bf5b9
Reviewed-on: https://gerrit.libreoffice.org/46417Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/46979Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst a5fe3117
......@@ -22,8 +22,7 @@
OUString AccResId(const char* pId)
{
static std::locale loc = Translate::Create("acc");
return Translate::get(pId, loc);
return Translate::get(pId, Translate::Create("acc"));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -64,7 +64,6 @@ $(eval $(call gb_Library_add_exception_objects,avmedia,\
avmedia/source/framework/mediacontrol \
avmedia/source/framework/MediaControlBase \
avmedia/source/framework/mediaitem \
avmedia/source/framework/mediamisc \
avmedia/source/framework/mediaplayer \
avmedia/source/framework/mediatoolbox \
avmedia/source/framework/soundhandler \
......
/* -*- 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 <unotools/resmgr.hxx>
#include <mediamisc.hxx>
namespace avmedia {
const std::locale& GetResLocale()
{
static std::locale loc = Translate::Create("avmedia");
return loc;
}
} // namespace avmedia
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -41,14 +41,9 @@
// Mime types
#define AVMEDIA_MIMETYPE_COMMON "application/vnd.sun.star.media"
namespace avmedia
{
const std::locale& GetResLocale();
}
inline OUString AvmResId(const char* pId)
{
return Translate::get(pId, ::avmedia::GetResLocale());
return Translate::get(pId, Translate::Create("avmedia"));
}
#endif
......
......@@ -586,10 +586,9 @@ bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* pLen )
}
}
const std::locale& BasResLocale()
std::locale BasResLocale()
{
static std::locale loc(Translate::Create("sb"));
return loc;
return Translate::Create("sb");
}
OUString BasResId(const char *pId)
......
......@@ -234,7 +234,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/tools/RelativePositionHelper \
chart2/source/tools/RelativeSizeHelper \
chart2/source/tools/ResId \
chart2/source/tools/ResourceManager \
chart2/source/tools/Scaling \
chart2/source/tools/SceneProperties \
chart2/source/tools/StatisticsHelper \
......
/* -*- 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_CHART2_SOURCE_INC_RESOURCEMANAGER_HXX
#define INCLUDED_CHART2_SOURCE_INC_RESOURCEMANAGER_HXX
#include "charttoolsdllapi.hxx"
#include <locale>
namespace chart
{
namespace ResourceManager
{
const std::locale& getResourceLocale();
}
} // namespace chart
// INCLUDED_CHART2_SOURCE_INC_RESOURCEMANAGER_HXX
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -18,14 +18,13 @@
*/
#include <ResId.hxx>
#include <ResourceManager.hxx>
#include <unotools/resmgr.hxx>
namespace chart
{
OUString SchResId(const char *pId)
{
return Translate::get(pId, ResourceManager::getResourceLocale());
return Translate::get(pId, Translate::Create("chart"));
}
} // namespace chart
......
/* -*- 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 <ResourceManager.hxx>
#include <unotools/resmgr.hxx>
namespace chart
{
const std::locale& ResourceManager::getResourceLocale()
{
static std::locale loc = Translate::Create("chart");
return loc;
}
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -22,8 +22,7 @@
OUString CuiResId(const char *pKey)
{
static std::locale loc(Translate::Create("cui"));
return Translate::get(pKey, loc);
return Translate::get(pKey, Translate::Create("cui"));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -36,8 +36,7 @@ namespace dbaccess
OUString ResourceManager::loadString(const char* pResId)
{
static std::locale loc = Translate::Create("dba");
return Translate::get(pResId, loc);
return Translate::get(pResId, Translate::Create("dba"));
}
OUString ResourceManager::loadString(const char* pResId, const sal_Char* _pPlaceholderAscii, const OUString& _rReplace)
......
......@@ -195,7 +195,7 @@ uno::Reference< linguistic2::XLanguageGuessing > const & GlobalEditData::GetLang
OUString EditResId(const char *pId)
{
return Translate::get(pId, EditDLL::GetResLocale());
return Translate::get(pId, Translate::Create("editeng"));
}
EditDLL::EditDLL()
......@@ -207,12 +207,6 @@ EditDLL::~EditDLL()
{
}
std::locale& EditDLL::GetResLocale()
{
static std::locale loc = Translate::Create("editeng");
return loc;
}
editeng::SharedVclResources::SharedVclResources()
: m_pVirDev(VclPtr<VirtualDevice>::Create())
{
......
......@@ -37,8 +37,7 @@ namespace compmodule
OUString ModuleRes(const char* pId)
{
static std::locale loc = Translate::Create("pcr");
return Translate::get(pId, loc);
return Translate::get(pId, Translate::Create("pcr"));
}
//- registration helper
......
......@@ -55,8 +55,7 @@ namespace pcr
OUString PcrRes(const char* pId)
{
static std::locale loc = Translate::Create("pcr");
return Translate::get(pId, loc);
return Translate::get(pId, Translate::Create("pcr"));
}
} // namespace pcr
......
......@@ -321,8 +321,7 @@ namespace {
OUString SaneResId(const char *pID)
{
static std::locale loc = Translate::Create("pcr");
return Translate::get(pID, loc);
return Translate::get(pID, Translate::Create("pcr"));
}
}
......
......@@ -42,21 +42,14 @@
#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
#include <com/sun/star/security/XCertificate.hpp>
static std::locale& getPDFFilterResLocale()
{
static std::locale loc = Translate::Create("flt");
return loc;
}
OUString PDFFilterResId(const char* pId)
{
return Translate::get(pId, getPDFFilterResLocale());
return Translate::get(pId, Translate::Create("flt"));
}
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
/** Tabbed PDF dialog implementation
Please note: the default used here are the same as per specification,
They should be the same in PDFFilter::implExport and in PDFExport::PDFExport
......
......@@ -60,8 +60,7 @@ using ::rtl::Uri;
OUString XsltResId(const char* pId)
{
static std::locale loc = Translate::Create("flt");
return Translate::get(pId, loc);
return Translate::get(pId, Translate::Create("flt"));
}
XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent,
......
......@@ -26,8 +26,7 @@ namespace frm
{
OUString loadString(const char* pResId)
{
static std::locale loc = Translate::Create("frm");
return Translate::get(pResId, loc);
return Translate::get(pResId, Translate::Create("frm"));
}
}
}
......
......@@ -21,8 +21,7 @@
OUString ForResId(const char *pId)
{
static std::locale loc = Translate::Create("for");
return Translate::get(pId, loc);
return Transl