[Libreoffice-commits] core.git: 2 commits - scp2/source writerperfect/AllLangResTarget_writerperfect.mk writerperfect/inc writerperfect/Library_writerperfect.mk writerperfect/Module_writerperfect.mk writerperfect/source

David Tardon dtardon at redhat.com
Mon Feb 15 15:18:01 UTC 2016


 scp2/source/ooo/file_resource_ooo.scp                 |    4 -
 scp2/source/ooo/module_lang_template.scp              |    1 
 writerperfect/AllLangResTarget_writerperfect.mk       |   29 +++++++++++
 writerperfect/Library_writerperfect.mk                |    1 
 writerperfect/Module_writerperfect.mk                 |    1 
 writerperfect/inc/WPFTResMgr.hxx                      |   20 +++++++
 writerperfect/inc/strings.hrc                         |   25 +++++++++
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |   10 ++-
 writerperfect/source/common/WPFTResMgr.cxx            |   15 +++++
 writerperfect/source/common/strings.src               |   47 ++++++++++++++++++
 writerperfect/source/writer/MSWorksImportFilter.cxx   |   10 ++-
 11 files changed, 153 insertions(+), 10 deletions(-)

New commits:
commit dcab8b0c52ffe5879e20af3ee9bee2f4f9ed02fe
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Feb 15 15:53:26 2016 +0100

    drop unused line
    
    Change-Id: Ifc3501e5f4c1f2b20e32ff41759ff836c3236b86

diff --git a/scp2/source/ooo/file_resource_ooo.scp b/scp2/source/ooo/file_resource_ooo.scp
index 2b5bee1..4c81a7a 100644
--- a/scp2/source/ooo/file_resource_ooo.scp
+++ b/scp2/source/ooo/file_resource_ooo.scp
@@ -95,8 +95,6 @@ STD_RES_FILE( gid_File_Res_Writerperfect, writerperfect )
 
 STD_RES_FILE( gid_File_Res_Wzi, wzi )
 
-//STD_RES_FILE( gid_File_Res_Wwz, wwz )
-
 STD_RES_FILE( gid_File_Res_Xsltdlg, xsltdlg )
 
 STD_RES_FILE( gid_File_Res_AVMedia, avmedia )
commit 7a9c351734425a2dec631982218b5090114e735a
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Feb 15 15:18:48 2016 +0100

    make charset sel. dlg translatable
    
    Change-Id: I8d44b302bc78d9c89717f7169a04e9c736047b94

diff --git a/scp2/source/ooo/file_resource_ooo.scp b/scp2/source/ooo/file_resource_ooo.scp
index a8dd5eb..2b5bee1 100644
--- a/scp2/source/ooo/file_resource_ooo.scp
+++ b/scp2/source/ooo/file_resource_ooo.scp
@@ -91,6 +91,8 @@ STD_RES_FILE( gid_File_Res_Uui, uui )
 
 STD_RES_FILE( gid_File_Res_Vcl, vcl )
 
+STD_RES_FILE( gid_File_Res_Writerperfect, writerperfect )
+
 STD_RES_FILE( gid_File_Res_Wzi, wzi )
 
 //STD_RES_FILE( gid_File_Res_Wwz, wwz )
diff --git a/scp2/source/ooo/module_lang_template.scp b/scp2/source/ooo/module_lang_template.scp
index ce8ee9d..e91a933 100644
--- a/scp2/source/ooo/module_lang_template.scp
+++ b/scp2/source/ooo/module_lang_template.scp
@@ -104,6 +104,7 @@ Module gid_Module_Langpack_Resource_Template
              gid_File_Res_Tubes,
              gid_File_Res_Uui,
              gid_File_Res_Vcl,
+             gid_File_Res_Writerperfect,
              gid_File_Res_Wzi,
              gid_File_Res_Xsltdlg,
              gid_File_Res_AVMedia,
diff --git a/writerperfect/AllLangResTarget_writerperfect.mk b/writerperfect/AllLangResTarget_writerperfect.mk
new file mode 100644
index 0000000..bca319c
--- /dev/null
+++ b/writerperfect/AllLangResTarget_writerperfect.mk
@@ -0,0 +1,29 @@
+# -*- 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,writerperfect))
+
+$(eval $(call gb_AllLangResTarget_set_reslocation,writerperfect,writerperfect))
+
+$(eval $(call gb_AllLangResTarget_add_srs,writerperfect,\
+	writerperfect/res \
+))
+
+$(eval $(call gb_SrsTarget_SrsTarget,writerperfect/res))
+
+$(eval $(call gb_SrsTarget_set_include,writerperfect/res,\
+    $$(INCLUDE) \
+    -I$(SRCDIR)/writerperfect/inc \
+))
+
+$(eval $(call gb_SrsTarget_add_files,writerperfect/res,\
+    writerperfect/source/common/strings.src \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/Library_writerperfect.mk b/writerperfect/Library_writerperfect.mk
index 165a7a0..98cb1e2 100644
--- a/writerperfect/Library_writerperfect.mk
+++ b/writerperfect/Library_writerperfect.mk
@@ -55,6 +55,7 @@ $(eval $(call gb_Library_add_exception_objects,writerperfect,\
 	writerperfect/source/common/DirectoryStream \
 	writerperfect/source/common/DocumentHandler \
 	writerperfect/source/common/WPFTEncodingDialog \
+	writerperfect/source/common/WPFTResMgr \
 	writerperfect/source/common/WPXSvInputStream \
 ))
 
diff --git a/writerperfect/Module_writerperfect.mk b/writerperfect/Module_writerperfect.mk
index e787043..860a213 100644
--- a/writerperfect/Module_writerperfect.mk
+++ b/writerperfect/Module_writerperfect.mk
@@ -28,6 +28,7 @@ $(eval $(call gb_Module_add_targets,writerperfect,\
 ))
 
 $(eval $(call gb_Module_add_l10n_targets,writerperfect,\
+	AllLangResTarget_writerperfect \
 	UIConfig_writerperfect \
 ))
 
diff --git a/writerperfect/inc/WPFTResMgr.hxx b/writerperfect/inc/WPFTResMgr.hxx
new file mode 100644
index 0000000..d578685
--- /dev/null
+++ b/writerperfect/inc/WPFTResMgr.hxx
@@ -0,0 +1,20 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_WPFTRESMGR_HXX
+#define INCLUDED_WRITERPERFECT_INC_WPFTRESMGR_HXX
+
+#include "writerperfectdllapi.h"
+
+#include <tools/resid.hxx>
+
+struct WRITERPERFECT_DLLPUBLIC WPFTResMgr
+{
+    static ResMgr &GetResMgr();
+};
+
+#define WPFT_RES(i) ResId((i), WPFTResMgr::GetResMgr())
+#define WPFT_RESSTR(i) WPFT_RES(i).toString()
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/strings.hrc b/writerperfect/inc/strings.hrc
new file mode 100644
index 0000000..e18214f
--- /dev/null
+++ b/writerperfect/inc/strings.hrc
@@ -0,0 +1,25 @@
+/* -*- 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_WRITERPERFECT_INC_STRINGS_HRC
+#define INCLUDED_WRITERPERFECT_INC_STRINGS_HRC
+
+#define RES_START   1000
+
+#define STR_ENCODING_DIALOG_TITLE                (RES_START + 1)
+#define STR_ENCODING_DIALOG_TITLE_MSWORKS        (RES_START + 2)
+#define STR_ENCODING_DIALOG_TITLE_MSWRITE        (RES_START + 3)
+#define STR_ENCODING_DIALOG_TITLE_DOSWORD        (RES_START + 4)
+#define STR_ENCODING_DIALOG_TITLE_LOTUS          (RES_START + 5)
+#define STR_ENCODING_DIALOG_TITLE_SYMPHONY       (RES_START + 6)
+#define STR_ENCODING_DIALOG_TITLE_QUATTROPRO     (RES_START + 7)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 1d88c05..56d5eda 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -15,7 +15,9 @@
 #include <libwps/libwps.h>
 
 #include "WPFTEncodingDialog.hxx"
+#include "WPFTResMgr.hxx"
 #include "MSWorksCalcImportFilter.hxx"
+#include "strings.hrc"
 
 using com::sun::star::uno::Sequence;
 using com::sun::star::uno::Reference;
@@ -38,22 +40,22 @@ bool MSWorksCalcImportFilter::doImportDocument(librevenge::RVNGInputStream &rInp
         OUString title, encoding;
         if (creator == libwps::WPS_MSWORKS)
         {
-            title="Import MsWorks files(libwps)";
+            title=WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_MSWORKS);
             encoding="CP850";
         }
         else if (creator == libwps::WPS_LOTUS)
         {
-            title="Import Lotus files(libwps)";
+            title=WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_LOTUS);
             encoding="CP437";
         }
         else if (creator == libwps::WPS_SYMPHONY)
         {
-            title="Import Symphony files(libwps)";
+            title=WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_SYMPHONY);
             encoding="CP437";
         }
         else
         {
-            title="Import Quattro Pro files(libwps)";
+            title=WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_QUATTROPRO);
             encoding="CP437";
         }
         try
diff --git a/writerperfect/source/common/WPFTResMgr.cxx b/writerperfect/source/common/WPFTResMgr.cxx
new file mode 100644
index 0000000..fff256e
--- /dev/null
+++ b/writerperfect/source/common/WPFTResMgr.cxx
@@ -0,0 +1,15 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#include "WPFTResMgr.hxx"
+
+#include <tools/resmgr.hxx>
+
+#include <vcl/svapp.hxx>
+
+ResMgr &WPFTResMgr::GetResMgr()
+{
+    static ResMgr *const pResMgr(ResMgr::CreateResMgr("writerperfect", Application::GetSettings().GetUILanguageTag()));
+    return *pResMgr;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/common/strings.src b/writerperfect/source/common/strings.src
new file mode 100644
index 0000000..fb9b0ba
--- /dev/null
+++ b/writerperfect/source/common/strings.src
@@ -0,0 +1,47 @@
+/* -*- 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_ENCODING_DIALOG_TITLE
+{
+    Text[en-US] = "Import file";
+};
+
+String STR_ENCODING_DIALOG_TITLE_MSWORKS
+{
+    Text[en-US] = "Import MS Works file";
+};
+
+String STR_ENCODING_DIALOG_TITLE_MSWRITE
+{
+    Text[en-US] = "Import MS Write file";
+};
+
+String STR_ENCODING_DIALOG_TITLE_DOSWORD
+{
+    Text[en-US] = "Import MS Word for DOS file";
+};
+
+String STR_ENCODING_DIALOG_TITLE_LOTUS
+{
+    Text[en-US] = "Import Lotus file";
+};
+
+String STR_ENCODING_DIALOG_TITLE_SYMPHONY
+{
+    Text[en-US] = "Import Symphony file";
+};
+
+String STR_ENCODING_DIALOG_TITLE_QUATTROPRO
+{
+    Text[en-US] = "Import Quattro Pro file";
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx
index f8a03c8..de8f0a6 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -15,7 +15,9 @@
 #include <libwps/libwps.h>
 
 #include "WPFTEncodingDialog.hxx"
+#include "WPFTResMgr.hxx"
 #include "MSWorksImportFilter.hxx"
+#include "strings.hrc"
 
 using com::sun::star::uno::Sequence;
 using com::sun::star::uno::Reference;
@@ -49,19 +51,19 @@ bool MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput,
             switch (creator)
             {
             case libwps::WPS_MSWORKS:
-                title = "Import MsWorks files(libwps)";
+                title = WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_MSWORKS);
                 encoding = "CP850";
                 break;
             case libwps::WPS_RESERVED_0: // MS Write
-                title = "Import MsWrite files(libwps)";
+                title = WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_MSWRITE);
                 encoding = "CP1251";
                 break;
             case libwps::WPS_RESERVED_1: // DosWord
-                title = "Import DosWord files(libwps)";
+                title = WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE_DOSWORD);
                 encoding = "CP850";
                 break;
             default:
-                title = "Import files(libwps)";
+                title = WPFT_RESSTR(STR_ENCODING_DIALOG_TITLE);
                 encoding = "CP850";
                 break;
             }


More information about the Libreoffice-commits mailing list