Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • akiraohgaki/ocs-url
  • ab3875o/ocs-url
  • dembego3/ocs-url
  • arakun/ocs-url
  • longviauroy/ocs-url
  • rolfen/ocs-url
  • hemm/ocs-url
  • simonsvw0000/ocs-url
  • dfn2/ocs-url
  • rws77/ocs-url
  • bitwalk/ocs-url
  • visdom/ocs-url
  • ricatfarker/ocs-url
  • mussah/ocs-url
  • tigefa/ocs-url
  • cobalt2727/ocs-url
  • ammark226/ocs-url
  • violethaze74/ocs-url
  • armedssault/ocs-url
  • billflick/ocs-url
  • kimblejeremy/ocs-url
  • yuvrajsm/ocs-url
  • wawmart/ocs-url
  • jhefry/ocs-url
  • robcdntruckin/ocs-url
  • bigmake2266/ocs-url
  • kamil-chbeir/ocs-url
  • jocker73/ocs-url
  • laboties/ocs-url
  • smekke61279-522014/ocs-url
  • coolduck/ocs-url
  • zulfikar-lahiya/ocs-url
  • faz-83/ocs-url
  • dado105/ocs-url
34 results
Show changes
Showing
with 960 additions and 0 deletions
#include "ocsurlhandler.h"
#include <QUrlQuery>
#include <QDesktopServices>
#include "qtil_file.h"
#include "qtil_dir.h"
#include "qtil_networkresource.h"
#include "qtil_package.h"
#include "handlers/confighandler.h"
OcsUrlHandler::OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent)
: QObject(parent), ocsUrl_(ocsUrl), configHandler_(configHandler)
{
parse();
}
QString OcsUrlHandler::ocsUrl() const
{
return ocsUrl_;
}
QJsonObject OcsUrlHandler::metadata() const
{
return metadata_;
}
void OcsUrlHandler::process()
{
// ocss scheme is a reserved name, so the process of ocss
// is the same process of the ocs scheme currently.
if (!isValid()) {
QJsonObject result;
result["status"] = QString("error_validation");
result["message"] = tr("Invalid OCS-URL");
emit finishedWithError(result);
return;
}
auto url = metadata_["url"].toString();
auto *resource = new Qtil::NetworkResource(url, QUrl(url), true, this);
connect(resource, &Qtil::NetworkResource::downloadProgress, this, &OcsUrlHandler::downloadProgress);
connect(resource, &Qtil::NetworkResource::finished, this, &OcsUrlHandler::networkResourceFinished);
resource->get();
emit started();
}
bool OcsUrlHandler::isValid() const
{
QString scheme = metadata_["scheme"].toString();
QString command = metadata_["command"].toString();
QString url = metadata_["url"].toString();
QString type = metadata_["type"].toString();
QString filename = metadata_["filename"].toString();
if ((scheme == "ocs" || scheme == "ocss")
&& (command == "download" || command == "install")
&& QUrl(url).isValid()
&& configHandler_->getAppConfigInstallTypes().contains(type)
&& !filename.isEmpty()) {
return true;
}
return false;
}
void OcsUrlHandler::openDestination() const
{
auto type = metadata_["type"].toString();
QDesktopServices::openUrl(QUrl("file://" + configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString()));
}
void OcsUrlHandler::networkResourceFinished(Qtil::NetworkResource *resource)
{
if (!resource->isFinishedWithNoError()) {
QJsonObject result;
result["status"] = QString("error_network");
result["message"] = resource->reply()->errorString();
emit finishedWithError(result);
resource->deleteLater();
return;
}
if (metadata_["command"].toString() == "download") {
saveDownloadedFile(resource);
}
else if (metadata_["command"].toString() == "install") {
installDownloadedFile(resource);
}
}
void OcsUrlHandler::parse()
{
QUrl url(ocsUrl_);
QUrlQuery query(url);
metadata_["scheme"] = QString("ocs");
metadata_["command"] = QString("download");
metadata_["url"] = QString("");
metadata_["type"] = QString("downloads");
metadata_["filename"] = QString("");
if (!url.scheme().isEmpty()) {
metadata_["scheme"] = url.scheme();
}
if (!url.host().isEmpty()) {
metadata_["command"] = url.host();
}
if (query.hasQueryItem("url") && !query.queryItemValue("url").isEmpty()) {
metadata_["url"] = query.queryItemValue("url", QUrl::FullyDecoded);
}
if (query.hasQueryItem("type") && !query.queryItemValue("type").isEmpty()) {
metadata_["type"] = query.queryItemValue("type", QUrl::FullyDecoded);
}
if (query.hasQueryItem("filename") && !query.queryItemValue("filename").isEmpty()) {
metadata_["filename"] = QUrl(query.queryItemValue("filename", QUrl::FullyDecoded)).fileName();
}
if (!metadata_["url"].toString().isEmpty() && metadata_["filename"].toString().isEmpty()) {
metadata_["filename"] = QUrl(metadata_["url"].toString()).fileName();
}
}
void OcsUrlHandler::saveDownloadedFile(Qtil::NetworkResource *resource)
{
QJsonObject result;
auto type = metadata_["type"].toString();
Qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
destDir.make();
Qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
if (!resource->saveData(destFile.path())) {
result["status"] = QString("error_save");
result["message"] = tr("Failed to save data");
emit finishedWithError(result);
resource->deleteLater();
return;
}
result["status"] = QString("success_download");
result["message"] = tr("The file has been downloaded");
emit finishedWithSuccess(result);
resource->deleteLater();
}
void OcsUrlHandler::installDownloadedFile(Qtil::NetworkResource *resource)
{
QJsonObject result;
Qtil::File tempFile(Qtil::Dir::tempPath() + "/" + metadata_["filename"].toString());
if (!resource->saveData(tempFile.path())) {
result["status"] = QString("error_save");
result["message"] = tr("Failed to save data");
emit finishedWithError(result);
resource->deleteLater();
return;
}
Qtil::Package package(tempFile.path());
auto type = metadata_["type"].toString();
Qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
destDir.make();
Qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
if (type == "bin"
&& package.installAsProgram(destFile.path())) {
result["message"] = tr("The file has been installed as program");
}
else if ((type == "plasma_plasmoids" || type == "plasma4_plasmoids" || type == "plasma5_plasmoids")
&& package.installAsPlasmapkg("plasmoid")) {
result["message"] = tr("The plasmoid has been installed");
}
else if ((type == "plasma_look_and_feel" || type == "plasma5_look_and_feel")
&& package.installAsPlasmapkg("lookandfeel")) {
result["message"] = tr("The plasma look and feel has been installed");
}
else if ((type == "plasma_desktopthemes" || type == "plasma5_desktopthemes")
&& package.installAsPlasmapkg("theme")) {
result["message"] = tr("The plasma desktop theme has been installed");
}
else if (type == "kwin_effects"
&& package.installAsPlasmapkg("kwineffect")) {
result["message"] = tr("The KWin effect has been installed");
}
else if (type == "kwin_scripts"
&& package.installAsPlasmapkg("kwinscript")) {
result["message"] = tr("The KWin script has been installed");
}
else if (type == "kwin_tabbox"
&& package.installAsPlasmapkg("windowswitcher")) {
result["message"] = tr("The KWin window switcher has been installed");
}
else if (package.installAsArchive(destDir.path())) {
result["message"] = tr("The archive file has been extracted");
}
else if (package.installAsFile(destFile.path())) {
result["message"] = tr("The file has been installed");
}
else {
result["status"] = QString("error_install");
result["message"] = tr("Failed to installation");
emit finishedWithError(result);
tempFile.remove();
return;
}
result["status"] = QString("success_install");
emit finishedWithSuccess(result);
tempFile.remove();
resource->deleteLater();
}
#pragma once
#include <QObject>
#include <QJsonObject>
namespace Qtil {
class NetworkResource;
}
class ConfigHandler;
class OcsUrlHandler : public QObject
{
Q_OBJECT
public:
explicit OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent = nullptr);
signals:
void started();
void finishedWithSuccess(QJsonObject result);
void finishedWithError(QJsonObject result);
void downloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal);
public slots:
QString ocsUrl() const;
QJsonObject metadata() const;
void process();
bool isValid() const;
void openDestination() const;
private slots:
void networkResourceFinished(Qtil::NetworkResource *resource);
private:
void parse();
void saveDownloadedFile(Qtil::NetworkResource *resource);
void installDownloadedFile(Qtil::NetworkResource *resource);
QString ocsUrl_;
ConfigHandler *configHandler_;
QJsonObject metadata_;
};
#include <QString>
#include <QStringList>
#include <QUrl>
#include <QJsonObject>
#include <QTranslator>
#include <QLocale>
#include <QCommandLineParser>
#include <QApplication>
#include <QIcon>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "handlers/confighandler.h"
#include "handlers/ocsurlhandler.h"
int main(int argc, char *argv[])
{
// Init
QApplication app(argc, argv);
auto *configHandler = new ConfigHandler();
auto appConfigApplication = configHandler->getAppConfigApplication();
app.setApplicationName(appConfigApplication["name"].toString());
app.setApplicationVersion(appConfigApplication["version"].toString());
app.setOrganizationName(appConfigApplication["organization"].toString());
app.setOrganizationDomain(appConfigApplication["domain"].toString());
app.setWindowIcon(QIcon::fromTheme(appConfigApplication["id"].toString(), QIcon(appConfigApplication["icon"].toString())));
// Setup translator
QTranslator translator;
if (translator.load(QLocale(), "messages", ".", ":/i18n")) {
app.installTranslator(&translator);
}
// Setup CLI
QCommandLineParser clParser;
clParser.setApplicationDescription(appConfigApplication["description"].toString());
clParser.addHelpOption();
clParser.addVersionOption();
clParser.addPositionalArgument("OCS-URL", "OCS-URL that starts with ocs://");
clParser.process(app);
auto args = clParser.positionalArguments();
if (args.size() != 1) {
clParser.showHelp(1);
}
auto ocsUrl = QString(args.at(0));
// Setup QML
QQmlApplicationEngine qmlAppEngine;
auto *qmlContext = qmlAppEngine.rootContext();
configHandler->setParent(&qmlAppEngine);
qmlContext->setContextProperty("configHandler", configHandler);
qmlContext->setContextProperty("ocsUrlHandler", new OcsUrlHandler(ocsUrl, configHandler, &qmlAppEngine));
qmlAppEngine.load(QUrl("qrc:/qml/main.qml"));
return app.exec();
}
unix:!ios:!android {
isEmpty(PREFIX) {
PREFIX = /usr/local
}
SRCDIR = $${PWD}
BINDIR = $${PREFIX}/bin
DATADIR = $${PREFIX}/share
target.path = $${BINDIR}
desktop.files = $${SRCDIR}/desktop/$${TARGET}.desktop
desktop.path = $${DATADIR}/applications
icon.files = $${SRCDIR}/desktop/$${TARGET}.svg
icon.path = $${DATADIR}/icons/hicolor/scalable/apps
INSTALLS += target desktop icon
}
export(INSTALLS)
RESOURCES += $${PWD}/desktop.qrc
DISTFILES += $${PWD}/ocs-url.desktop
<RCC>
<qresource prefix="/desktop">
<file>ocs-url.svg</file>
</qresource>
</RCC>
[Desktop Entry]
Name=xdgurl
Exec=xdgurl %u
Name=ocs-url
Exec=ocs-url %u
Icon=ocs-url
Type=Application
Terminal=false
NoDisplay=true
Categories=Application;Network;FileTransfer;
MimeType=x-scheme-handler/xdg;x-scheme-handler/xdgs;
Categories=Network;Utility;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="1000" height="1000" viewBox="0, 0, 1000, 1000">
<g id="icon">
<g id="background">
<path d="M975,500 C975,762.335 762.335,975 500,975 C237.665,975 25,762.335 25,500 C25,237.665 237.665,25 500,25 C762.335,25 975,237.665 975,500 z" fill="#19A2FF" id="background-2"/>
<path d="M950,500 C950,748.528 748.528,950 500,950 C251.472,950 50,748.528 50,500 C50,251.472 251.472,50 500,50 C748.528,50 950,251.472 950,500 z" fill="#53B2FF" id="background-1"/>
</g>
<g id="ocs-url">
<path d="M902.992,380.107 L924.992,380.107 L830.653,670.28 L808.653,670.28 z" fill="#FFFFFF" id="slash-2"/>
<path d="M852.992,380.107 L874.992,380.107 L780.653,670.28 L758.653,670.28 z" fill="#FFFFFF" id="slash-1"/>
<path d="M739.533,556.848 L775.533,556.848 L775.533,592.848 L739.533,592.848 z" fill="#FFFFFF" id="colon-2"/>
<path d="M739.505,457.85 L775.505,457.85 L775.505,493.85 L739.505,493.85 z" fill="#FFFFFF" id="colon-1"/>
<path d="M619.548,389.93 Q581.46,389.931 559.59,399.494 Q537.719,409.057 526.825,425.772 Q515.931,442.487 515.931,461.281 Q515.931,489.888 537.22,508.349 Q558.342,526.811 607.906,537.954 Q638.175,544.607 646.491,552.091 Q654.807,559.576 654.807,569.055 Q654.807,579.035 646.076,586.602 Q637.343,594.17 621.211,594.169 Q599.589,594.17 587.947,579.367 Q580.795,570.22 578.467,552.756 L506.784,557.247 Q509.943,594.17 533.893,618.12 Q557.843,642.07 620.047,642.069 Q655.472,642.07 678.757,631.84 Q702.041,621.612 715.014,601.82 Q727.987,582.029 727.987,558.577 Q727.987,538.619 718.258,522.486 Q708.528,506.354 687.156,495.459 Q665.784,484.566 616.388,473.921 Q596.429,469.764 591.108,464.94 Q585.618,460.283 585.619,454.462 Q585.618,446.479 592.272,440.907 Q598.924,435.336 612.063,435.335 Q628.03,435.336 637.094,442.819 Q646.158,450.304 648.986,466.77 L720.005,462.611 Q715.347,424.691 690.815,407.31 Q666.283,389.931 619.548,389.93 z" fill="#FFFFFF" id="s"/>
<path d="M449.767,389.931 Q424.743,389.931 401.937,399.275 Q379.13,408.62 361.867,425.249 Q344.604,441.879 334.31,464.844 Q324.015,487.809 324.015,515.366 Q324.015,542.925 334.468,566.206 Q344.921,589.488 362.184,606.434 Q379.447,623.381 402.095,632.724 Q424.743,642.069 449.451,642.069 Q461.487,642.069 473.841,639.693 Q486.194,637.318 500.448,632.249 L506.784,630.032 L506.784,556.544 Q483.027,581.886 453.252,581.885 Q439.631,581.886 427.911,576.817 Q416.191,571.75 407.48,562.88 Q398.769,554.011 393.86,541.974 Q388.95,529.938 388.95,515.683 Q388.95,501.746 393.86,489.709 Q398.769,477.673 407.322,468.961 Q415.874,460.251 427.753,455.182 Q439.631,450.115 453.568,450.114 Q485.244,450.115 506.784,476.405 L506.784,402.284 Q491.579,395.95 477.8,392.94 Q464.021,389.931 449.767,389.931 z" fill="#FFFFFF" id="c"/>
<path d="M223.997,389.93 Q252.822,389.932 277.212,399.591 Q301.602,409.254 319.183,426.357 Q336.762,443.463 346.582,466.427 Q356.401,489.393 356.402,515.999 Q356.401,542.608 346.582,565.572 Q336.762,588.538 319.183,605.641 Q301.602,622.748 277.212,632.407 Q252.822,642.07 223.997,642.068 Q194.855,642.07 170.624,632.407 Q146.392,622.748 128.97,605.641 Q111.548,588.538 101.729,565.572 Q91.91,542.608 91.91,515.999 Q91.91,489.393 101.729,466.427 Q111.548,443.463 128.97,426.357 Q146.392,409.254 170.624,399.591 Q194.855,389.932 223.997,389.93 z M223.997,450.114 Q210.377,450.115 198.182,455.024 Q185.986,459.935 176.801,468.803 Q167.614,477.673 162.23,489.709 Q156.845,501.747 156.845,515.999 Q156.845,530.255 162.23,542.29 Q167.614,554.328 176.801,563.196 Q185.986,572.067 198.182,576.975 Q210.377,581.886 223.997,581.885 Q237.618,581.886 249.813,576.975 Q262.008,572.067 271.352,563.196 Q280.697,554.328 286.082,542.29 Q291.466,530.255 291.466,515.999 Q291.466,501.747 286.082,489.709 Q280.697,477.673 271.352,468.803 Q262.008,459.935 249.813,455.024 Q237.618,450.115 223.997,450.114 z" fill="#FFFFFF" id="o"/>
</g>
</g>
</svg>
# How to install
## Install from package
Download Linux package from: https://www.opendesktop.org/p/1136805/
Then click the downloaded package and continue to installation with package manager.
Or install the downloaded package using terminal:
Ubuntu 14.04
$ sudo apt install libqt5svg5 qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin qtdeclarative5-controls-plugin
$ sudo dpkg -i /path/to/ocs-url*.deb
Ubuntu 16.04
$ sudo apt install libqt5svg5 qml-module-qtquick-controls
$ sudo dpkg -i /path/to/ocs-url*.deb
Fedora 20
# yum insall qt5-qtbase qt5-qtbase-gui qt5-qtsvg qt5-qtdeclarative qt5-qtquickcontrols
# rpm -i /path/to/ocs-url*.rpm
Fedora 22
# dnf insall qt5-qtbase qt5-qtbase-gui qt5-qtsvg qt5-qtdeclarative qt5-qtquickcontrols
# rpm -i /path/to/ocs-url*.rpm
openSUSE 42.1
# zypper install libQt5Svg5 libqt5-qtquickcontrols
# rpm -i /path/to/ocs-url*.rpm
Arch Linux
# pacman -S qt5-base qt5-svg qt5-declarative qt5-quickcontrols
# pacman -U /path/to/ocs-url*.pkg.tar.xz
## Install from source
Make git clone, or download the source archive and extract it.
Build and install
$ cd /path/to/ocs-url
$ ./scripts/prepare
$ qmake PREFIX=/usr
$ make
$ sudo make install
Uninstall
$ sudo make uninstall
# How to use
## Web browser
Just click a OCS-URL (ocs://) links, or type OCS-URL in browser's address bar.
If you use Firefox, a program selection window opens the first time you open OCS-URL,
and you can choose "ocs-url" as custom URL handler.
If you don't get the program selection window or you are using another browser,
please set the ocs-url program as custom URL handler for ocs:// scheme in the browser's settings.
## Command-line
Execute ocs-url program with argument OCS-URL.
$ ocs-url "ocs://install?url=http%3A%2F%2Fexample.com%2Ficons.tar.gz&type=icons"
# Internationalization
ocs-url/i18n/ is sub project for program internationalization.
## Localization for program
Using two tools lupdate and lrelease to make translation.
Text is gathered from program source files and included in QM files for translation along with other resource files.
### Creating TS (Translation Source) files
To generate TS files, sets TS file name to definition TRANSLATIONS in i18n.pro and run lupdate with i18n.pro.
$ cd /path/to/ocs-url/i18n/
$ lupdate i18n.pro
Then adds translations to the generated TS files using Qt Linguist or text editor.
### Creating QM (Qt Message) files
To generate QM files, run lrelease with i18n.pro.
$ cd /path/to/ocs-url/i18n/
$ lrelease i18n.pro
Then adds the path of the generated QM files to i18n.qrc.
# OCS-URL specification
OCS-URL is a custom URL that represent the installation method of items served on OpenCollaborationServices (OCS).
## URL structure
[scheme]://[command]?[query string]
For example:
ocs://install?url=http%3A%2F%2Fexample.com%2Ficons.tar.gz&type=icons
## Scheme
Scheme | Description
-------|------------
ocs | ocs scheme
ocss | ocs scheme for secure protocol
"ocss" scheme is the same of the ocs scheme for now,
it's a reserved name for secure protocol in the future.
## Command
Command | Description
--------|------------
download | Download the file from specified URL to the installation destination of specified install-type.
install | Make file downloading and trigger installation process.
## Query string
OCS-URL's query string is an option of command.
*All query string values should be urlencoded.*
Parameter | Required | Default | Description
----------|----------|---------|------------
url | Yes | - | File URL
type | - | downloads | Install-type
filename | - | File name from URL | Alternative file name
"filename" option is useful if the file URL does not represent a file name.
### Install-type
Available install-type:
Install-type | Installation destination
-------------|------------------
bin | $HOME/.local/bin
downloads | $HOME/Downloads
documents | $HOME/Documents
pictures | $HOME/Pictures
music | $HOME/Music
videos | $HOME/Videos
wallpapers | $XDG_DATA_HOME/wallpapers
fonts | $HOME/.fonts
cursors | $HOME/.icons
icons | $XDG_DATA_HOME/icons
emoticons | $XDG_DATA_HOME/emoticons
themes | $HOME/.themes
emerald_themes | $HOME/.emerald/themes
enlightenment_themes | $HOME/.e/e/themes
enlightenment_backgrounds | $HOME/.e/e/backgrounds
fluxbox_styles | $HOME/.fluxbox/styles
pekwm_themes | $HOME/.pekwm/themes
icewm_themes | $HOME/.icewm/themes
plasma_plasmoids | $XDG_DATA_HOME/plasma/plasmoids
plasma_look_and_feel | $XDG_DATA_HOME/plasma/look-and-feel
plasma_desktopthemes | $XDG_DATA_HOME/plasma/desktoptheme
kwin_effects | $XDG_DATA_HOME/kwin/effects
kwin_scripts | $XDG_DATA_HOME/kwin/scripts
kwin_tabbox | $XDG_DATA_HOME/kwin/tabbox
aurorae_themes | $XDG_DATA_HOME/aurorae/themes
dekorator_themes | $XDG_DATA_HOME/deKorator/themes
qtcurve | $XDG_DATA_HOME/QtCurve
color_schemes | $XDG_DATA_HOME/color-schemes
gnome_shell_extensions | $XDG_DATA_HOME/gnome-shell/extensions
cinnamon_applets | $XDG_DATA_HOME/cinnamon/applets
cinnamon_desklets | $XDG_DATA_HOME/cinnamon/desklets
cinnamon_extensions | $XDG_DATA_HOME/cinnamon/extensions
nautilus_scripts | $XDG_DATA_HOME/nautilus/scripts
amarok_scripts | $KDEHOME/share/apps/amarok/scripts
yakuake_skins | $KDEHOME/share/apps/yakuake/skins
cairo_clock_themes | $HOME/.cairo-clock/themes
books | $APP_DATA/books
comics | $APP_DATA/comics
$APP_DATA is not environment variable, it's internal variable in the program and expressed to $XDG_DATA_HOME/{application ID or name}.
Available alias name of the install-type:
Alias | Install-type
------|-------------
gnome_shell_themes | themes
cinnamon_themes | themes
gtk2_themes | themes
gtk3_themes | themes
metacity_themes | themes
xfwm4_themes | themes
openbox_themes | themes
kvantum_themes | themes
compiz_themes | emerald_themes
beryl_themes | emerald_themes
plasma4_plasmoids | plasma_plasmoids
plasma5_plasmoids | plasma_plasmoids
plasma5_look_and_feel | plasma_look_and_feel
plasma5_desktopthemes | plasma_desktopthemes
plasma_color_schemes | color_schemes
RESOURCES += $${PWD}/i18n.qrc
SOURCES += $$system(find $${PWD}/../app -type f -name "*.cpp" -or -name "*.qml" -or -name "*.js")
TRANSLATIONS += \
$${PWD}/messages.ts \
$${PWD}/messages.en_US.ts \
$${PWD}/messages.ja_JP.ts \
$${PWD}/messages.tr_TR.ts \
$${PWD}/messages.zh_TW.ts
include($${PWD}/i18n.pri)
<RCC>
<qresource prefix="/i18n">
<file>messages.qm</file>
<file>messages.en_US.qm</file>
<file>messages.ja_JP.qm</file>
<file>messages.tr_TR.qm</file>
<file>messages.zh_TW.qm</file>
</qresource>
</RCC>
File added
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>OcsUrlHandler</name>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
<source>Invalid OCS-URL</source>
<translation>Invalid OCS-URL</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
<source>Failed to save data</source>
<translation>Failed to save data</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
<source>The file has been downloaded</source>
<translation>The file has been downloaded</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
<source>The file has been installed as program</source>
<translation>The file has been installed as program</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
<source>The plasmoid has been installed</source>
<translation>The plasmoid has been installed</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
<source>The plasma look and feel has been installed</source>
<translation>The plasma look and feel has been installed</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
<source>The plasma desktop theme has been installed</source>
<translation>The plasma desktop theme has been installed</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
<source>The KWin effect has been installed</source>
<translation>The KWin effect has been installed</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
<source>The KWin script has been installed</source>
<translation>The KWin script has been installed</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
<source>The KWin window switcher has been installed</source>
<translation>The KWin window switcher has been installed</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
<source>The archive file has been extracted</source>
<translation>The archive file has been extracted</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
<source>The file has been installed</source>
<translation>The file has been installed</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
<source>Failed to installation</source>
<translation>Failed to installation</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../app/qml/main.qml" line="26"/>
<source>Download successful</source>
<translation>Download successful</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="27"/>
<source>Installation successful</source>
<translation>Installation successful</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="28"/>
<source>Validation error</source>
<translation>Validation error</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="29"/>
<source>Network error</source>
<translation>Network error</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="30"/>
<source>Saving file failed</source>
<translation>Saving file failed</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="31"/>
<source>Installation failed</source>
<translation>Installation failed</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="56"/>
<source>Downloading</source>
<translation>Downloading</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="66"/>
<source>Do you want to download?</source>
<translation>Do you want to download?</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="69"/>
<source>Do you want to install?</source>
<translation>Do you want to install?</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="73"/>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="74"/>
<source>File</source>
<translation>File</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="75"/>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="80"/>
<source>Invalid OCS-URL</source>
<translation>Invalid OCS-URL</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="96"/>
<location filename="../app/qml/main.qml" line="109"/>
<location filename="../app/qml/main.qml" line="125"/>
<source>Details</source>
<translation>Details</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="98"/>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="100"/>
<location filename="../app/qml/main.qml" line="160"/>
<source>Cancel</source>
<translation>Cancel</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="111"/>
<source>Open</source>
<translation>Open</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="116"/>
<location filename="../app/qml/main.qml" line="127"/>
<source>Close</source>
<translation>Close</translation>
</message>
</context>
</TS>
File added
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja_JP">
<context>
<name>OcsUrlHandler</name>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
<source>Invalid OCS-URL</source>
<translation>無効なOCS-URL</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
<source>Failed to save data</source>
<translation>ファイルの保存に失敗</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
<source>The file has been downloaded</source>
<translation>ファイルがダウンロードされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
<source>The file has been installed as program</source>
<translation>ファイルがプログラムとしてインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
<source>The plasmoid has been installed</source>
<translation>plasmoidがインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
<source>The plasma look and feel has been installed</source>
<translation>plasma look and feelがインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
<source>The plasma desktop theme has been installed</source>
<translation>plasma desktop themeがインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
<source>The KWin effect has been installed</source>
<translation>KWin effectがインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
<source>The KWin script has been installed</source>
<translation>KWin scriptがインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
<source>The KWin window switcher has been installed</source>
<translation>KWin window switcherがインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
<source>The archive file has been extracted</source>
<translation>圧縮ファイルが展開されました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
<source>The file has been installed</source>
<translation>ファイルがインストールされました</translation>
</message>
<message>
<location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
<source>Failed to installation</source>
<translation>インストールに失敗</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../app/qml/main.qml" line="26"/>
<source>Download successful</source>
<translation>ダウンロード成功</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="27"/>
<source>Installation successful</source>
<translation>インストール成功</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="28"/>
<source>Validation error</source>
<translation>検証エラー</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="29"/>
<source>Network error</source>
<translation>通信エラー</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="30"/>
<source>Saving file failed</source>
<translation>ファイル保存失敗</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="31"/>
<source>Installation failed</source>
<translation>インストール失敗</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="56"/>
<source>Downloading</source>
<translation>ダウンロード中</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="66"/>
<source>Do you want to download?</source>
<translation>ダウンロードしますか?</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="69"/>
<source>Do you want to install?</source>
<translation>インストールしますか?</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="73"/>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="74"/>
<source>File</source>
<translation>ファイル</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="75"/>
<source>Type</source>
<translation>タイプ</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="80"/>
<source>Invalid OCS-URL</source>
<translation>無効なOCS-URL</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="96"/>
<location filename="../app/qml/main.qml" line="109"/>
<location filename="../app/qml/main.qml" line="125"/>
<source>Details</source>
<translation>詳細</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="98"/>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="100"/>
<location filename="../app/qml/main.qml" line="160"/>
<source>Cancel</source>
<translation>キャンセル</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="111"/>
<source>Open</source>
<translation>開く</translation>
</message>
<message>
<location filename="../app/qml/main.qml" line="116"/>
<location filename="../app/qml/main.qml" line="127"/>
<source>Close</source>
<translation>閉じる</translation>
</message>
</context>
</TS>
<d!`
\ No newline at end of file