path: root/image
diff options
authorMichal Labedzki <michal.labedzki@tieto.com>2013-12-21 17:55:43 +0100
committerMichal Labedzki <michal.labedzki@tieto.com>2014-11-04 08:21:55 +0000
commit5025bc258cdeabbd498919d5c6b4554accdad842 (patch)
tree53301fcaa347e0a933086ce102b56b27e13aeee9 /image
parent15e78de432f55f5478f1b3994f3d7e060b60508d (diff)
Qt: Dynamic languages
- get language as soon as possible (before creating any Qt objects) to make all translations working - dynamic list of supported languages - runtime change of GUI language (no need to restart application) - add flags icons support - search for *.qm languages in buildin resources, then data dir called "languages" (main directory in sources or /usr/share/wireshark/languages), then user directory (UNIX: ~/.wireshark/languages); "languages" directory should contains files wireshark_xx.qm where xx is language code (en, en_GB, etc.), and optional xx.svg for flag icon - try to fix some untranslated manually-created UI items (need manual reset text of those components) Change-Id: I62ca8a8cddce47cec9dbcad6b0bd68b6cfd92229 Reviewed-on: https://code.wireshark.org/review/5041 Tested-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'image')
8 files changed, 64 insertions, 0 deletions
diff --git a/image/languages/de.svg b/image/languages/de.svg
new file mode 100644
index 0000000000..21d26c1057
--- /dev/null
+++ b/image/languages/de.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="600" viewBox="0 0 50 30">
+ <desc>Flag of Germany</desc>
+ <rect id="black_stripe" width="50" height="30" y="0" x="0" fill="#000"/>
+ <rect id="red_stripe" width="50" height="20" y="10" x="0" fill="#D00"/>
+ <rect id="gold_stripe" width="50" height="10" y="20" x="0" fill="#FFCE00"/>
diff --git a/image/languages/en.svg b/image/languages/en.svg
new file mode 100644
index 0000000000..36c9889743
--- /dev/null
+++ b/image/languages/en.svg
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30" width="1200" height="600">
+<clipPath id="t">
+ <path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/>
+<path d="M0,0 v30 h60 v-30 z" fill="#00247d"/>
+<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
+<path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(#t)" stroke="#cf142b" stroke-width="4"/>
+<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
+<path d="M30,0 v30 M0,15 h60" stroke="#cf142b" stroke-width="6"/>
diff --git a/image/languages/fr.svg b/image/languages/fr.svg
new file mode 100644
index 0000000000..a4bdfc9314
--- /dev/null
+++ b/image/languages/fr.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1000" height="700" viewBox="0 0 30 21">
+<rect width="30" height="21" fill="#ED2939"/>
+<rect width="20" height="21" fill="#fff"/>
+<rect width="10" height="21" fill="#002395"/>
+</svg> \ No newline at end of file
diff --git a/image/languages/it.svg b/image/languages/it.svg
new file mode 100644
index 0000000000..3ac830a963
--- /dev/null
+++ b/image/languages/it.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="1500" height="1000" viewBox="0 0 30 20">
+<rect width="10" height="20" fill="#009246"/>
+<rect width="10" height="20" x="10" fill="#fff"/>
+<rect width="10" height="20" x="20" fill="#ce2b37"/>
diff --git a/image/languages/ja_JP.svg b/image/languages/ja_JP.svg
new file mode 100644
index 0000000000..31a29c7fdb
--- /dev/null
+++ b/image/languages/ja_JP.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600">
+<rect fill="#a0a0a0" height="600" width="900"/>
+<rect fill="#fff" x="6" y="6" width="888" height="588"/>
+<circle fill="#be0026" cx="450" cy="300" r="180"/>
+</svg> \ No newline at end of file
diff --git a/image/languages/languages.qrc b/image/languages/languages.qrc
new file mode 100644
index 0000000000..3ceca22450
--- /dev/null
+++ b/image/languages/languages.qrc
@@ -0,0 +1,11 @@
+ <qresource prefix="/languages">
+ <file>de.svg</file>
+ <file>en.svg</file>
+ <file>fr.svg</file>
+ <file>it.svg</file>
+ <file>ja_JP.svg</file>
+ <file>pl.svg</file>
+ <file>zh_CN.svg</file>
+ </qresource>
diff --git a/image/languages/pl.svg b/image/languages/pl.svg
new file mode 100644
index 0000000000..909cb7230f
--- /dev/null
+++ b/image/languages/pl.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="1280" height="800" id="Flag of Poland" viewBox="0 0 16 10"><rect width="16" height="10" fill="#fff"/><rect width="16" height="5" fill="#dc143c" y="5"/></svg>
diff --git a/image/languages/zh_CN.svg b/image/languages/zh_CN.svg
new file mode 100644
index 0000000000..287704c693
--- /dev/null
+++ b/image/languages/zh_CN.svg
@@ -0,0 +1,15 @@
+<?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 xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="1500" height="1000" viewBox="-5 -5 30 20">
+<title>Flag of the People's Republic of China</title>
+<rect fill="#de2910" x="-5" y="-5" width="30" height="20"/>
+<polygon id="s" points="0,-513674 301930,415571 -488533,-158734 488533,-158734 -301930,415571"
+fill="#ffde00" transform="scale(0.0000019467600073)"/>
+<use xlink:href="#s" transform="scale(3)"/>
+<use xlink:href="#s" transform="translate(5,-3) rotate(-120.963756)"/>
+<use xlink:href="#s" transform="translate(7,-1) rotate(-98.130102)"/>
+<use xlink:href="#s" transform="translate(7,2) rotate(-74.054604)"/>
+<use xlink:href="#s" transform="translate(5,4) rotate(-51.3401917)"/>