Skip to content
Snippets Groups Projects
Unverified Commit cf5ed56c authored by meskio's avatar meskio :tent:
Browse files

Add support for internationalization

- Resolves: #243
parent cdb42f0d
No related branches found
No related tags found
No related merge requests found
Showing with 1247 additions and 189 deletions
...@@ -9,6 +9,7 @@ cmd/bitmask-vpn/bitmask-vpn ...@@ -9,6 +9,7 @@ cmd/bitmask-vpn/bitmask-vpn
cmd/bitmask-helper/bitmask-helper cmd/bitmask-helper/bitmask-helper
/bitmask-connect /bitmask-connect
cmd/bitmask-connect/bitmask-connect cmd/bitmask-connect/bitmask-connect
gui/i18n/*.qm
locales/*/out.gotext.json locales/*/out.gotext.json
tools/transifex/transifex tools/transifex/transifex
......
...@@ -241,23 +241,12 @@ icon: ...@@ -241,23 +241,12 @@ icon:
@make -C icon @make -C icon
LANGS ?= $(foreach path,$(wildcard locales/*),$(patsubst locales/%,%,$(path))) LANGS ?= $(foreach path,$(wildcard gui/i18n/main_*.ts),$(patsubst gui/i18n/main_%.ts,%,$(path)))
empty :=
space := $(empty) $(empty)
lang_list := $(subst $(space),,$(foreach lang,$(LANGS),$(lang),))
locales: $(foreach lang,$(LANGS),get_$(lang)) cmd/bitmask-vpn/catalog.go locales: $(foreach lang,$(LANGS),get_$(lang))
generate_locales: generate_locales:
@gotext update -lang=$(lang_list) ./pkg/systray ./pkg/bitmask @lupdate bitmask.pro
@make -C tools/transifex
locales/%/out.gotext.json: pkg/systray/systray.go pkg/systray/notificator.go pkg/bitmask/standalone.go get_%:
@gotext update -lang=$* ./pkg/systray ./pkg/bitmask @curl -L -X GET --user "api:${API_TOKEN}" "https://www.transifex.com/api/2/project/bitmask/resource/riseupvpn-test/translation/${subst -,_,$*}/?file" > gui/i18n/main_$*.ts
cmd/bitmask-vpn/catalog.go: $(foreach lang,$(LANGS),locales/$(lang)/messages.gotext.json)
@gotext update -lang=$(lang_list) -out cmd/bitmask-vpn/catalog.go ./pkg/systray ./pkg/bitmask
get_%: locales/%/out.gotext.json
@make -C tools/transifex build
@curl -L -X GET --user "api:${API_TOKEN}" "https://www.transifex.com/api/2/project/bitmask/resource/RiseupVPN/translation/${subst -,_,$*}/?file" | tools/transifex/transifex t2g locales/$*/
...@@ -47,3 +47,8 @@ Debug:UI_DIR = debug/.ui ...@@ -47,3 +47,8 @@ Debug:UI_DIR = debug/.ui
DISTFILES += \ DISTFILES += \
README.md README.md
CONFIG += lrelease embed_translations
TRANSLATIONS += $$files(gui/i18n/*.ts, true)
RESOURCES += $$files(gui/i18n/*.qm, true)
...@@ -51,6 +51,7 @@ function buildQmake { ...@@ -51,6 +51,7 @@ function buildQmake {
echo "[+] Building BitmaskVPN" echo "[+] Building BitmaskVPN"
lrelease bitmask.pro
buildGoLib buildGoLib
buildQmake buildQmake
make -C qtbuild clean make -C qtbuild clean
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../qml/AboutDialog.qml" line="5"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="19"/>
<source>&lt;p&gt;%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.&lt;/p&gt; &lt;p&gt;This service is paid for entirely by donations from users like you. &lt;a href=&quot;%3&quot;&gt;Please donate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;By using this application, you agree to the &lt;a href=&quot;%4&quot;&gt;Terms of Service&lt;/a&gt;. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.&lt;/p&gt;</source>
<extracomment>about dialog %1 -&gt; application name %2 -&gt; provider name %3 -&gt; donation URL %4 -&gt; TOS URL</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="29"/>
<source>%1 version: %2</source>
<extracomment>%1 -&gt; application name %2 -&gt; version string</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DonateDialog</name>
<message>
<location filename="../qml/DonateDialog.qml" line="6"/>
<source>Donate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/DonateDialog.qml" line="14"/>
<source>The %1 service is expensive to run. Because we don&apos;t want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.
Do you want to donate now?</source>
<extracomment>donate dialog %1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../qml/LoginDialog.qml" line="7"/>
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="11"/>
<source>Log in with your library credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="15"/>
<source>patron id</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="19"/>
<source>password</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../qml/main.qml" line="25"/>
<source>Could not find helpers. Check your installation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="27"/>
<source>Could not find polkit agent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="56"/>
<source>%1 off</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="59"/>
<source>%1 on</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="62"/>
<source>Connecting to %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="65"/>
<source>Stopping %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="68"/>
<source>%1 blocking internet</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="105"/>
<location filename="../qml/main.qml" line="151"/>
<source>Checking status...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="158"/>
<source>Reconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="160"/>
<source>Turn on</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="171"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="173"/>
<source>Turn off</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="184"/>
<source>Help...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="189"/>
<source>Donate...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="195"/>
<source>About...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="202"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="227"/>
<source>Error starting VPN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="237"/>
<source>Missing authentication agent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="238"/>
<source>Could not find a polkit authentication agent. Please run one and try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="246"/>
<source>Initialization Error</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ar">
<context>
<name>AboutDialog</name>
<message>
<location filename="../qml/AboutDialog.qml" line="5"/>
<source>About</source>
<translation>حول</translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="19"/>
<source>&lt;p&gt;%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.&lt;/p&gt; &lt;p&gt;This service is paid for entirely by donations from users like you. &lt;a href=&quot;%3&quot;&gt;Please donate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;By using this application, you agree to the &lt;a href=&quot;%4&quot;&gt;Terms of Service&lt;/a&gt;. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.&lt;/p&gt;</source>
<extracomment>about dialog %1 -&gt; application name %2 -&gt; provider name %3 -&gt; donation URL %4 -&gt; TOS URL</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="29"/>
<source>%1 version: %2</source>
<extracomment>%1 -&gt; application name %2 -&gt; version string</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DonateDialog</name>
<message>
<location filename="../qml/DonateDialog.qml" line="6"/>
<source>Donate</source>
<translation>تبرَّع</translation>
</message>
<message>
<location filename="../qml/DonateDialog.qml" line="14"/>
<source>The %1 service is expensive to run. Because we don&apos;t want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.
Do you want to donate now?</source>
<extracomment>donate dialog %1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../qml/LoginDialog.qml" line="7"/>
<source>Login</source>
<translation>تسجيل الدخول </translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="11"/>
<source>Log in with your library credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="15"/>
<source>patron id</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="19"/>
<source>password</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../qml/main.qml" line="25"/>
<source>Could not find helpers. Check your installation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="27"/>
<source>Could not find polkit agent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="56"/>
<source>%1 off</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="59"/>
<source>%1 on</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="62"/>
<source>Connecting to %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="65"/>
<source>Stopping %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="68"/>
<source>%1 blocking internet</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="105"/>
<location filename="../qml/main.qml" line="151"/>
<source>Checking status...</source>
<translation>جارى التحقق من الوضع...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="158"/>
<source>Reconnect</source>
<translation>إعادة الاتصال</translation>
</message>
<message>
<location filename="../qml/main.qml" line="160"/>
<source>Turn on</source>
<translation>تشغيل</translation>
</message>
<message>
<location filename="../qml/main.qml" line="171"/>
<source>Cancel</source>
<translation>إلغاء </translation>
</message>
<message>
<location filename="../qml/main.qml" line="173"/>
<source>Turn off</source>
<translation>إغلاق</translation>
</message>
<message>
<location filename="../qml/main.qml" line="184"/>
<source>Help...</source>
<translation>المساعدة...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="189"/>
<source>Donate...</source>
<translation>تبرع...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="195"/>
<source>About...</source>
<translation>عن الخدمة...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="202"/>
<source>Quit</source>
<translation>خروج</translation>
</message>
<message>
<location filename="../qml/main.qml" line="227"/>
<source>Error starting VPN</source>
<translation>حدث خطأ فى تشغيل VPN</translation>
</message>
<message>
<location filename="../qml/main.qml" line="237"/>
<source>Missing authentication agent</source>
<translation>أداة الدخول للحساب مفقودة</translation>
</message>
<message>
<location filename="../qml/main.qml" line="238"/>
<source>Could not find a polkit authentication agent. Please run one and try again.</source>
<translation>لم يجد البرنامج أداة الدخول (polkit). من فضلك شغل واحدة وحاول ثانية.</translation>
</message>
<message>
<location filename="../qml/main.qml" line="246"/>
<source>Initialization Error</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="es">
<context>
<name>AboutDialog</name>
<message>
<location filename="../qml/AboutDialog.qml" line="5"/>
<source>About</source>
<translation>Acerca de</translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="19"/>
<source>&lt;p&gt;%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.&lt;/p&gt; &lt;p&gt;This service is paid for entirely by donations from users like you. &lt;a href=&quot;%3&quot;&gt;Please donate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;By using this application, you agree to the &lt;a href=&quot;%4&quot;&gt;Terms of Service&lt;/a&gt;. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.&lt;/p&gt;</source>
<extracomment>about dialog %1 -&gt; application name %2 -&gt; provider name %3 -&gt; donation URL %4 -&gt; TOS URL</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="29"/>
<source>%1 version: %2</source>
<extracomment>%1 -&gt; application name %2 -&gt; version string</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DonateDialog</name>
<message>
<location filename="../qml/DonateDialog.qml" line="6"/>
<source>Donate</source>
<translation>Dona</translation>
</message>
<message>
<location filename="../qml/DonateDialog.qml" line="14"/>
<source>The %1 service is expensive to run. Because we don&apos;t want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.
Do you want to donate now?</source>
<extracomment>donate dialog %1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../qml/LoginDialog.qml" line="7"/>
<source>Login</source>
<translation>Acceder</translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="11"/>
<source>Log in with your library credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="15"/>
<source>patron id</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="19"/>
<source>password</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../qml/main.qml" line="25"/>
<source>Could not find helpers. Check your installation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="27"/>
<source>Could not find polkit agent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="56"/>
<source>%1 off</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="59"/>
<source>%1 on</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="62"/>
<source>Connecting to %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="65"/>
<source>Stopping %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="68"/>
<source>%1 blocking internet</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="105"/>
<location filename="../qml/main.qml" line="151"/>
<source>Checking status...</source>
<translation>Comprobando el estado...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="158"/>
<source>Reconnect</source>
<translation>Volver a conectar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="160"/>
<source>Turn on</source>
<translation>Encender</translation>
</message>
<message>
<location filename="../qml/main.qml" line="171"/>
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="173"/>
<source>Turn off</source>
<translation>Apagar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="184"/>
<source>Help...</source>
<translation>Ayuda...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="189"/>
<source>Donate...</source>
<translation>Dona...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="195"/>
<source>About...</source>
<translation>Acerca de...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="202"/>
<source>Quit</source>
<translation>Cerrar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="227"/>
<source>Error starting VPN</source>
<translation>Error al iniciar la VPN</translation>
</message>
<message>
<location filename="../qml/main.qml" line="237"/>
<source>Missing authentication agent</source>
<translation>Falta un agente de autenticación</translation>
</message>
<message>
<location filename="../qml/main.qml" line="238"/>
<source>Could not find a polkit authentication agent. Please run one and try again.</source>
<translation>No se pudo encontrar ningún agente de autenticacion de polkit. Por favor lanza uno y prueba de nuevo.</translation>
</message>
<message>
<location filename="../qml/main.qml" line="246"/>
<source>Initialization Error</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="es_ES">
<context>
<name>AboutDialog</name>
<message>
<location filename="../qml/AboutDialog.qml" line="5"/>
<source>About</source>
<translation>Acerca de</translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="19"/>
<source>&lt;p&gt;%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.&lt;/p&gt; &lt;p&gt;This service is paid for entirely by donations from users like you. &lt;a href=&quot;%3&quot;&gt;Please donate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;By using this application, you agree to the &lt;a href=&quot;%4&quot;&gt;Terms of Service&lt;/a&gt;. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.&lt;/p&gt;</source>
<extracomment>about dialog %1 -&gt; application name %2 -&gt; provider name %3 -&gt; donation URL %4 -&gt; TOS URL</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="29"/>
<source>%1 version: %2</source>
<extracomment>%1 -&gt; application name %2 -&gt; version string</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DonateDialog</name>
<message>
<location filename="../qml/DonateDialog.qml" line="6"/>
<source>Donate</source>
<translation>Donar</translation>
</message>
<message>
<location filename="../qml/DonateDialog.qml" line="14"/>
<source>The %1 service is expensive to run. Because we don&apos;t want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.
Do you want to donate now?</source>
<extracomment>donate dialog %1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../qml/LoginDialog.qml" line="7"/>
<source>Login</source>
<translation>Iniciar Sesión</translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="11"/>
<source>Log in with your library credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="15"/>
<source>patron id</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="19"/>
<source>password</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../qml/main.qml" line="25"/>
<source>Could not find helpers. Check your installation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="27"/>
<source>Could not find polkit agent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="56"/>
<source>%1 off</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="59"/>
<source>%1 on</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="62"/>
<source>Connecting to %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="65"/>
<source>Stopping %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="68"/>
<source>%1 blocking internet</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="105"/>
<location filename="../qml/main.qml" line="151"/>
<source>Checking status...</source>
<translation>Comprobando estado...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="158"/>
<source>Reconnect</source>
<translation>Reconectar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="160"/>
<source>Turn on</source>
<translation>Activar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="171"/>
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="173"/>
<source>Turn off</source>
<translation>Desactivar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="184"/>
<source>Help...</source>
<translation>Ayuda...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="189"/>
<source>Donate...</source>
<translation>Donar...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="195"/>
<source>About...</source>
<translation>Acerca de...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="202"/>
<source>Quit</source>
<translation>Salir</translation>
</message>
<message>
<location filename="../qml/main.qml" line="227"/>
<source>Error starting VPN</source>
<translation>Error iniciando VPN</translation>
</message>
<message>
<location filename="../qml/main.qml" line="237"/>
<source>Missing authentication agent</source>
<translation>Falta agente de autenticación</translation>
</message>
<message>
<location filename="../qml/main.qml" line="238"/>
<source>Could not find a polkit authentication agent. Please run one and try again.</source>
<translation>No se pudo encontrar un agente de autenticación polkit. Por favor corre uno e intenta de nuevo.</translation>
</message>
<message>
<location filename="../qml/main.qml" line="246"/>
<source>Initialization Error</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="nl">
<context>
<name>AboutDialog</name>
<message>
<location filename="../qml/AboutDialog.qml" line="5"/>
<source>About</source>
<translation>Over</translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="19"/>
<source>&lt;p&gt;%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.&lt;/p&gt; &lt;p&gt;This service is paid for entirely by donations from users like you. &lt;a href=&quot;%3&quot;&gt;Please donate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;By using this application, you agree to the &lt;a href=&quot;%4&quot;&gt;Terms of Service&lt;/a&gt;. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.&lt;/p&gt;</source>
<extracomment>about dialog %1 -&gt; application name %2 -&gt; provider name %3 -&gt; donation URL %4 -&gt; TOS URL</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="29"/>
<source>%1 version: %2</source>
<extracomment>%1 -&gt; application name %2 -&gt; version string</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DonateDialog</name>
<message>
<location filename="../qml/DonateDialog.qml" line="6"/>
<source>Donate</source>
<translation>Doneren</translation>
</message>
<message>
<location filename="../qml/DonateDialog.qml" line="14"/>
<source>The %1 service is expensive to run. Because we don&apos;t want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.
Do you want to donate now?</source>
<extracomment>donate dialog %1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../qml/LoginDialog.qml" line="7"/>
<source>Login</source>
<translation>Inloggen</translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="11"/>
<source>Log in with your library credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="15"/>
<source>patron id</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="19"/>
<source>password</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../qml/main.qml" line="25"/>
<source>Could not find helpers. Check your installation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="27"/>
<source>Could not find polkit agent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="56"/>
<source>%1 off</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="59"/>
<source>%1 on</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="62"/>
<source>Connecting to %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="65"/>
<source>Stopping %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="68"/>
<source>%1 blocking internet</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="105"/>
<location filename="../qml/main.qml" line="151"/>
<source>Checking status...</source>
<translation>Status controleren...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="158"/>
<source>Reconnect</source>
<translation>Opnieuw verbinden</translation>
</message>
<message>
<location filename="../qml/main.qml" line="160"/>
<source>Turn on</source>
<translation>Inschakelen</translation>
</message>
<message>
<location filename="../qml/main.qml" line="171"/>
<source>Cancel</source>
<translation>Annuleren</translation>
</message>
<message>
<location filename="../qml/main.qml" line="173"/>
<source>Turn off</source>
<translation>Uitschakelen</translation>
</message>
<message>
<location filename="../qml/main.qml" line="184"/>
<source>Help...</source>
<translation>Hulp...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="189"/>
<source>Donate...</source>
<translation>Doneren...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="195"/>
<source>About...</source>
<translation>Over...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="202"/>
<source>Quit</source>
<translation>Stoppen</translation>
</message>
<message>
<location filename="../qml/main.qml" line="227"/>
<source>Error starting VPN</source>
<translation>Fout bij het opstarten van de VPN</translation>
</message>
<message>
<location filename="../qml/main.qml" line="237"/>
<source>Missing authentication agent</source>
<translation>Authenticatieagent ontbreekt</translation>
</message>
<message>
<location filename="../qml/main.qml" line="238"/>
<source>Could not find a polkit authentication agent. Please run one and try again.</source>
<translation>Kan geen polkit authenticatieagent vinden. Voer er een uit en probeer opnieuw.</translation>
</message>
<message>
<location filename="../qml/main.qml" line="246"/>
<source>Initialization Error</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl">
<context>
<name>AboutDialog</name>
<message>
<location filename="../qml/AboutDialog.qml" line="5"/>
<source>About</source>
<translation>O programie...</translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="19"/>
<source>&lt;p&gt;%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.&lt;/p&gt; &lt;p&gt;This service is paid for entirely by donations from users like you. &lt;a href=&quot;%3&quot;&gt;Please donate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;By using this application, you agree to the &lt;a href=&quot;%4&quot;&gt;Terms of Service&lt;/a&gt;. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.&lt;/p&gt;</source>
<extracomment>about dialog %1 -&gt; application name %2 -&gt; provider name %3 -&gt; donation URL %4 -&gt; TOS URL</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="29"/>
<source>%1 version: %2</source>
<extracomment>%1 -&gt; application name %2 -&gt; version string</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DonateDialog</name>
<message>
<location filename="../qml/DonateDialog.qml" line="6"/>
<source>Donate</source>
<translation>Darowizna</translation>
</message>
<message>
<location filename="../qml/DonateDialog.qml" line="14"/>
<source>The %1 service is expensive to run. Because we don&apos;t want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.
Do you want to donate now?</source>
<extracomment>donate dialog %1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../qml/LoginDialog.qml" line="7"/>
<source>Login</source>
<translation>Login</translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="11"/>
<source>Log in with your library credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="15"/>
<source>patron id</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="19"/>
<source>password</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../qml/main.qml" line="25"/>
<source>Could not find helpers. Check your installation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="27"/>
<source>Could not find polkit agent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="56"/>
<source>%1 off</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="59"/>
<source>%1 on</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="62"/>
<source>Connecting to %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="65"/>
<source>Stopping %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="68"/>
<source>%1 blocking internet</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="105"/>
<location filename="../qml/main.qml" line="151"/>
<source>Checking status...</source>
<translation>Sprawdzanie statusu</translation>
</message>
<message>
<location filename="../qml/main.qml" line="158"/>
<source>Reconnect</source>
<translation>Połącz ponownie</translation>
</message>
<message>
<location filename="../qml/main.qml" line="160"/>
<source>Turn on</source>
<translation>Włącz</translation>
</message>
<message>
<location filename="../qml/main.qml" line="171"/>
<source>Cancel</source>
<translation>Anuluj</translation>
</message>
<message>
<location filename="../qml/main.qml" line="173"/>
<source>Turn off</source>
<translation>Wyłącz</translation>
</message>
<message>
<location filename="../qml/main.qml" line="184"/>
<source>Help...</source>
<translation>Pomoc...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="189"/>
<source>Donate...</source>
<translation>Wesprzyj...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="195"/>
<source>About...</source>
<translation>O programie...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="202"/>
<source>Quit</source>
<translation>Zamknij</translation>
</message>
<message>
<location filename="../qml/main.qml" line="227"/>
<source>Error starting VPN</source>
<translation>Błąd przy uruchamianiu VPN&apos;a</translation>
</message>
<message>
<location filename="../qml/main.qml" line="237"/>
<source>Missing authentication agent</source>
<translation>Brakujący agent autoryzacji</translation>
</message>
<message>
<location filename="../qml/main.qml" line="238"/>
<source>Could not find a polkit authentication agent. Please run one and try again.</source>
<translation>Nie znaleziono agenta autentykacji polkit. Proszę uruchom go i spróbuj ponownie.</translation>
</message>
<message>
<location filename="../qml/main.qml" line="246"/>
<source>Initialization Error</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pt_BR">
<context>
<name>AboutDialog</name>
<message>
<location filename="../qml/AboutDialog.qml" line="5"/>
<source>About</source>
<translation>Sobre</translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="19"/>
<source>&lt;p&gt;%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.&lt;/p&gt; &lt;p&gt;This service is paid for entirely by donations from users like you. &lt;a href=&quot;%3&quot;&gt;Please donate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;By using this application, you agree to the &lt;a href=&quot;%4&quot;&gt;Terms of Service&lt;/a&gt;. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.&lt;/p&gt;</source>
<extracomment>about dialog %1 -&gt; application name %2 -&gt; provider name %3 -&gt; donation URL %4 -&gt; TOS URL</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AboutDialog.qml" line="29"/>
<source>%1 version: %2</source>
<extracomment>%1 -&gt; application name %2 -&gt; version string</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DonateDialog</name>
<message>
<location filename="../qml/DonateDialog.qml" line="6"/>
<source>Donate</source>
<translation>Fazer uma doação</translation>
</message>
<message>
<location filename="../qml/DonateDialog.qml" line="14"/>
<source>The %1 service is expensive to run. Because we don&apos;t want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.
Do you want to donate now?</source>
<extracomment>donate dialog %1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../qml/LoginDialog.qml" line="7"/>
<source>Login</source>
<translation>Conectar</translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="11"/>
<source>Log in with your library credentials</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="15"/>
<source>patron id</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LoginDialog.qml" line="19"/>
<source>password</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../qml/main.qml" line="25"/>
<source>Could not find helpers. Check your installation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="27"/>
<source>Could not find polkit agent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="56"/>
<source>%1 off</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="59"/>
<source>%1 on</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="62"/>
<source>Connecting to %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="65"/>
<source>Stopping %1</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="68"/>
<source>%1 blocking internet</source>
<extracomment>%1 -&gt; application name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/main.qml" line="105"/>
<location filename="../qml/main.qml" line="151"/>
<source>Checking status...</source>
<translation>Verificando estado...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="158"/>
<source>Reconnect</source>
<translation>Reconectar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="160"/>
<source>Turn on</source>
<translation>Ligar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="171"/>
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="173"/>
<source>Turn off</source>
<translation>Desligar</translation>
</message>
<message>
<location filename="../qml/main.qml" line="184"/>
<source>Help...</source>
<translation>Ajuda...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="189"/>
<source>Donate...</source>
<translation>Fazer uma doação...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="195"/>
<source>About...</source>
<translation>Sobre...</translation>
</message>
<message>
<location filename="../qml/main.qml" line="202"/>
<source>Quit</source>
<translation>Sair</translation>
</message>
<message>
<location filename="../qml/main.qml" line="227"/>
<source>Error starting VPN</source>
<translation>Erro ao iniciar a VPN</translation>
</message>
<message>
<location filename="../qml/main.qml" line="237"/>
<source>Missing authentication agent</source>
<translation>Um agente de autenticação está faltando</translation>
</message>
<message>
<location filename="../qml/main.qml" line="238"/>
<source>Could not find a polkit authentication agent. Please run one and try again.</source>
<translation>Não foi possível encontrar um agente de autenticação polkit. Por favor, execute um agente e tente novamente.</translation>
</message>
<message>
<location filename="../qml/main.qml" line="246"/>
<source>Initialization Error</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <QApplication> #include <QApplication>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QTimer> #include <QTimer>
#include <QTranslator>
#include <QtQml> #include <QtQml>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QQuickWindow> #include <QQuickWindow>
...@@ -56,6 +57,10 @@ int main(int argc, char **argv) { ...@@ -56,6 +57,10 @@ int main(int argc, char **argv) {
if (!QSystemTrayIcon::isSystemTrayAvailable()) { if (!QSystemTrayIcon::isSystemTrayAvailable()) {
qDebug() << "No systray icon available. Things might not work for now, sorry..."; qDebug() << "No systray icon available. Things might not work for now, sorry...";
} }
QTranslator translator;
translator.load(QLocale(), QLatin1String("main"), QLatin1String("_"), QLatin1String(":/i18n"));
app.installTranslator(&translator);
app.setQuitOnLastWindowClosed(false); app.setQuitOnLastWindowClosed(false);
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
......
...@@ -11,6 +11,11 @@ MessageDialog { ...@@ -11,6 +11,11 @@ MessageDialog {
var _provider = ctx ? ctx.provider : "unknown" var _provider = ctx ? ctx.provider : "unknown"
var _donateURL= ctx ? ctx.donateURL : "..." var _donateURL= ctx ? ctx.donateURL : "..."
var _tosURL = ctx ? ctx.tosURL : "..." var _tosURL = ctx ? ctx.tosURL : "..."
//: about dialog
//: %1 -> application name
//: %2 -> provider name
//: %3 -> donation URL
//: %4 -> TOS URL
var _txt = qsTr( var _txt = qsTr(
"<p>%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.</p> <p>This service is paid for entirely by donations from users like you. <a href=\"%3\">Please donate</a>.</p> <p>By using this application, you agree to the <a href=\"%4\">Terms of Service</a>. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.</p>").arg(_name).arg(_provider).arg(_donateURL).arg(_tosURL) "<p>%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.</p> <p>This service is paid for entirely by donations from users like you. <a href=\"%3\">Please donate</a>.</p> <p>By using this application, you agree to the <a href=\"%4\">Terms of Service</a>. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.</p>").arg(_name).arg(_provider).arg(_donateURL).arg(_tosURL)
return _txt return _txt
...@@ -19,7 +24,9 @@ MessageDialog { ...@@ -19,7 +24,9 @@ MessageDialog {
function getVersion() { function getVersion() {
var _name = ctx ? ctx.appName : "vpn" var _name = ctx ? ctx.appName : "vpn"
var _ver = ctx ? ctx.version : "unknown" var _ver = ctx ? ctx.version : "unknown"
var _txt = "%1 version: %2".arg(_name).arg(_ver) //: %1 -> application name
//: %2 -> version string
var _txt = qsTr("%1 version: %2").arg(_name).arg(_ver)
return _txt return _txt
} }
} }
......
...@@ -9,6 +9,8 @@ MessageDialog { ...@@ -9,6 +9,8 @@ MessageDialog {
function getText() { function getText() {
var _name = ctx ? ctx.appName : "vpn" var _name = ctx ? ctx.appName : "vpn"
//: donate dialog
//: %1 -> application name
var _txt = qsTr( var _txt = qsTr(
"The %1 service is expensive to run. Because we don't want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.\n\nDo you want to donate now?").arg(_name) "The %1 service is expensive to run. Because we don't want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.\n\nDo you want to donate now?").arg(_name)
return _txt return _txt
......
...@@ -4,8 +4,8 @@ import QtQuick.Controls 1.4 ...@@ -4,8 +4,8 @@ import QtQuick.Controls 1.4
Dialog { Dialog {
standardButtons: StandardButton.Ok standardButtons: StandardButton.Ok
title: "Login Success" title: qsTr("Login Success")
text: "You are now logged in, connecting now" text: qsTr("You are now logged in, connecting now")
visible: ctxSystray.loginConfirmationDialog == true visible: ctxSystray.loginConfirmationDialog == true
} }
...@@ -4,19 +4,19 @@ import QtQuick.Controls 1.4 ...@@ -4,19 +4,19 @@ import QtQuick.Controls 1.4
Dialog { Dialog {
standardButtons: StandardButton.Ok standardButtons: StandardButton.Ok
title: "Login" title: qsTr("Login")
Column { Column {
anchors.fill: parent anchors.fill: parent
Text { Text {
text: "Log in with your library credentials" text: qsTr("Log in with your library credentials")
} }
TextField { TextField {
id: username id: username
placeholderText: "patron id" placeholderText: qsTr("patron id")
} }
TextField { TextField {
id: password id: password
placeholderText: "password" placeholderText: qsTr("password")
echoMode: TextInput.PasswordEchoOnEdit echoMode: TextInput.PasswordEchoOnEdit
} }
} }
......
...@@ -52,16 +52,20 @@ ApplicationWindow { ...@@ -52,16 +52,20 @@ ApplicationWindow {
function toHuman(st) { function toHuman(st) {
switch(st) { switch(st) {
case "off": case "off":
// TODO improve string interpolation, give context to translators etc //: %1 -> application name
return qsTr(ctx.appName + " off"); return qsTr("%1 off").arg(ctx.appName);
case "on": case "on":
return qsTr(ctx.appName + " on"); //: %1 -> application name
return qsTr("%1 on").arg(ctx.appName);
case "connecting": case "connecting":
return qsTr("Connecting to " + ctx.appName); //: %1 -> application name
return qsTr("Connecting to %1").arg(ctx.appName);
case "stopping": case "stopping":
return qsTr("Stopping " + ctx.appName); //: %1 -> application name
return qsTr("Stopping %1").arg(ctx.appName);
case "failed": case "failed":
return qsTr(ctx.appName + " blocking internet"); // TODO failed is not handed yet //: %1 -> application name
return qsTr("%1 blocking internet").arg(ctx.appName); // TODO failed is not handed yet
} }
} }
......
all: build generate_json
build:
go build
generate_json:
./transifex g2t ../../locales/en-US/out.gotext.json messages.json
package main
import (
"encoding/json"
"fmt"
"os"
"path"
"golang.org/x/text/message/pipeline"
)
const (
outGotext = "out.gotext.json"
messagesGotext = "messages.gotext.json"
)
type transifex map[string]string
func main() {
if len(os.Args) < 2 {
panic("g2t or t2g should be passed as argument")
}
switch os.Args[1] {
case "g2t":
g2t(func(m pipeline.Message) string { return m.Message.Msg })
case "lang2t":
g2t(func(m pipeline.Message) string { return m.Translation.Msg })
case "t2g":
t2g()
default:
panic("g2t or t2g should be passed as argument")
}
}
func g2t(getMessage func(pipeline.Message) string) {
if len(os.Args) < 4 {
panic(fmt.Sprintf("usage: %s g2t inFile outFile", os.Args[0]))
}
inF, err := os.Open(os.Args[2])
if err != nil {
panic(fmt.Sprintf("Can't open input file %s: %v", os.Args[2], err))
}
outF, err := os.Create(os.Args[3])
if err != nil {
panic(fmt.Sprintf("Can't open output file %s: %v", os.Args[3], err))
}
toTransifex(inF, outF, getMessage)
}
func t2g() {
if len(os.Args) < 3 {
panic(fmt.Sprintf("usage: %s t2g localeFolder", os.Args[0]))
}
origF, err := os.Open(path.Join(os.Args[2], outGotext))
if err != nil {
panic(fmt.Sprintf("Can't open file %s/%s: %v", os.Args[3], outGotext, err))
}
outF, err := os.Create(path.Join(os.Args[2], messagesGotext))
if err != nil {
panic(fmt.Sprintf("Can't open output file %s/%v: %v", os.Args[3], messagesGotext, err))
}
toGotext(origF, os.Stdin, outF)
}
func toTransifex(inF, outF *os.File, getMessage func(pipeline.Message) string) {
messages := pipeline.Messages{}
dec := json.NewDecoder(inF)
err := dec.Decode(&messages)
if err != nil {
panic(fmt.Sprintf("An error ocurred decoding json: %v", err))
}
transfx := make(transifex)
for _, m := range messages.Messages {
transfx[m.ID[0]] = getMessage(m)
}
enc := json.NewEncoder(outF)
enc.SetIndent("", " ")
err = enc.Encode(transfx)
if err != nil {
panic(fmt.Sprintf("An error ocurred encoding json: %v", err))
}
}
func toGotext(origF, inF, outF *os.File) {
transfx := make(transifex)
dec := json.NewDecoder(inF)
err := dec.Decode(&transfx)
if err != nil {
panic(fmt.Sprintf("An error ocurred decoding json: %v", err))
}
messages := pipeline.Messages{}
dec = json.NewDecoder(origF)
err = dec.Decode(&messages)
if err != nil {
panic(fmt.Sprintf("An error ocurred decoding orig json: %v", err))
}
for k, v := range transfx {
found := false
for i, m := range messages.Messages {
if m.ID[0] == k {
messages.Messages[i].Translation.Msg = v
found = true
break
}
}
if !found {
fmt.Printf("The original document doesn't have id: %s\n", k)
}
}
enc := json.NewEncoder(outF)
enc.SetIndent("", " ")
err = enc.Encode(messages)
if err != nil {
panic(fmt.Sprintf("An error ocurred encoding json: %v", err))
}
}
{
"About": "About",
"About...": "About...",
"Cancel": "Cancel",
"Checking status...": "Checking status...",
"Connecting to {ApplicationName}": "Connecting to {ApplicationName}",
"Donate": "Donate",
"Donate...": "Donate...",
"Error starting VPN": "Error starting VPN",
"Help...": "Help...",
"Initialization error": "Initialization error",
"Missing authentication agent": "Missing authentication agent",
"Quit": "Quit",
"Reconnect": "Reconnect",
"Route traffic through:": "Route traffic through:",
"Stopping {ApplicationName}": "Stopping {ApplicationName}",
"Turn off": "Turn off",
"Turn on": "Turn on",
"Use {ApplicationName} {City} gateway": "Use {ApplicationName} {City} gateway",
"aboutText": "{ApplicationName} is an easy, fast, and secure VPN service from {Provider}. {ApplicationName} does not require a user account, keep logs, or track you in any way.\n\t \nThis service is paid for entirely by donations from users like you. Please donate at {DonateURL}.\n\t\t\nBy using this application, you agree to the Terms of Service available at {TosURL}. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.\n\n\n{ApplicationName_1} version: {Version}",
"donationText": "The {ApplicationName} service is expensive to run. Because we don't want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.\n\t\nDo you want to donate now?",
"errorMsg": "An error has ocurred initializing the VPN: {Err}",
"errorStartingVPN": "Can't connect to {ApplicationName}: {Err}",
"missingAuthAgent": "Could not find a polkit authentication agent. Please run one and try again.",
"{ApplicationName} blocking internet": "{ApplicationName} blocking internet",
"{ApplicationName} off": "{ApplicationName} off",
"{ApplicationName} on": "{ApplicationName} on"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment