[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    [PATCH] I18N for some filters using KGenericFactory
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2002-01-03 22:20:05
[Download RAW message or body]

The attached patch is for the directory filters.

The patch adds the loading of the I18N catalogue for some filters. Filters 
that have a factory not based on KGenericFactory are not touched by this 
patch. I have no idea if these other filters load correcty or not the I18N 
catalogue that they might need.

For most filters touched by this patch, I have chosen the simple way to 
rename the instance name to match the catalogue name.

The only exception is for the olefilter, where I have chosen to load the I18N 
catalogue explicitely. This can be also done for the other filters, if one of 
the maintainers prefers. (You can also look at KWord's ASCII filters.)

Have a nice day/evening/night!
["patch_i18n.txt" (text/x-diff)]

Index: kontour/applixgraphics/applixgraphicimport.cc
===================================================================
RCS file: /home/kde/koffice/filters/kontour/applixgraphics/applixgraphicimport.cc,v
retrieving revision 1.7
diff -u -r1.7 applixgraphicimport.cc
--- kontour/applixgraphics/applixgraphicimport.cc	2001/12/31 15:00:17	1.7
+++ kontour/applixgraphics/applixgraphicimport.cc	2002/01/03 22:07:08
@@ -35,7 +35,7 @@
 #include <math.h>
 
 typedef KGenericFactory<APPLIXGRAPHICImport, KoFilter> APPLIXGRAPHICImportFactory;
-K_EXPORT_COMPONENT_FACTORY( libapplixgraphicimport, APPLIXGRAPHICImportFactory( \
"applixgraphicimport" ) ); +K_EXPORT_COMPONENT_FACTORY( libapplixgraphicimport, \
APPLIXGRAPHICImportFactory( "kontourapplixgraphicsfilter" ) );  
 
 /******************************************************************************
Index: kpresenter/kword/kprkword.cc
===================================================================
RCS file: /home/kde/koffice/filters/kpresenter/kword/kprkword.cc,v
retrieving revision 1.15
diff -u -r1.15 kprkword.cc
--- kpresenter/kword/kprkword.cc	2001/12/31 14:16:11	1.15
+++ kpresenter/kword/kprkword.cc	2002/01/03 22:07:12
@@ -30,7 +30,7 @@
 #include <qcolor.h>
 
 typedef KGenericFactory<KprKword, KoFilter> KprKwordFactory;
-K_EXPORT_COMPONENT_FACTORY( libkprkword, KprKwordFactory( "kprkword" ) );
+K_EXPORT_COMPONENT_FACTORY( libkprkword, KprKwordFactory( "kpresenterkwordfilter" ) \
);  
 KprKword::KprKword(KoFilter *, const char *, const QStringList&) :
     KoFilter(),
Index: kword/applixword/applixwordimport.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/applixword/applixwordimport.cc,v
retrieving revision 1.10
diff -u -r1.10 applixwordimport.cc
--- kword/applixword/applixwordimport.cc	2001/12/31 11:16:23	1.10
+++ kword/applixword/applixwordimport.cc	2002/01/03 22:07:15
@@ -33,7 +33,7 @@
 #include <kgenericfactory.h>
 
 typedef KGenericFactory<APPLIXWORDImport, KoFilter> APPLIXWORDImportFactory;
-K_EXPORT_COMPONENT_FACTORY( libapplixwordimport, APPLIXWORDImportFactory( \
"applixwordimport" ) ); +K_EXPORT_COMPONENT_FACTORY( libapplixwordimport, \
APPLIXWORDImportFactory( "applixwordfilter" ) );  
 
 /******************************************************************************
Index: kword/latex/latexexport.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/latex/latexexport.cc,v
retrieving revision 1.9
diff -u -r1.9 latexexport.cc
--- kword/latex/latexexport.cc	2001/12/31 12:06:49	1.9
+++ kword/latex/latexexport.cc	2002/01/03 22:07:16
@@ -29,7 +29,7 @@
 
 
 typedef KGenericFactory<LATEXExport, KoFilter> LATEXExportFactory;
-K_EXPORT_COMPONENT_FACTORY( liblatexexport, LATEXExportFactory( "latexexport" ) );
+K_EXPORT_COMPONENT_FACTORY( liblatexexport, LATEXExportFactory( "kwordlatexfilter" ) \
);  
 
 LATEXExport::LATEXExport(KoFilter *, const char *, const QStringList&) :
Index: olefilters/olefilter.cc
===================================================================
RCS file: /home/kde/koffice/filters/olefilters/olefilter.cc,v
retrieving revision 1.46
diff -u -r1.46 olefilter.cc
--- olefilters/olefilter.cc	2002/01/02 16:21:20	1.46
+++ olefilters/olefilter.cc	2002/01/03 22:07:18
@@ -37,8 +37,19 @@
 #include <wordfilter.h>
 #include <qfile.h>
 
-typedef KGenericFactory<OLEFilter, KoFilter> OLEFilterFactory;
-K_EXPORT_COMPONENT_FACTORY( libolefilter, OLEFilterFactory( "olefilter" ) );
+class OLEFilterFactory : KGenericFactory<OLEFilter, KoFilter>
+{
+public:
+    OLEFilterFactory(void) : KGenericFactory<OLEFilter, KoFilter> ("olefilter")
+    {}
+protected:
+    virtual void setupTranslations( void )
+    {
+        KGlobal::locale()->insertCatalogue( "olefilterswinword97filter" );
+    }
+};
+
+K_EXPORT_COMPONENT_FACTORY( libolefilter, OLEFilterFactory() );
 
 OLEFilter::OLEFilter(KoFilter *, const char *, const QStringList&) :
                      KoFilter() {


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic