Skip to content

uralbash/qmltranslator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QML Translator

Class for translations strings in C++/Qml code.

Usage

#include "qmltranslator.h"

...

// Qml translation manager
QmlTranslator qmlTranslator;
qmlTranslator.initFromSettings(SETTINGS);
engine.rootContext()->setContextProperty("qmlTranslator", &qmlTranslator);

SETTINGS - object of class QSettings

settings.ini fail example:

[Main]
language=ru_RU

In QML code:

qmlTranslator.setTranslation("ru_RU");
qmlTranslator.setTranslation("en_US");
qmlTranslator.setTranslation("de_DE");
qmlTranslator.setTranslation("kz_KZ");

language resources

Add them to your resources with the prefix /translations.

Install

Just include it as submodule to your project or use qpm manager:

$ qpm install com.github.uralbash.qmltranslator

About

Class for translations strings in C++/Qml code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published