Skip to content

Commit

Permalink
Translations
Browse files Browse the repository at this point in the history
- fixed some untranslated string
- reorganized the locale directory
  • Loading branch information
Jmgr committed Nov 13, 2010
1 parent aa0844b commit f71ab22
Show file tree
Hide file tree
Showing 78 changed files with 1,972 additions and 1,457 deletions.
3 changes: 1 addition & 2 deletions actexecuter/actexecuter.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ UI_DIR = generated
MOC_DIR = generated
RCC_DIR = generated
OBJECTS_DIR = generated
TRANSLATIONS = ../locale/actexecuter_en.ts \
../locale/actexecuter_fr.ts
TRANSLATIONS = ../locale/actexecuter_fr_FR.ts
unix:!mac:CONFIG += link_pkgconfig
unix:!mac:PKGCONFIG += libnotify
8 changes: 4 additions & 4 deletions actexecuter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ int main(int argc, char **argv)
app.installTranslator(&actionToolsTranslator);

QTranslator executerTranslator;
actionToolsTranslator.load(QString("%1/locale/executer_%2").arg(QApplication::applicationDirPath()).arg(locale));
executerTranslator.load(QString("%1/locale/executer_%2").arg(QApplication::applicationDirPath()).arg(locale));
app.installTranslator(&executerTranslator);

QTranslator guiTranslator;
actionToolsTranslator.load(QString("%1/locale/gui_%2").arg(QApplication::applicationDirPath()).arg(locale));
app.installTranslator(&guiTranslator);
QTranslator actexecuterTranslator;
actexecuterTranslator.load(QString("%1/locale/actexecuter_%2").arg(QApplication::applicationDirPath()).arg(locale));
app.installTranslator(&actexecuterTranslator);

app.addLibraryPath(QApplication::applicationDirPath() + "/actions");
app.addLibraryPath(QApplication::applicationDirPath() + "/plugins");
Expand Down
4 changes: 3 additions & 1 deletion actions/actionpackdata/actionpackdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class ActionPackData : public QObject, public ActionTools::ActionPack
Q_INTERFACES(ActionTools::ActionPack)

public:
ActionPackData()
ActionPackData() {}

void createDefinitions()
{
addActionDefinition(new Actions::WriteTextFileDefinition(this));
addActionDefinition(new Actions::ReadTextFileDefinition(this));
Expand Down
3 changes: 1 addition & 2 deletions actions/actionpackdata/actionpackdata.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ LIBS += -L../.. -lrudeconfig
win32:LIBS += -ladvapi32 \
-lshell32

TRANSLATIONS = ../../locale/actionpackdata_en.ts \
../../locale/actionpackdata_fr.ts
TRANSLATIONS = ../../locale/actionpackdata_fr_FR.ts
2 changes: 2 additions & 0 deletions actions/actionpackdata/actions/readtextfiledefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ namespace Actions
explicit ReadTextFileDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("ReadTextFileInstance::modes", ReadTextFileInstance::modes);

ActionTools::FileParameterDefinition *file = new ActionTools::FileParameterDefinition("file", tr("File"), this);
file->setTooltip(tr("The file you want to read"));
addElement(file);
Expand Down
2 changes: 1 addition & 1 deletion actions/actionpackdata/actions/readtextfileinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Actions
{
ActionTools::StringListPair ReadTextFileInstance::modes = qMakePair(
QStringList() << "full" << "selection",
QStringList() << QObject::tr("Read the entire file") << QObject::tr("Read only a selection"));
QStringList() << QT_TRANSLATE_NOOP("ReadTextFileInstance::modes", "Read the entire file") << QT_TRANSLATE_NOOP("ReadTextFileInstance::modes", "Read only a selection"));

void ReadTextFileInstance::startExecution()
{
Expand Down
2 changes: 2 additions & 0 deletions actions/actionpackdata/actions/writetextfiledefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ namespace Actions
explicit WriteTextFileDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("WriteTextFileInstance::modes", WriteTextFileInstance::modes);

ActionTools::FileParameterDefinition *file = new ActionTools::FileParameterDefinition("file", tr("File"), this);
file->setTooltip(tr("The file you want to write"));
addElement(file);
Expand Down
2 changes: 1 addition & 1 deletion actions/actionpackdata/actions/writetextfileinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Actions
{
ActionTools::StringListPair WriteTextFileInstance::modes = qMakePair(
QStringList() << "truncate" << "append",
QStringList() << QObject::tr("Overwrite any content") << QObject::tr("Append to the end"));
QStringList() << QT_TRANSLATE_NOOP("WriteTextFileInstance::modes", "Overwrite any content") << QT_TRANSLATE_NOOP("WriteTextFileInstance::modes", "Append to the end"));

void WriteTextFileInstance::startExecution()
{
Expand Down
4 changes: 3 additions & 1 deletion actions/actionpackdevice/actionpackdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class ActionPackDevice : public QObject, public ActionTools::ActionPack
Q_INTERFACES(ActionTools::ActionPack)

public:
ActionPackDevice()
ActionPackDevice() {}

void createDefinitions()
{
addActionDefinition(new Actions::TextDefinition(this));
addActionDefinition(new Actions::ClickDefinition(this));
Expand Down
3 changes: 1 addition & 2 deletions actions/actionpackdevice/actionpackdevice.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ HEADERS += actionpackdevice.h \
RESOURCES += actionpackdevice.qrc
unix:LIBS += -lXtst
win32:LIBS += -luser32
TRANSLATIONS = ../../locale/actionpackdevice_en.ts \
../../locale/actionpackdevice_fr.ts
TRANSLATIONS = ../../locale/actionpackdevice_fr_FR.ts
SOURCES += mousedevice.cpp \
keyboarddevice.cpp
3 changes: 3 additions & 0 deletions actions/actionpackdevice/actions/clickdefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ namespace Actions
explicit ClickDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("ClickInstance::buttons", ClickInstance::buttons);
translateItems("ClickInstance::actions", ClickInstance::actions);

ActionTools::ListParameterDefinition *action = new ActionTools::ListParameterDefinition("action", tr("Action"), this);
action->setTooltip(tr("The action to simulate"));
action->setItems(ClickInstance::actions);
Expand Down
4 changes: 2 additions & 2 deletions actions/actionpackdevice/actions/clickinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ namespace Actions
{
ActionTools::StringListPair ClickInstance::buttons = qMakePair(
QStringList() << "left" << "middle" << "right",
QStringList() << QObject::tr("Left") << QObject::tr("Middle") << QObject::tr("Right"));
QStringList() << QT_TRANSLATE_NOOP("ClickInstance::buttons", "Left") << QT_TRANSLATE_NOOP("ClickInstance::buttons", "Middle") << QT_TRANSLATE_NOOP("ClickInstance::buttons", "Right"));
ActionTools::StringListPair ClickInstance::actions = qMakePair(
QStringList() << "pressRelease" << "press" << "release",
QStringList() << QObject::tr("Click (press and release)") << QObject::tr("Press") << QObject::tr("Release"));
QStringList() << QT_TRANSLATE_NOOP("ClickInstance::actions", "Click (press and release)") << QT_TRANSLATE_NOOP("ClickInstance::actions", "Press") << QT_TRANSLATE_NOOP("ClickInstance::actions", "Release"));

void ClickInstance::startExecution()
{
Expand Down
2 changes: 2 additions & 0 deletions actions/actionpackdevice/actions/keydefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace Actions
explicit KeyDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("KeyInstance::actions", KeyInstance::actions);

ActionTools::KeyParameterDefinition *key = new ActionTools::KeyParameterDefinition("key", tr("Key"), this);
key->setTooltip(tr("The key to simulate"));
addElement(key);
Expand Down
2 changes: 1 addition & 1 deletion actions/actionpackdevice/actions/keyinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Actions
{
ActionTools::StringListPair KeyInstance::actions = qMakePair(
QStringList() << "pressRelease" << "press" << "release",
QStringList() << QObject::tr("Press and release") << QObject::tr("Press") << QObject::tr("Release"));
QStringList() << QT_TRANSLATE_NOOP("KeyInstance::actions", "Press and release") << QT_TRANSLATE_NOOP("KeyInstance::actions", "Press") << QT_TRANSLATE_NOOP("KeyInstance::actions", "Release"));

void KeyInstance::startExecution()
{
Expand Down
4 changes: 3 additions & 1 deletion actions/actionpackinternal/actionpackinternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class ActionPackInternal : public QObject, public ActionTools::ActionPack
Q_INTERFACES(ActionTools::ActionPack)

public:
ActionPackInternal()
ActionPackInternal() {}

void createDefinitions()
{
addActionDefinition(new Actions::PauseDefinition(this));
addActionDefinition(new Actions::CodeDefinition(this));
Expand Down
3 changes: 1 addition & 2 deletions actions/actionpackinternal/actionpackinternal.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ TARGET = ActionPackInternal
QT += script
HEADERS += actionpackinternal.h
RESOURCES += actionpackinternal.qrc
TRANSLATIONS = ../../locale/actionpackinternal_en.ts \
../../locale/actionpackinternal_fr.ts
TRANSLATIONS = ../../locale/actionpackinternal_fr_FR.ts
INCLUDEPATH += ../../executer
LIBS += -L../.. -lexecuter
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace Actions
explicit VariableConditionDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("VariableConditionInstance::comparisons", VariableConditionInstance::comparisons);

ActionTools::VariableParameterDefinition *variable = new ActionTools::VariableParameterDefinition("variable", tr("Variable"), this);
variable->setCategory(ActionTools::ElementDefinition::INPUT);
variable->setTooltip(tr("The variable to compare"));
Expand Down
10 changes: 8 additions & 2 deletions actions/actionpackinternal/actions/variableconditioninstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ namespace Actions
{
ActionTools::StringListPair VariableConditionInstance::comparisons = qMakePair(
QStringList() << "equal" << "different" << "inferior" << "superior" << "inferiorEqual" << "superiorEqual" << "contains",
QStringList() << QObject::tr("Equal (=)") << QObject::tr("Different (!=)") << QObject::tr("Inferior (<)") << QObject::tr("Superior (>)")
<< QObject::tr("Inferior or equal (<=)") << QObject::tr("Superior or equal (>=)") << QObject::tr("Contains"));
QStringList()
<< QT_TRANSLATE_NOOP("VariableConditionInstance::comparisons", "Equal (=)")
<< QT_TRANSLATE_NOOP("VariableConditionInstance::comparisons", "Different (!=)")
<< QT_TRANSLATE_NOOP("VariableConditionInstance::comparisons", "Inferior (<)")
<< QT_TRANSLATE_NOOP("VariableConditionInstance::comparisons", "Superior (>)")
<< QT_TRANSLATE_NOOP("VariableConditionInstance::comparisons", "Inferior or equal (<=)")
<< QT_TRANSLATE_NOOP("VariableConditionInstance::comparisons", "Superior or equal (>=)")
<< QT_TRANSLATE_NOOP("VariableConditionInstance::comparisons", "Contains"));
}
4 changes: 3 additions & 1 deletion actions/actionpacksystem/actionpacksystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class ActionPackSystem : public QObject, public ActionTools::ActionPack
Q_INTERFACES(ActionTools::ActionPack)

public:
ActionPackSystem()
ActionPackSystem() {}

void createDefinitions()
{
addActionDefinition(new Actions::CommandDefinition(this));
addActionDefinition(new Actions::KillProcessDefinition(this));
Expand Down
3 changes: 1 addition & 2 deletions actions/actionpacksystem/actionpacksystem.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ RESOURCES += actionpacksystem.qrc
unix:!mac:CONFIG += link_pkgconfig
unix:!mac:PKGCONFIG += libnotify

TRANSLATIONS = ../../locale/actionpacksystem_en.ts \
../../locale/actionpacksystem_fr.ts
TRANSLATIONS = ../../locale/actionpacksystem_fr_FR.ts
2 changes: 2 additions & 0 deletions actions/actionpacksystem/actions/killprocessdefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ namespace Actions
explicit KillProcessDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("KillProcessInstance::killModes", KillProcessInstance::killModes);

ActionTools::TextParameterDefinition *processId = new ActionTools::TextParameterDefinition("processId", tr("Process id"), this);
processId->setTooltip(tr("The process id of the process to kill"));
addElement(processId);
Expand Down
5 changes: 4 additions & 1 deletion actions/actionpacksystem/actions/killprocessinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ namespace Actions
{
ActionTools::StringListPair KillProcessInstance::killModes = qMakePair(
QStringList() << "graceful" << "forceful" << "gracefulThenForceful",
QStringList() << QObject::tr("Graceful") << QObject::tr("Forceful") << QObject::tr("Graceful then forceful"));
QStringList()
<< QT_TRANSLATE_NOOP("KillProcessInstance::killModes", "Graceful")
<< QT_TRANSLATE_NOOP("KillProcessInstance::killModes", "Forceful")
<< QT_TRANSLATE_NOOP("KillProcessInstance::killModes", "Graceful then forceful"));
}
2 changes: 2 additions & 0 deletions actions/actionpacksystem/actions/pixelcolordefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ namespace Actions
explicit PixelColorDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("PixelColorInstance::comparisons", PixelColorInstance::comparisons);

ActionTools::ColorPositionParameterDefinition *pixel = new ActionTools::ColorPositionParameterDefinition("pixel", tr("Pixel"), this);
pixel->setTooltip(tr("The pixel position and color to check"));
addElement(pixel);
Expand Down
5 changes: 4 additions & 1 deletion actions/actionpacksystem/actions/pixelcolorinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ namespace Actions
{
ActionTools::StringListPair PixelColorInstance::comparisons = qMakePair(
QStringList() << "equal" << "darker" << "lighter",
QStringList() << QObject::tr("Equal") << QObject::tr("Darker") << QObject::tr("Lighter"));
QStringList()
<< QT_TRANSLATE_NOOP("PixelColorInstance::comparisons", "Equal")
<< QT_TRANSLATE_NOOP("PixelColorInstance::comparisons", "Darker")
<< QT_TRANSLATE_NOOP("PixelColorInstance::comparisons", "Lighter"));
}

3 changes: 3 additions & 0 deletions actions/actionpacksystem/actions/systemdefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ namespace Actions
explicit SystemDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("SystemInstance::operations", SystemInstance::operations);
translateItems("SystemInstance::modes", SystemInstance::modes);

ActionTools::ListParameterDefinition *operation = new ActionTools::ListParameterDefinition("operation", tr("Operation"), this);
operation->setTooltip(tr("The operation to execute"));
operation->setItems(SystemInstance::operations);
Expand Down
4 changes: 2 additions & 2 deletions actions/actionpacksystem/actions/systeminstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ namespace Actions
{
ActionTools::StringListPair SystemInstance::operations = qMakePair(
QStringList() << "logout" << "reboot" << "shutdown",
QStringList() << QObject::tr("Logout") << QObject::tr("Reboot") << QObject::tr("Shutdown"));
QStringList() << QT_TRANSLATE_NOOP("SystemInstance::operations", "Logout") << QT_TRANSLATE_NOOP("SystemInstance::operations", "Reboot") << QT_TRANSLATE_NOOP("SystemInstance::operations", "Shutdown"));

ActionTools::StringListPair SystemInstance::modes = qMakePair(
QStringList() << "ask" << "normal" << "force",
QStringList() << QObject::tr("Ask") << QObject::tr("Normal") << QObject::tr("Force"));
QStringList() << QT_TRANSLATE_NOOP("SystemInstance::modes", "Ask") << QT_TRANSLATE_NOOP("SystemInstance::modes", "Normal") << QT_TRANSLATE_NOOP("SystemInstance::modes", "Force"));
}

4 changes: 3 additions & 1 deletion actions/actionpackwindows/actionpackwindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class ActionPackWindows : public QObject, public ActionTools::ActionPack
Q_INTERFACES(ActionTools::ActionPack)

public:
ActionPackWindows()
ActionPackWindows() {}

void createDefinitions()
{
addActionDefinition(new Actions::MessageBoxDefinition(this));
addActionDefinition(new Actions::TextInputDefinition(this));
Expand Down
3 changes: 1 addition & 2 deletions actions/actionpackwindows/actionpackwindows.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ TARGET = ActionPackWindows
QT += script
HEADERS += actionpackwindows.h
RESOURCES += actionpackwindows.qrc
TRANSLATIONS = ../../locale/actionpackwindows_en.ts \
../../locale/actionpackwindows_fr.ts
TRANSLATIONS = ../../locale/actionpackwindows_fr_FR.ts
3 changes: 3 additions & 0 deletions actions/actionpackwindows/actions/messageboxdefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ namespace Actions
explicit MessageBoxDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("MessageBoxInstance::icons", MessageBoxInstance::icons);
translateItems("MessageBoxInstance::buttons", MessageBoxInstance::buttons);

ActionTools::TextParameterDefinition *text = new ActionTools::TextParameterDefinition("message", tr("Message"), this);
text->setTooltip(tr("The text to show"));
addElement(text);
Expand Down
11 changes: 9 additions & 2 deletions actions/actionpackwindows/actions/messageboxinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ namespace Actions
{
ActionTools::StringListPair MessageBoxInstance::icons = qMakePair(
QStringList() << "none" << "information" << "question" << "warning" << "error",
QStringList() << QObject::tr("None") << QObject::tr("Information") << QObject::tr("Question") << QObject::tr("Warning") << QObject::tr("Error"));
QStringList()
<< QT_TRANSLATE_NOOP("MessageBoxInstance::icons", "None")
<< QT_TRANSLATE_NOOP("MessageBoxInstance::icons", "Information")
<< QT_TRANSLATE_NOOP("MessageBoxInstance::icons", "Question")
<< QT_TRANSLATE_NOOP("MessageBoxInstance::icons", "Warning")
<< QT_TRANSLATE_NOOP("MessageBoxInstance::icons", "Error"));

ActionTools::StringListPair MessageBoxInstance::buttons = qMakePair(
QStringList() << "ok" << "yesno",
QStringList() << QObject::tr("Ok") << QObject::tr("Yes-No"));
QStringList()
<< QT_TRANSLATE_NOOP("MessageBoxInstance::buttons", "Ok")
<< QT_TRANSLATE_NOOP("MessageBoxInstance::buttons", "Yes-No"));

MessageBoxInstance::MessageBoxInstance(const ActionTools::ActionDefinition *definition, QObject *parent)
: ActionTools::ActionInstance(definition, parent),
Expand Down
2 changes: 2 additions & 0 deletions actions/actionpackwindows/actions/windowconditiondefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace Actions
explicit WindowConditionDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("WindowConditionInstance::conditions", WindowConditionInstance::conditions);

ActionTools::TextParameterDefinition *title = new ActionTools::TextParameterDefinition("title", tr("Window title"), this);
title->setTooltip(tr("The title of the window to find, you can use wildcards like * (any number of characters) or ? (one character) here"));
addElement(title);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace Actions
{
ActionTools::StringListPair WindowConditionInstance::conditions = qMakePair(
QStringList() << "created" << "closed",
QStringList() << QObject::tr("Created") << QObject::tr("Closed"));
QStringList()
<< QT_TRANSLATE_NOOP("WindowConditionInstance::conditions", "Created")
<< QT_TRANSLATE_NOOP("WindowConditionInstance::conditions", "Closed"));

WindowConditionInstance::WindowConditionInstance(const ActionTools::ActionDefinition *definition, QObject *parent)
: ActionTools::ActionInstance(definition, parent)
Expand Down
2 changes: 2 additions & 0 deletions actions/actionpackwindows/actions/windowdefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ namespace Actions
explicit WindowDefinition(ActionTools::ActionPack *pack)
: ActionDefinition(pack)
{
translateItems("WindowInstance::actions", WindowInstance::actions);

ActionTools::TextParameterDefinition *title = new ActionTools::TextParameterDefinition("title", tr("Window title"), this);
title->setTooltip(tr("The title of the window to find, you can use wildcards like * (any number of characters) or ? (one character) here"));
addElement(title);
Expand Down
9 changes: 8 additions & 1 deletion actions/actionpackwindows/actions/windowinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ namespace Actions
{
ActionTools::StringListPair WindowInstance::actions = qMakePair(
QStringList() << "close" << "killProcess" << "setForeground" << "minimize" << "maximize" << "move" << "resize",
QStringList() << QObject::tr("Close") << QObject::tr("Kill process") << QObject::tr("Set foreground") << QObject::tr("Minimize") << QObject::tr("Maximize") << QObject::tr("Move") << QObject::tr("Resize"));
QStringList()
<< QT_TRANSLATE_NOOP("WindowInstance::actions", "Close")
<< QT_TRANSLATE_NOOP("WindowInstance::actions", "Kill process")
<< QT_TRANSLATE_NOOP("WindowInstance::actions", "Set foreground")
<< QT_TRANSLATE_NOOP("WindowInstance::actions", "Minimize")
<< QT_TRANSLATE_NOOP("WindowInstance::actions", "Maximize")
<< QT_TRANSLATE_NOOP("WindowInstance::actions", "Move")
<< QT_TRANSLATE_NOOP("WindowInstance::actions", "Resize"));

WindowInstance::WindowInstance(const ActionTools::ActionDefinition *definition, QObject *parent)
: ActionTools::ActionInstance(definition, parent)
Expand Down
19 changes: 13 additions & 6 deletions actiontools/actiondefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <QScriptEngine>
#include <QScriptValue>
#include <QSysInfo>
#include <QApplication>

#ifdef Q_WS_X11
#include <X11/Xlib.h>
Expand All @@ -43,15 +44,21 @@ namespace ActionTools

QString ActionDefinition::CategoryName[CategoryCount] =
{
QObject::tr("Windows"),
QObject::tr("Device"),
QObject::tr("System"),
QObject::tr("Internal"),
QObject::tr("Data")
QT_TRANSLATE_NOOP("ActionDefinition::CategoryName", "Windows"),
QT_TRANSLATE_NOOP("ActionDefinition::CategoryName", "Device"),
QT_TRANSLATE_NOOP("ActionDefinition::CategoryName", "System"),
QT_TRANSLATE_NOOP("ActionDefinition::CategoryName", "Internal"),
QT_TRANSLATE_NOOP("ActionDefinition::CategoryName", "Data")
};

QStringList ActionDefinition::StandardTabs = QStringList() << QObject::tr("Standard") << QObject::tr("Advanced");
QStringList ActionDefinition::StandardTabs = QStringList() << QT_TRANSLATE_NOOP("ActionTabs", "Standard") << QT_TRANSLATE_NOOP("ActionTabs", "Advanced");

void ActionDefinition::translateItems(const char *context, StringListPair &items) const
{
for(int index = 0; index < items.second.size(); ++index)
items.second[index] = QApplication::instance()->translate(context, items.second.at(index).toLatin1());
}

void ActionDefinition::addElement(ElementDefinition *element, int tab)
{
if(tab > 0 && tabs().count() > 0)
Expand Down
Loading

0 comments on commit f71ab22

Please sign in to comment.