Instance names for plugins

Nicolas Goutte nicolasg at snafu.de
Wed Feb 25 12:43:12 CET 2004


>List:       kde-kimageshop
>Subject:    Re: Instance names for plugins
> From:       Cyrille Berger <cyb () lepi ! org>
>Date:       2004-02-25 10:56:54
>Message-ID: <200402251156.54344.cyb () lepi ! org>
>
>> For using only one translation file in Krita, the plugins must be changed
>> too.
>I don't know how the translation system works in Krita, but plugins are
>conceived to be independant of Krita, so wouldn't it be better to have
>separate translation files ?

The code can still be independant and use the same translation file.

However most translation teams (also called I18N teams) do not like small 
translation files, as each file makes additional work.

Therefore currently we are putting all filter translations into a single 
translation file. So it is best to avoid that Krita continues creating many 
small files.

However as each Krita plugin has it own factory, it decides what translation 
file it loads. So for plugins that are not in Krita's source code (but for 
example in kdenonbeta or totally elsewhere) it is not a problem to have its 
own translation file totally independent of Krita.

But filters delivered with Krita should have the same translation file than 
Krita.

>
>> But I have a question: are the instance names used internally in Krita or
>> can I rename the plugins' instance names to "krita" without any problem?
>I don't know what you mean by instance names, if it is :

The instance name is the name given to the factory (in the following example 
"colorsfilters_plugin" ):

K_EXPORT_COMPONENT_FACTORY( colorsfilters, 
ColorsFiltersFactory( "colorsfilters_plugin" ) )

The instance name is used in kdelibs for a few things (config file, 
translation file...). So the easiest for changing the used translation file 
is to change the instance name (in the previous example to "krita".) However 
as it is not a neutral operation, there is also another solution possible (by 
using the member function setupTranslation)

So I was just asking if I could use the simpliest way of just renaming the 
instance name or if I had to use the alternative method of declaring the 
translation file separately.

So now, as far as I can tell, I just need to change the instance name. (If 
somebody would find later that it is leading to a problem, the alternative 
way could still be used.)

><kpartgui library="kritaexample" version="6">, you have to change the 
>Makefile.am.
>If it is the name of actions, you will have to change it in the plugin.
>
>--
>--- Cyrille Berger ---

Have a nice day!



More information about the kimageshop mailing list