CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | Friends | List of all members
ctkPluginLocalization Class Reference

#include <Libs/PluginFramework/ctkPluginLocalization.h>

Public Member Functions

 ctkPluginLocalization ()
 
 ctkPluginLocalization (const ctkPluginLocalization &pl)
 
QLocale getLocale () const
 
QString getLocalized (const QString &context, const QString &str) const
 
ctkPluginLocalizationoperator= (const ctkPluginLocalization &other)
 
 ~ctkPluginLocalization ()
 

Friends

class ctkPlugin
 

Detailed Description

Translate text into different languages.

Use this class to dynamically translate human-readable text in your plugin. You can get an instance of this class corresponding to a specific locale via the method ctkPlugin::getPluginLocalization().

See also
ctkPlugin::getPluginLocalization()

Definition at line 47 of file ctkPluginLocalization.h.

Constructor & Destructor Documentation

◆ ctkPluginLocalization() [1/2]

ctkPluginLocalization::ctkPluginLocalization ( )

Creates a default ctkPluginLocalization instance, using the default locale.

Note that getLocalized() will always return a null QString for a default constructed ctkPluginLocalization object. Use ctkPlugin::getPluginLocalization() to create a valid instance.

◆ ctkPluginLocalization() [2/2]

ctkPluginLocalization::ctkPluginLocalization ( const ctkPluginLocalization pl)

◆ ~ctkPluginLocalization()

ctkPluginLocalization::~ctkPluginLocalization ( )

Member Function Documentation

◆ getLocale()

QLocale ctkPluginLocalization::getLocale ( ) const

Get the locale for which this ctkPluginLocalization object was constructed.

Returns
The locale for this object.

◆ getLocalized()

QString ctkPluginLocalization::getLocalized ( const QString &  context,
const QString &  str 
) const

Translate str to a specific locale, using the specified context.

Returns
The translation or a null QString, if no translation was found.

◆ operator=()

ctkPluginLocalization& ctkPluginLocalization::operator= ( const ctkPluginLocalization other)

Friends And Related Function Documentation

◆ ctkPlugin

friend class ctkPlugin
friend

Definition at line 86 of file ctkPluginLocalization.h.


The documentation for this class was generated from the following file: