these strings should be translatable
so bring back scn.res and add them in there Change-Id: I378d64f524c64295d26223f54fe17950b475cd80
This commit is contained in:
31
extensions/AllLangResTarget_scn.mk
Normal file
31
extensions/AllLangResTarget_scn.mk
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#
|
||||
#
|
||||
# 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/.
|
||||
#
|
||||
#
|
||||
|
||||
$(eval $(call gb_AllLangResTarget_AllLangResTarget,scn))
|
||||
|
||||
$(eval $(call gb_AllLangResTarget_set_reslocation,scn,extensions/source/scanner))
|
||||
|
||||
$(eval $(call gb_AllLangResTarget_add_srs,scn,\
|
||||
scn/res \
|
||||
))
|
||||
|
||||
$(eval $(call gb_SrsTarget_SrsTarget,scn/res))
|
||||
|
||||
$(eval $(call gb_SrsTarget_set_include,scn/res,\
|
||||
$$(INCLUDE) \
|
||||
-I$(SRCDIR)/extensions/source/scanner \
|
||||
))
|
||||
|
||||
$(eval $(call gb_SrsTarget_add_files,scn/res,\
|
||||
extensions/source/scanner/strings.src \
|
||||
))
|
||||
|
||||
# vim:set noet sw=4 ts=4:
|
@@ -19,6 +19,7 @@ $(eval $(call gb_Module_add_targets,extensions,\
|
||||
|
||||
$(eval $(call gb_Module_add_l10n_targets,extensions,\
|
||||
AllLangResTarget_abp \
|
||||
AllLangResTarget_scn \
|
||||
AllLangResTarget_upd \
|
||||
UIConfig_sabpilot \
|
||||
UIConfig_scanner \
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <sal/macros.h>
|
||||
#include <rtl/strbuf.hxx>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include "strings.hrc"
|
||||
|
||||
#define PREVIEW_WIDTH 113
|
||||
#define PREVIEW_HEIGHT 160
|
||||
@@ -241,11 +242,21 @@ SaneDlg::~SaneDlg()
|
||||
mrSane.SetReloadOptionsHdl( maOldLink );
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
ResId SaneResId( sal_uInt32 nID )
|
||||
{
|
||||
static ResMgr* pResMgr = ResMgr::CreateResMgr( "scn" );
|
||||
return ResId( nID, *pResMgr );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
short SaneDlg::Execute()
|
||||
{
|
||||
if( ! Sane::IsSane() )
|
||||
{
|
||||
MessageDialog aErrorBox(NULL, "The SANE interface could not be initialized. Scanning is not possible.");
|
||||
MessageDialog aErrorBox(NULL, SaneResId(STR_COULD_NOT_BE_INIT));
|
||||
aErrorBox.Execute();
|
||||
return sal_False;
|
||||
}
|
||||
@@ -523,7 +534,7 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
|
||||
{
|
||||
if( pButton == mpDeviceInfoButton )
|
||||
{
|
||||
OUString aString("Device: %s\nVendor: %s\nModel: %s\nType: %s");
|
||||
OUString aString(SaneResId(STR_DEVICE_DESC));
|
||||
aString = aString.replaceFirst( "%s", Sane::GetName( mrSane.GetDeviceNumber() ) );
|
||||
aString = aString.replaceFirst( "%s", Sane::GetVendor( mrSane.GetDeviceNumber() ) );
|
||||
aString = aString.replaceFirst( "%s", Sane::GetModel( mrSane.GetDeviceNumber() ) );
|
||||
@@ -808,7 +819,7 @@ void SaneDlg::AcquirePreview()
|
||||
int nOption = mrSane.GetOptionByName( "preview" );
|
||||
if( nOption == -1 )
|
||||
{
|
||||
OUString aString("The device does not offer a preview option. Therefore, a normal scan will be used as a preview instead. This may take a considerable amount of time." );
|
||||
OUString aString(SaneResId(STR_SLOW_PREVIEW));
|
||||
MessageDialog aBox(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
|
||||
if (aBox.Execute() == RET_CANCEL)
|
||||
return;
|
||||
@@ -819,7 +830,7 @@ void SaneDlg::AcquirePreview()
|
||||
BitmapTransporter aTransporter;
|
||||
if( ! mrSane.Start( aTransporter ) )
|
||||
{
|
||||
MessageDialog aErrorBox(this, "An error occurred while scanning.");
|
||||
MessageDialog aErrorBox(this, SaneResId(STR_ERROR_SCAN));
|
||||
aErrorBox.Execute();
|
||||
}
|
||||
else
|
||||
|
17
extensions/source/scanner/strings.hrc
Normal file
17
extensions/source/scanner/strings.hrc
Normal file
@@ -0,0 +1,17 @@
|
||||
/* -*- 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/.
|
||||
*/
|
||||
|
||||
#define STR_COULD_NOT_BE_INIT 1000
|
||||
#define STR_SLOW_PREVIEW 1001
|
||||
#define STR_ERROR_SCAN 1002
|
||||
#define STR_DEVICE_DESC 1003
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
|
34
extensions/source/scanner/strings.src
Normal file
34
extensions/source/scanner/strings.src
Normal file
@@ -0,0 +1,34 @@
|
||||
/* -*- 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/.
|
||||
*/
|
||||
|
||||
#include "strings.hrc"
|
||||
|
||||
String STR_COULD_NOT_BE_INIT
|
||||
{
|
||||
Text = "The SANE interface could not be initialized. Scanning is not possible.";
|
||||
};
|
||||
|
||||
String STR_SLOW_PREVIEW
|
||||
{
|
||||
Text = "The device does not offer a preview option. Therefore, a normal scan will be used as a preview instead. This may take a considerable amount of time.";
|
||||
};
|
||||
|
||||
String STR_ERROR_SCAN
|
||||
{
|
||||
Text = "An error occurred while scanning.";
|
||||
};
|
||||
|
||||
String STR_DEVICE_DESC
|
||||
{
|
||||
Text = "Device: %s\nVendor: %s\nModel: %s\nType: %s";
|
||||
};
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
|
@@ -59,6 +59,12 @@ STD_RES_FILE( gid_File_Res_Pcr, pcr)
|
||||
|
||||
STD_RES_FILE( gid_File_Res_Pdffilter, pdffilter)
|
||||
|
||||
#ifdef UNX
|
||||
|
||||
STD_RES_FILE( gid_File_Res_San, scn )
|
||||
|
||||
#endif
|
||||
|
||||
STD_RES_FILE( gid_File_Res_Sd, sd )
|
||||
|
||||
STD_RES_FILE( gid_File_Res_Sfx, sfx )
|
||||
|
@@ -87,6 +87,7 @@ Module gid_Module_Langpack_Resource_Template
|
||||
gid_File_Res_Ofa,
|
||||
gid_File_Res_Pcr,
|
||||
gid_File_Res_Pdffilter,
|
||||
gid_File_Res_San,
|
||||
gid_File_Res_Sb,
|
||||
gid_File_Res_Sd,
|
||||
gid_File_Res_Sfx,
|
||||
|
Reference in New Issue
Block a user