From d10a8327663df5410508c2998486d7a1ba5e056e Mon Sep 17 00:00:00 2001 From: Zdenek Jonak Date: Sun, 29 May 2016 18:14:49 +0200 Subject: [PATCH] Localization support and localization --- application/translations/prodejna_cs_CZ.qm | Bin 272 -> 560 bytes application/translations/prodejna_cz.ts | 8 +- commodity/commodity.cpp | 5 ++ commodity/commodity.h | 1 + commodity/commodity.json | 13 +++- commodity/commodity.pro | 1 + commodity/commodityrc.qrc | 1 + commodity/translations/commodity_cs_CZ.qm | Bin 0 -> 941 bytes core/context.cpp | 2 +- core/translations/core_cs_CZ.qm | Bin 3826 -> 4357 bytes core/translations/core_cs_CZ.ts | 85 ++++++++++++++------- services/service.json | 13 +++- services/services.cpp | 5 +- services/services.h | 1 + services/services.pro | 1 + services/servicesrc.qrc | 1 + services/translations/services_cs_CZ.qm | Bin 0 -> 1008 bytes shop/shop.cpp | 5 ++ shop/shop.h | 1 + shop/shop.json | 28 ++++++- shop/shop.pro | 1 + shop/shoprc.qrc | 1 + shop/translations/shop_cs_CZ.qm | Bin 0 -> 2322 bytes 23 files changed, 138 insertions(+), 35 deletions(-) create mode 100644 commodity/translations/commodity_cs_CZ.qm create mode 100644 services/translations/services_cs_CZ.qm create mode 100644 shop/translations/shop_cs_CZ.qm diff --git a/application/translations/prodejna_cs_CZ.qm b/application/translations/prodejna_cs_CZ.qm index 9d707a849a513c51f858f2ea3b88c881a834b462..ff3af12a1711b42ac8ffc3bef8e6739b11f5ffc3 100644 GIT binary patch delta 296 zcmbQhw1H)Uh^qqw%Xt1P9C7T1c*5_TYi%QrDI zFFZ3ZCBJ;)EE7XHh5*J$hD?SGh8%{648=fJ34;QVPG!&oLAZVnpZxU9JUuxN&&jO1c;M>22}wKLN!3ZzaTYFAtkXSF)6V)6>N~2-dlwE Z!Ko!BnR)5OXl`We0C|9s@jnX_3jkmyKjQ!Z delta 66 zcmdnMGJ$D=h^hhu%LP>i28Kk2;Mjjant}OtaXOHiz_IG_6Ckah2_z;)rcHdKKRJQX QoVx?aWn*Og&%(q405XpdTmS$7 diff --git a/application/translations/prodejna_cz.ts b/application/translations/prodejna_cz.ts index 907c49f..cc1072e 100644 --- a/application/translations/prodejna_cz.ts +++ b/application/translations/prodejna_cz.ts @@ -30,23 +30,23 @@ Exit - + Konec Open database... - + Otevřít databázi... Login... - + Přihlásit se... Settings - + Nastavení diff --git a/commodity/commodity.cpp b/commodity/commodity.cpp index 8748662..cd0622f 100644 --- a/commodity/commodity.cpp +++ b/commodity/commodity.cpp @@ -23,3 +23,8 @@ QIcon Commodity::pluginIcon() { return QIcon(":/icons/commodityPlugin.svg"); } + +QTranslator *Commodity::translator() +{ + return translatorFrom(":/translations/commodity_"); +} diff --git a/commodity/commodity.h b/commodity/commodity.h index d10167e..04b840f 100644 --- a/commodity/commodity.h +++ b/commodity/commodity.h @@ -22,6 +22,7 @@ protected: // IPlugin interface public: virtual QIcon pluginIcon(); + QTranslator *translator(); }; diff --git a/commodity/commodity.json b/commodity/commodity.json index 4c5ab93..16e6e92 100644 --- a/commodity/commodity.json +++ b/commodity/commodity.json @@ -29,5 +29,16 @@ CREATE TABLE \"CommodityData\" ( DEFERRABLE INITIALLY DEFERRED);" ], - "dependencies" : [] + "dependencies" : [], + "translations" : { + "CZ" : { + "name" : "Název", + "shortName" : "Zobrazit na účtence", + "code" : "Kód", + "type" : "Druh", + "price" : "Cena", + "vat" : "DPH", + "count" : "Počet" + } + } } diff --git a/commodity/commodity.pro b/commodity/commodity.pro index 37e126e..0ca4f0b 100644 --- a/commodity/commodity.pro +++ b/commodity/commodity.pro @@ -72,3 +72,4 @@ FORMS += \ RESOURCES += \ commodityrc.qrc +TRANSLATIONS = translations/commodity_cs_CZ.ts diff --git a/commodity/commodityrc.qrc b/commodity/commodityrc.qrc index 76f76ad..a3b1718 100644 --- a/commodity/commodityrc.qrc +++ b/commodity/commodityrc.qrc @@ -1,5 +1,6 @@ icons/commodityPlugin.svg + translations/commodity_cs_CZ.qm diff --git a/commodity/translations/commodity_cs_CZ.qm b/commodity/translations/commodity_cs_CZ.qm new file mode 100644 index 0000000000000000000000000000000000000000..b5898fc0a632df3bd45ef372e61e7a98f8c3e78c GIT binary patch literal 941 zcmaJnt&4sV@o9&bgS*f7eed)6{(9fJ1OLg%<+t9C$)`uF zJBR(}0N(S>0Cty{CGG=nJ`*btdwcW&;@1~`cW=->hq(OB^G`VW8NhPkloyDzaE=4& zrtxB9iT|gt^0i0*TH??5PsE<<`8E10W3|&|p8Fw?c$A>W#Y_B!pQK5f`Et?^9?%%i z$!1gfp=vM6xM>ZzDHI{CaRgAB@8slGqzr-y3Sw*{!Ua6E255CCk8q{~JX{RpmhxW7 zcR_3jlfrA%n7M-sEfa&P4E!|8XfvI}+k1&bK3s1Y6e$#Nh7T-l`z}MF+B8nW`bfV2 zUn8O*BNIP~+_3Gcj_wrWux_GHV4ic^LW4<6b4!H1h9%Vz=%P}khK!XrqVeQyWm+Sa+MA|6T(XPEYi^=kHLZ$`jHX$c!8JYB3s?%2 g3ZwOwUPK$&J92gu`HGLG>YXu!?lP-uSy#dq*IC=gz5oCK literal 0 HcmV?d00001 diff --git a/core/context.cpp b/core/context.cpp index 961933b..9d6042a 100644 --- a/core/context.cpp +++ b/core/context.cpp @@ -50,7 +50,7 @@ void Context::loadPlugins() m_plugins.append(new Users); m_plugins.append(new Roles); - QDir pluginsDir(qApp->applicationDirPath() + "/../../plugins"); + QDir pluginsDir(qApp->applicationDirPath() + "/../plugins"); foreach (QString fileName, pluginsDir.entryList(QStringList() << "*.so" << "*.dll")) { QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName)); diff --git a/core/translations/core_cs_CZ.qm b/core/translations/core_cs_CZ.qm index a5f896d15b051ce03503a058906edb68ebecd696..f3dead6e3be3982a9afd6aaa82337bfadfed49f8 100644 GIT binary patch delta 892 zcmZvaYe*Df6o${ZbKBXO-3%gg4OR;&h$v(wB`PCzlQ2uOq9R>)(6x0pX4Wg=LL_t{ zx-51>LQ^QptlWq~q%`Y?5*VRKP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ba databáze + + + + Permission denied + Nedostatečná oprávnění + + ColumnDialog @@ -97,7 +110,7 @@ TextLabel - + @@ -118,58 +131,78 @@ Informace o společnosti - + IC IČO - + VAT number DIČ - + VAT payer Plátce DPH - + + VAT rates + Sazby DPH + + + + High + Vysoká + + + + First lower + První snížená + + + + Second lower + Druhá snížená + + + Contact Kontaktní údaje - + Firm Name Název společnosti - + Street Ulice - + House Number Číslo popisné - + City Město - + ZIP code PSČ - - + + Logo Logo - + Select file Vyber soubor @@ -192,59 +225,59 @@ - + Edit record Upravit záznam - + E - - + + Delete record Smazat záznam - + D - + Filter Filtr - + F - + Print Tisk - + P - + Select columns Vybrat sloupce - - + + Database error Chyba databáze - + Realy delete this record? Opravdu si přejete smazat tento záznam? diff --git a/services/service.json b/services/service.json index ebdabf0..8847b23 100644 --- a/services/service.json +++ b/services/service.json @@ -21,5 +21,16 @@ \"vatType\" INTEGER NOT NULL);" ], - "dependencies" : [] + "dependencies" : [], + "translations" : { + "CZ" : { + "accServiceName" : "Název", + "accServiceCode" : "Kód", + "price" : "Cena", + "active" : "Aktivní", + "salePossible" : "Umožnit slevu", + "serviceType" : "Druh", + "vatType" : "DPH" + } + } } diff --git a/services/services.cpp b/services/services.cpp index 7458acc..d5334e1 100644 --- a/services/services.cpp +++ b/services/services.cpp @@ -23,4 +23,7 @@ QIcon Services::pluginIcon() { return QIcon(":icons/servicesPlugin.svg"); } - +QTranslator *Services::translator() +{ + return translatorFrom(":/translations/services_"); +} diff --git a/services/services.h b/services/services.h index 12f73cf..a32e023 100644 --- a/services/services.h +++ b/services/services.h @@ -23,6 +23,7 @@ protected: // IPlugin interface public: virtual QIcon pluginIcon(); + QTranslator *translator(); }; #endif // SERVICES_H diff --git a/services/services.pro b/services/services.pro index 1ca5d8c..f43f633 100644 --- a/services/services.pro +++ b/services/services.pro @@ -73,3 +73,4 @@ DEPENDPATH += $$PWD/../qdecimal/src RESOURCES += \ servicesrc.qrc +TRANSLATIONS = translations/services_cs_CZ.ts diff --git a/services/servicesrc.qrc b/services/servicesrc.qrc index 34a1378..184a94a 100644 --- a/services/servicesrc.qrc +++ b/services/servicesrc.qrc @@ -1,5 +1,6 @@ icons/servicesPlugin.svg + translations/services_cs_CZ.qm diff --git a/services/translations/services_cs_CZ.qm b/services/translations/services_cs_CZ.qm new file mode 100644 index 0000000000000000000000000000000000000000..533b8e99c0e7cee69845ba7d100206e16afa6de5 GIT binary patch literal 1008 zcmaKry>HV{6vdC7mtwVsN(_ir3})sJVCfRlM&UzggiTm+?5EbM<5xLON+Upsi2>-; ztxJ*E7%FvPL9lcIu_6W-x`0}#>d=h^j?>DmRJ{z=mF4@p=iYO#XFh~izZ`C?f4hF| z)1%Fgzit6|4BURfcoX9LYsPJe!yk;lQEtrv#uUo$J;3|}@6}tr-@(JRb;jqV{jcPV zzhbbp!+eZ6VVhyek~{B!(iMAehI!@_d+#T|o7Kr1ZzS`#CO^lF=61v+w?yI+Dp*2> z2z?|tu!hC*f|VeP`tm}aQV9ZAru`_8HI;UZW2^;*0kIGcM+l|`sh)T0uM-Ph}Q@0M=m4Qma(fb%jgCz!e6GaOIhX>;{{EoH*3nv|% z$Gp{LEjEU`I6_!J6DL|#6>1raHDJbE|B-6Qkndv@9;(^hdSsre^0IimvIlBH{ M=D&_%{1c}554_0QB>(^b literal 0 HcmV?d00001 diff --git a/shop/shop.cpp b/shop/shop.cpp index 50516d9..98c0668 100644 --- a/shop/shop.cpp +++ b/shop/shop.cpp @@ -18,3 +18,8 @@ QIcon Shop::pluginIcon() { return QIcon(":/icons/shop.svg"); } + +QTranslator *Shop::translator() +{ + return translatorFrom(":/translations/shop_"); +} diff --git a/shop/shop.h b/shop/shop.h index bfd1efc..b69ce3d 100644 --- a/shop/shop.h +++ b/shop/shop.h @@ -22,6 +22,7 @@ protected: // IPlugin interface public: virtual QIcon pluginIcon(); + QTranslator *translator(); }; #endif // SHOP_H diff --git a/shop/shop.json b/shop/shop.json index 6bab111..101255d 100644 --- a/shop/shop.json +++ b/shop/shop.json @@ -65,5 +65,31 @@ CREATE INDEX \"Voucher_items_index_i\" ON \"Voucher_items\" (\"index\"); " ], - "dependencies" : [ "ADDRESSBOOK" ] + "dependencies" : [ "ADDRESSBOOK" ], + "translations" : { + "CZ" : { + "name" : "Název", + "count" : "Počet", + "unitPrice" : "Jednotková cena", + "vatRate" : "Procento DPH", + "priceWitouthVat" : "Cena bez DPH", + "price" : "Cena", + "vatType" : "Sazba DPH", + "description" : "Popis", + "contact" : "Kontakt", + "vatRateHigh" : "Vysoká sazba", + "vatRateFirstLower" : "První snížená sazba", + "vatRateSecondLower" : "Druhá snížená sazba", + "priceNoVat" : "Cena zboží s nulovou DPH", + "priceVatHigh" : "Cena zboží s vysokou sazbou DPH", + "priceVatFirstLower" : "Cena zboží s první sníženou sazbou DPH", + "priceVatSecondLower" : "Cena zboží s druhou sníženou sazbou DPH", + "priceWitouthVat" : "Cena zboží bez DPH", + "totalPriceVatHigh" : "Celková cena zboží s vysokou sazbou DPH", + "totalPriceVatFirstLower" : "Celková cena zboží s první sníženou sazbou DPH", + "totalPriceVatSecondLower" : "Celková cena zboží s druhou sníženou sazbou DPH", + "totalPrice" : "Celková cena", + "status" : "Stav" + } + } } diff --git a/shop/shop.pro b/shop/shop.pro index 75cbb3a..588b70b 100644 --- a/shop/shop.pro +++ b/shop/shop.pro @@ -90,3 +90,4 @@ FORMS += \ receiptsaveform.ui \ receiptloadform.ui +TRANSLATIONS = translations/shop_cs_CZ.ts diff --git a/shop/shoprc.qrc b/shop/shoprc.qrc index f5d0ec4..2961e1c 100644 --- a/shop/shoprc.qrc +++ b/shop/shoprc.qrc @@ -1,5 +1,6 @@ icons/shop.svg + translations/shop_cs_CZ.qm diff --git a/shop/translations/shop_cs_CZ.qm b/shop/translations/shop_cs_CZ.qm new file mode 100644 index 0000000000000000000000000000000000000000..4ea69b9acbe1b1e9c1958651c2ee67d8b5770871 GIT binary patch literal 2322 zcmbVNO^6$17=C6mGs$MRsd|vK79GKZsFZ^Cvg)Btwyw2Zf{9!8AkJon>~tsj!en-B z3ijY0To3CHQYf?sJ$X>-NzsESh!>@ZNQ(*{dQfO#SuFM7qSj|-vfoUyGpiU#KJv}` zyzlcq@6SB;iBF)Z z|Gz>z==1rv&}I$-xy#VzritGJ?c7&@{sNA=4ca{#o!UL9eNX|$9>9q=&eHCv(wKjn zxJPo=zj=lKPpi|LKQiuy`u^)T>Gvu1!<7@XM|9?j(V5R{D}T^`{#ot(>N!3?ADwDm z`}n<0#=WB5`2822Yr0|0Gk#ldt!ecCW#Q8=?&JMKW5Xvq>eF@bnVyWY2A@-sM56kFa9R_;AshlCcgR9cR z#1Y5q`NlEvlI>;rDdKs|Gxiy*OPm_;$^uMc4t)j`SWJXcXPnkT7Nn@WOku1cZtAS) zWXe%MB}~PXl(d@XG&Ak@qDnEAu)r``VocWUrs!BZt8oYFFj>NR{u*>z!;GX*m^;)k zJkw8Saf=^ms#hJ;6|F#z-A~(1+v)npglWlgm*`l)4P{?MU*fbUeY@S;0rnGn#1ExO z!U}^J*~m%EFr3XAn28S4>$d4N!?LB)EQU0@aL|(!C#rU@=`kTkbdp5t=JKGO|4oV5 zlJeY-n(`b2gv2QMBEKi$upJH7Gg2sM>T8m~?bD~6p6_&8Mq1WG&dYda;KHG52Hglw zjKGp~R(Qe_OWnibRC+2Tm^Rev)+leOHWc+gYdwTA!m(P2s}zbM$k}Jj786z59aYV! zh>mYI{h^}AE{Ce190>9&)E7io_Tat|<-3WFObB$yvW%cBw>wDN9OH7`rP=Sa;}YbC zsOuHqb04g3cUKPiucM8>C{>s9FW5ykPRim=M2pr4Hth(0D1=;h2@aHNlIz^$ysdND z#ameo26@CAjc?-`HOaya28{h219CO9zumrsX`ZuG*S6k literal 0 HcmV?d00001