[Libreoffice-commits] core.git: extensions/AllLangResTarget_scn.mk extensions/Module_extensions.mk extensions/source scp2/source

Caolán McNamara caolanm at redhat.com
Mon Aug 18 03:14:25 PDT 2014


 extensions/AllLangResTarget_scn.mk       |   31 ++++++++++++++++++++++++++++
 extensions/Module_extensions.mk          |    1 
 extensions/source/scanner/sanedlg.cxx    |   19 +++++++++++++----
 extensions/source/scanner/strings.hrc    |   17 +++++++++++++++
 extensions/source/scanner/strings.src    |   34 +++++++++++++++++++++++++++++++
 scp2/source/ooo/file_resource_ooo.scp    |    6 +++++
 scp2/source/ooo/module_lang_template.scp |    1 
 7 files changed, 105 insertions(+), 4 deletions(-)

New commits:
commit 1bb161ece5bd3a868778b7a8d4528bedaa589710
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 18 11:10:25 2014 +0100

    these strings should be translatable
    
    so bring back scn.res and add them in there
    
    Change-Id: I378d64f524c64295d26223f54fe17950b475cd80

diff --git a/extensions/AllLangResTarget_scn.mk b/extensions/AllLangResTarget_scn.mk
new file mode 100644
index 0000000..be69430
--- /dev/null
+++ b/extensions/AllLangResTarget_scn.mk
@@ -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:
diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk
index f62ba8d..de1fa1b 100644
--- a/extensions/Module_extensions.mk
+++ b/extensions/Module_extensions.mk
@@ -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 \
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 9a8c3b5..c47e1a6 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -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
diff --git a/extensions/source/scanner/strings.hrc b/extensions/source/scanner/strings.hrc
new file mode 100644
index 0000000..209acdc
--- /dev/null
+++ b/extensions/source/scanner/strings.hrc
@@ -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: */
+
+
diff --git a/extensions/source/scanner/strings.src b/extensions/source/scanner/strings.src
new file mode 100644
index 0000000..e7c4608
--- /dev/null
+++ b/extensions/source/scanner/strings.src
@@ -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: */
+
+
diff --git a/scp2/source/ooo/file_resource_ooo.scp b/scp2/source/ooo/file_resource_ooo.scp
index e544426..a8dd5eb 100644
--- a/scp2/source/ooo/file_resource_ooo.scp
+++ b/scp2/source/ooo/file_resource_ooo.scp
@@ -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 )
diff --git a/scp2/source/ooo/module_lang_template.scp b/scp2/source/ooo/module_lang_template.scp
index 6b2538b..e5b8752 100644
--- a/scp2/source/ooo/module_lang_template.scp
+++ b/scp2/source/ooo/module_lang_template.scp
@@ -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,


More information about the Libreoffice-commits mailing list