Google Language Translator - Version 5.0.05

Version Description

Download this release

Release Info

Developer rm2773
Plugin Icon wp plugin Google Language Translator
Version 5.0.05
Comparing to
See all releases

Code changes from version 5.0.04 to 5.0.05

css/style.css CHANGED
@@ -3,6 +3,13 @@
3
  display:none !important;
4
  }
5
 
 
 
 
 
 
 
 
6
  select.goog-te-combo {
7
  width:143px !important;
8
  background:#fff;
@@ -310,6 +317,19 @@ code {
310
  background:url('../images/flags22.png') -146px -61px no-repeat;
311
  }
312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  #flags.size22 a[title="Esperanto"],
314
  .tool-container .tool-items a[title="Esperanto"] {
315
  background:url('../images/flags22.png') -1px -90px no-repeat;
@@ -535,6 +555,10 @@ code {
535
  background:url('../images/flags22.png') -117px -264px no-repeat;
536
  }
537
 
 
 
 
 
538
  #flags.size22 a[title="Punjabi"],
539
  .tool-container .tool-items a[title="Punjabi"] {
540
  background:url('../images/flags22.png') -146px -264px no-repeat;
@@ -585,6 +609,10 @@ code {
585
  background:url('../images/flags22.png') -1px -322px no-repeat;
586
  }
587
 
 
 
 
 
588
  #flags.size22 a[title="Sundanese"],
589
  .tool-container .tool-items a[title="Sundanese"] {
590
  background:url('../images/flags22.png') -146px -380px no-repeat;
@@ -635,11 +663,6 @@ code {
635
  background:url('../images/flags22.png') -59px -438px no-repeat;
636
  }
637
 
638
- #flags.size22 a[title="English"],
639
- .tool-container .tool-items a[title="English"] {
640
- background:url('../images/flags22.png') -88px -351px no-repeat;
641
- }
642
-
643
  #flags.size22 a[title="Urdu"],
644
  .tool-container .tool-items a[title="Urdu"] {
645
  background:url('../images/flags22.png') -146px -351px no-repeat;
@@ -767,6 +790,19 @@ code {
767
  background:url('../images/flags18.png') -147px -62px no-repeat;
768
  }
769
 
 
 
 
 
 
 
 
 
 
 
 
 
 
770
  #flags.size18 a[title="Esperanto"],
771
  .tool-container .tool-items a[title="Esperanto"] {
772
  background:url('../images/flags18.png') -2px -91px no-repeat;
@@ -992,6 +1028,10 @@ code {
992
  background:url('../images/flags18.png') -118px -265px no-repeat;
993
  }
994
 
 
 
 
 
995
  #flags.size18 a[title="Punjabi"],
996
  .tool-container .tool-items a[title="Punjabi"] {
997
  background:url('../images/flags18.png') -147px -265px no-repeat;
@@ -1042,6 +1082,10 @@ code {
1042
  background:url('../images/flags18.png') -2px -323px no-repeat;
1043
  }
1044
 
 
 
 
 
1045
  #flags.size18 a[title="Sundanese"],
1046
  .tool-container .tool-items a[title="Sundanese"] {
1047
  background:url('../images/flags18.png') -147px -381px no-repeat;
@@ -1087,11 +1131,6 @@ code {
1087
  background:url('../images/flags18.png') -60px -352px no-repeat;
1088
  }
1089
 
1090
- #flags.size18 a[title="English"],
1091
- .tool-container .tool-items a[title="English"] {
1092
- background:url('../images/flags18.png') -89px -352px no-repeat;
1093
- }
1094
-
1095
  #flags.size18 a[title="Urdu"],
1096
  .tool-container .tool-items a[title="Urdu"] {
1097
  background:url('../images/flags18.png') -147px -352px no-repeat;
@@ -1224,6 +1263,19 @@ code {
1224
  background:url('../images/flags20.png') -147px -62px no-repeat;
1225
  }
1226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1227
  #flags.size20 a[title="Esperanto"],
1228
  .tool-container .tool-items a[title="Esperanto"] {
1229
  background:url('../images/flags20.png') -2px -91px no-repeat;
@@ -1449,6 +1501,10 @@ code {
1449
  background:url('../images/flags20.png') -118px -265px no-repeat;
1450
  }
1451
 
 
 
 
 
1452
  #flags.size20 a[title="Punjabi"],
1453
  .tool-container .tool-items a[title="Punjabi"] {
1454
  background:url('../images/flags20.png') -147px -265px no-repeat;
@@ -1499,6 +1555,10 @@ code {
1499
  background:url('../images/flags20.png') -2px -323px no-repeat;
1500
  }
1501
 
 
 
 
 
1502
  #flags.size20 a[title="Sundanese"],
1503
  .tool-container .tool-items a[title="Sundanese"] {
1504
  background:url('../images/flags20.png') -147px -381px no-repeat;
@@ -1544,11 +1604,6 @@ code {
1544
  background:url('../images/flags20.png') -60px -352px no-repeat;
1545
  }
1546
 
1547
- #flags.size20 a[title="English"],
1548
- .tool-container .tool-items a[title="English"] {
1549
- background:url('../images/flags20.png') -89px -352px no-repeat;
1550
- }
1551
-
1552
  #flags.size20 a[title="Urdu"],
1553
  .tool-container .tool-items a[title="Urdu"] {
1554
  background:url('../images/flags20.png') -147px -352px no-repeat;
@@ -1681,6 +1736,19 @@ code {
1681
  background:url('../images/flags16.png') -149px -63px no-repeat;
1682
  }
1683
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1684
  #flags.size16 a[title="Esperanto"],
1685
  .tool-container .tool-items a[title="Esperanto"] {
1686
  background:url('../images/flags16.png') -4px -92px no-repeat;
@@ -1906,6 +1974,10 @@ code {
1906
  background:url('../images/flags16.png') -120px -266px no-repeat;
1907
  }
1908
 
 
 
 
 
1909
  #flags.size16 a[title="Punjabi"],
1910
  .tool-container .tool-items a[title="Punjabi"] {
1911
  background:url('../images/flags16.png') -149px -266px no-repeat;
@@ -1956,6 +2028,10 @@ code {
1956
  background:url('../images/flags16.png') -4px -324px no-repeat;
1957
  }
1958
 
 
 
 
 
1959
  #flags.size16 a[title="Swahili"],
1960
  .tool-container .tool-items a[title="Swahili"] {
1961
  background:url('../images/flags16.png') -33px -324px no-repeat;
@@ -2001,11 +2077,6 @@ code {
2001
  background:url('../images/flags16.png') -62px -353px no-repeat;
2002
  }
2003
 
2004
- #flags.size16 a[title="English"],
2005
- .tool-container .tool-items a[title="English"] {
2006
- background:url('../images/flags16.png') -91px -353px no-repeat;
2007
- }
2008
-
2009
  #flags.size16 a[title="Urdu"],
2010
  .tool-container .tool-items a[title="Urdu"] {
2011
  background:url('../images/flags16.png') -149px -353px no-repeat;
@@ -2138,6 +2209,21 @@ code {
2138
  background:url('../images/flags.png') -145px -61px no-repeat;
2139
  }
2140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2141
  #flags.size24 a[title="Esperanto"],
2142
  .tool-container .tool-items a[title="Esperanto"] {
2143
  background:url('../images/flags.png') 0 -90px no-repeat;
@@ -2363,6 +2449,11 @@ code {
2363
  background:url('../images/flags.png') -116px -264px no-repeat;
2364
  }
2365
 
 
 
 
 
 
2366
  #flags.size24 a[title="Punjabi"],
2367
  .tool-container .tool-items a[title="Punjabi"] {
2368
  background:url('../images/flags.png') -145px -264px no-repeat;
@@ -2413,6 +2504,11 @@ code {
2413
  background:url('../images/flags.png') 0 -322px no-repeat;
2414
  }
2415
 
 
 
 
 
 
2416
  #flags.size24 a[title="Sundanese"],
2417
  .tool-container .tool-items a[title="Sundanese"] {
2418
  background:url('../images/flags.png') -145px -380px no-repeat;
@@ -2458,11 +2554,6 @@ code {
2458
  background:url('../images/flags.png') -58px -351px no-repeat;
2459
  }
2460
 
2461
- #flags.size24 a[title="English"],
2462
- .tool-container .tool-items a[title="English"] {
2463
- background:url('../images/flags.png') -87px -351px no-repeat;
2464
- }
2465
-
2466
  #flags.size24 a[title="Urdu"],
2467
  .tool-container .tool-items a[title="Urdu"] {
2468
  background:url('../images/flags.png') -145px -351px no-repeat;
3
  display:none !important;
4
  }
5
 
6
+ a.wp-studio-logo:focus,
7
+ a.wp-helpdesk-logo:focus {
8
+ box-shadow:none !important;
9
+ -webkit-box-shadow:none !important;
10
+ -moz-box-shadow:none !important;
11
+ }
12
+
13
  select.goog-te-combo {
14
  width:143px !important;
15
  background:#fff;
317
  background:url('../images/flags22.png') -146px -61px no-repeat;
318
  }
319
 
320
+ #flags.size22 a[title="English"],
321
+ .tool-container .tool-items a[title="English"] {
322
+ background:url('../images/flags22.png') -88px -351px no-repeat;
323
+ }
324
+
325
+ #flags.size22 a.united-states[title="English"] {
326
+ background:url('../images/flags22.png') -117px -351px no-repeat;
327
+ }
328
+
329
+ #flags.size22 a.canada[title="English"] {
330
+ background:url('../images/flags22.png') -88px -438px no-repeat;
331
+ }
332
+
333
  #flags.size22 a[title="Esperanto"],
334
  .tool-container .tool-items a[title="Esperanto"] {
335
  background:url('../images/flags22.png') -1px -90px no-repeat;
555
  background:url('../images/flags22.png') -117px -264px no-repeat;
556
  }
557
 
558
+ #flags.size22 a.brazil[title="Portuguese"] {
559
+ background:url('../images/flags22.png') -146px -438px no-repeat;
560
+ }
561
+
562
  #flags.size22 a[title="Punjabi"],
563
  .tool-container .tool-items a[title="Punjabi"] {
564
  background:url('../images/flags22.png') -146px -264px no-repeat;
609
  background:url('../images/flags22.png') -1px -322px no-repeat;
610
  }
611
 
612
+ #flags.size22 a.mexico[title="Spanish"] {
613
+ background:url('../images/flags22.png') -117px -438px no-repeat;
614
+ }
615
+
616
  #flags.size22 a[title="Sundanese"],
617
  .tool-container .tool-items a[title="Sundanese"] {
618
  background:url('../images/flags22.png') -146px -380px no-repeat;
663
  background:url('../images/flags22.png') -59px -438px no-repeat;
664
  }
665
 
 
 
 
 
 
666
  #flags.size22 a[title="Urdu"],
667
  .tool-container .tool-items a[title="Urdu"] {
668
  background:url('../images/flags22.png') -146px -351px no-repeat;
790
  background:url('../images/flags18.png') -147px -62px no-repeat;
791
  }
792
 
793
+ #flags.size18 a[title="English"],
794
+ .tool-container .tool-items a[title="English"] {
795
+ background:url('../images/flags18.png') -89px -352px no-repeat;
796
+ }
797
+
798
+ #flags.size18 a.united-states[title="English"] {
799
+ background:url('../images/flags18.png') -118px -352px no-repeat;
800
+ }
801
+
802
+ #flags.size18 a.canada[title="English"] {
803
+ background:url('../images/flags18.png') -89px -439px no-repeat;
804
+ }
805
+
806
  #flags.size18 a[title="Esperanto"],
807
  .tool-container .tool-items a[title="Esperanto"] {
808
  background:url('../images/flags18.png') -2px -91px no-repeat;
1028
  background:url('../images/flags18.png') -118px -265px no-repeat;
1029
  }
1030
 
1031
+ #flags.size18 a.brazil[title="Portuguese"] {
1032
+ background:url('../images/flags18.png') -147px -439px no-repeat;
1033
+ }
1034
+
1035
  #flags.size18 a[title="Punjabi"],
1036
  .tool-container .tool-items a[title="Punjabi"] {
1037
  background:url('../images/flags18.png') -147px -265px no-repeat;
1082
  background:url('../images/flags18.png') -2px -323px no-repeat;
1083
  }
1084
 
1085
+ #flags.size18 a.mexico[title="Spanish"] {
1086
+ background:url('../images/flags18.png') -118px -439px no-repeat;
1087
+ }
1088
+
1089
  #flags.size18 a[title="Sundanese"],
1090
  .tool-container .tool-items a[title="Sundanese"] {
1091
  background:url('../images/flags18.png') -147px -381px no-repeat;
1131
  background:url('../images/flags18.png') -60px -352px no-repeat;
1132
  }
1133
 
 
 
 
 
 
1134
  #flags.size18 a[title="Urdu"],
1135
  .tool-container .tool-items a[title="Urdu"] {
1136
  background:url('../images/flags18.png') -147px -352px no-repeat;
1263
  background:url('../images/flags20.png') -147px -62px no-repeat;
1264
  }
1265
 
1266
+ #flags.size20 a[title="English"],
1267
+ .tool-container .tool-items a[title="English"] {
1268
+ background:url('../images/flags20.png') -89px -352px no-repeat;
1269
+ }
1270
+
1271
+ #flags.size20 a.united-states[title="English"] {
1272
+ background:url('../images/flags20.png') -118px -352px no-repeat;
1273
+ }
1274
+
1275
+ #flags.size20 a.canada[title="English"] {
1276
+ background:url('../images/flags20.png') -89px -439px no-repeat;
1277
+ }
1278
+
1279
  #flags.size20 a[title="Esperanto"],
1280
  .tool-container .tool-items a[title="Esperanto"] {
1281
  background:url('../images/flags20.png') -2px -91px no-repeat;
1501
  background:url('../images/flags20.png') -118px -265px no-repeat;
1502
  }
1503
 
1504
+ #flags.size20 a.brazil[title="Portuguese"] {
1505
+ background:url('../images/flags20.png') -147px -439px no-repeat;
1506
+ }
1507
+
1508
  #flags.size20 a[title="Punjabi"],
1509
  .tool-container .tool-items a[title="Punjabi"] {
1510
  background:url('../images/flags20.png') -147px -265px no-repeat;
1555
  background:url('../images/flags20.png') -2px -323px no-repeat;
1556
  }
1557
 
1558
+ #flags.size20 a.mexico[title="Spanish"] {
1559
+ background:url('../images/flags20.png') -118px -439px no-repeat;
1560
+ }
1561
+
1562
  #flags.size20 a[title="Sundanese"],
1563
  .tool-container .tool-items a[title="Sundanese"] {
1564
  background:url('../images/flags20.png') -147px -381px no-repeat;
1604
  background:url('../images/flags20.png') -60px -352px no-repeat;
1605
  }
1606
 
 
 
 
 
 
1607
  #flags.size20 a[title="Urdu"],
1608
  .tool-container .tool-items a[title="Urdu"] {
1609
  background:url('../images/flags20.png') -147px -352px no-repeat;
1736
  background:url('../images/flags16.png') -149px -63px no-repeat;
1737
  }
1738
 
1739
+ #flags.size16 a[title="English"],
1740
+ .tool-container .tool-items a[title="English"] {
1741
+ background:url('../images/flags16.png') -91px -353px no-repeat;
1742
+ }
1743
+
1744
+ #flags.size16 a.united-states[title="English"] {
1745
+ background:url('../images/flags16.png') -120px -353px no-repeat;
1746
+ }
1747
+
1748
+ #flags.size16 a.canada[title="English"] {
1749
+ background:url('../images/flags16.png') -91px -440px no-repeat;
1750
+ }
1751
+
1752
  #flags.size16 a[title="Esperanto"],
1753
  .tool-container .tool-items a[title="Esperanto"] {
1754
  background:url('../images/flags16.png') -4px -92px no-repeat;
1974
  background:url('../images/flags16.png') -120px -266px no-repeat;
1975
  }
1976
 
1977
+ #flags.size16 a.brazil[title="Portuguese"] {
1978
+ background:url('../images/flags16.png') -149px -440px no-repeat;
1979
+ }
1980
+
1981
  #flags.size16 a[title="Punjabi"],
1982
  .tool-container .tool-items a[title="Punjabi"] {
1983
  background:url('../images/flags16.png') -149px -266px no-repeat;
2028
  background:url('../images/flags16.png') -4px -324px no-repeat;
2029
  }
2030
 
2031
+ #flags.size16 a.mexico[title="Spanish"] {
2032
+ background:url('../images/flags16.png') -120px -440px no-repeat;
2033
+ }
2034
+
2035
  #flags.size16 a[title="Swahili"],
2036
  .tool-container .tool-items a[title="Swahili"] {
2037
  background:url('../images/flags16.png') -33px -324px no-repeat;
2077
  background:url('../images/flags16.png') -62px -353px no-repeat;
2078
  }
2079
 
 
 
 
 
 
2080
  #flags.size16 a[title="Urdu"],
2081
  .tool-container .tool-items a[title="Urdu"] {
2082
  background:url('../images/flags16.png') -149px -353px no-repeat;
2209
  background:url('../images/flags.png') -145px -61px no-repeat;
2210
  }
2211
 
2212
+ #flags.size24 a[title="English"],
2213
+ .tool-container .tool-items a[title="English"] {
2214
+ background:url('../images/flags.png') -87px -351px no-repeat;
2215
+ }
2216
+
2217
+ #flags.size24 a.united-states[title="English"],
2218
+ .tool-container a.united-states[title="English"] {
2219
+ background:url('../images/flags.png') -116px -351px no-repeat !important;
2220
+ }
2221
+
2222
+ #flags.size24 a.canada[title="English"],
2223
+ .tool-container a.canada[title="English"] {
2224
+ background:url('../images/flags.png') -87px -438px no-repeat !important;
2225
+ }
2226
+
2227
  #flags.size24 a[title="Esperanto"],
2228
  .tool-container .tool-items a[title="Esperanto"] {
2229
  background:url('../images/flags.png') 0 -90px no-repeat;
2449
  background:url('../images/flags.png') -116px -264px no-repeat;
2450
  }
2451
 
2452
+ #flags.size24 a.brazil[title="Portuguese"],
2453
+ .tool-container a.brazil[title="Portuguese"] {
2454
+ background:url('../images/flags.png') -145px -438px no-repeat !important;
2455
+ }
2456
+
2457
  #flags.size24 a[title="Punjabi"],
2458
  .tool-container .tool-items a[title="Punjabi"] {
2459
  background:url('../images/flags.png') -145px -264px no-repeat;
2504
  background:url('../images/flags.png') 0 -322px no-repeat;
2505
  }
2506
 
2507
+ #flags.size24 a.mexico[title="Spanish"],
2508
+ .tool-container a.mexico[title="Spanish"] {
2509
+ background:url('../images/flags.png') -116px -438px no-repeat !important;
2510
+ }
2511
+
2512
  #flags.size24 a[title="Sundanese"],
2513
  .tool-container .tool-items a[title="Sundanese"] {
2514
  background:url('../images/flags.png') -145px -380px no-repeat;
2554
  background:url('../images/flags.png') -58px -351px no-repeat;
2555
  }
2556
 
 
 
 
 
 
2557
  #flags.size24 a[title="Urdu"],
2558
  .tool-container .tool-items a[title="Urdu"] {
2559
  background:url('../images/flags.png') -145px -351px no-repeat;
google-language-translator.php CHANGED
@@ -1,1148 +1,1306 @@
1
- <?php
2
- /*
3
- Plugin Name: Google Language Translator
4
- Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
- Version: 5.0.04
6
- Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
- Author: Rob Myrick
8
- Author URI: http://www.wp-studio.net/
9
- */
10
-
11
- include( plugin_dir_path( __FILE__ ) . 'widget.php');
12
-
13
- class google_language_translator {
14
-
15
- public $languages_array = array (
16
- 'af' => 'Afrikaans',
17
- 'sq' => 'Albanian',
18
- 'ar' => 'Arabic',
19
- 'hy' => 'Armenian',
20
- 'az' => 'Azerbaijani',
21
- 'eu' => 'Basque',
22
- 'be' => 'Belarusian',
23
- 'bn' => 'Bengali',
24
- 'bs' => 'Bosnian',
25
- 'bg' => 'Bulgarian',
26
- 'ca' => 'Catalan',
27
- 'ceb' => 'Cebuano',
28
- 'ny' => 'Chichewa',
29
- 'zh-CN' => 'Chinese',
30
- 'zh-TW' => 'Chinese(Traditional)',
31
- 'hr' => 'Croatian',
32
- 'cs' => 'Czech',
33
- 'da' => 'Danish',
34
- 'nl' => 'Dutch',
35
- 'en' => 'English',
36
- 'eo' => 'Esperanto',
37
- 'et' => 'Estonian',
38
- 'tl' => 'Filipino',
39
- 'fi' => 'Finnish',
40
- 'fr' => 'French',
41
- 'gl' => 'Galician',
42
- 'ka' => 'Georgian',
43
- 'de' => 'German',
44
- 'el' => 'Greek',
45
- 'gu' => 'Gujarati',
46
- 'ht' => 'Haitian',
47
- 'ha' => 'Hausa',
48
- 'iw' => 'Hebrew',
49
- 'hi' => 'Hindi',
50
- 'hmn' => 'Hmong',
51
- 'hu' => 'Hungarian',
52
- 'is' => 'Icelandic',
53
- 'ig' => 'Igbo',
54
- 'id' => 'Indonesian',
55
- 'ga' => 'Irish',
56
- 'it' => 'Italian',
57
- 'ja' => 'Japanese',
58
- 'jw' => 'Javanese',
59
- 'kn' => 'Kannada',
60
- 'kk' => 'Kazakh',
61
- 'km' => 'Khmer',
62
- 'ko' => 'Korean',
63
- 'lo' => 'Lao',
64
- 'la' => 'Latin',
65
- 'lv' => 'Latvian',
66
- 'lt' => 'Lithuanian',
67
- 'mk' => 'Macedonian',
68
- 'mg' => 'Malagasy',
69
- 'ms' => 'Malay',
70
- 'ml' => 'Malayalam',
71
- 'mt' => 'Maltese',
72
- 'mi' => 'Maori',
73
- 'mr' => 'Marathi',
74
- 'mn' => 'Mongolian',
75
- 'my' => 'Myanmar(Burmese)',
76
- 'ne' => 'Nepali',
77
- 'no' => 'Norwegian',
78
- 'fa' => 'Persian',
79
- 'pl' => 'Polish',
80
- 'pt' => 'Portuguese',
81
- 'pa' => 'Punjabi',
82
- 'ro' => 'Romanian',
83
- 'ru' => 'Russian',
84
- 'sr' => 'Serbian',
85
- 'st' => 'Sesotho',
86
- 'si' => 'Sinhala',
87
- 'sk' => 'Slovak',
88
- 'sl' => 'Slovenian',
89
- 'so' => 'Somali',
90
- 'es' => 'Spanish',
91
- 'su' => 'Sundanese',
92
- 'sw' => 'Swahili',
93
- 'sv' => 'Swedish',
94
- 'tg' => 'Tajik',
95
- 'ta' => 'Tamil',
96
- 'te' => 'Telugu',
97
- 'th' => 'Thai',
98
- 'tr' => 'Turkish',
99
- 'uk' => 'Ukranian',
100
- 'ur' => 'Urdu',
101
- 'uz' => 'Uzbek',
102
- 'vi' => 'Vietnamese',
103
- 'cy' => 'Welsh',
104
- 'yi' => 'Yiddish',
105
- 'yo' => 'Yoruba',
106
- 'zu' => 'Zulu'
107
- );
108
-
109
- public function __construct() {
110
- register_activation_hook( __FILE__, array( &$this, 'glt_activate' ));
111
- register_uninstall_hook( __FILE__, 'glt_deactivate' );
112
- add_action( 'admin_menu', array( &$this, 'add_my_admin_menus'));
113
- add_action('admin_init',array(&$this, 'initialize_settings'));
114
- add_action('wp_head',array(&$this, 'load_css'));
115
- add_action('wp_footer',array(&$this, 'footer_script'));
116
- add_shortcode( 'google-translator',array(&$this, 'google_translator_shortcode'));
117
- add_shortcode( 'glt', array(&$this, 'google_translator_menu_language'));
118
- add_filter('widget_text','do_shortcode');
119
- add_filter('walker_nav_menu_start_el', array(&$this,'menu_shortcodes') , 10 , 2);
120
- add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'glt_settings_link') );
121
-
122
- if (!is_admin()) {
123
- add_action('init',array(&$this, 'flags'));
124
- }
125
- }
126
-
127
- public function glt_activate() {
128
- add_option('googlelanguagetranslator_active', 1);
129
- add_option('googlelanguagetranslator_language','en');
130
- add_option('googlelanguagetranslator_language_option','all');
131
- add_option('googlelanguagetranslator_flags','show_flags');
132
- add_option('language_display_settings',array ('en' => 1));
133
- add_option('flag_display_settings',array ('flag-en' => 1));
134
- add_option('googlelanguagetranslator_translatebox','yes');
135
- add_option('googlelanguagetranslator_display','Vertical');
136
- add_option('googlelanguagetranslator_toolbar','Yes');
137
- add_option('googlelanguagetranslator_showbranding','Yes');
138
- add_option('googlelanguagetranslator_flags_alignment','flags_left');
139
- add_option('googlelanguagetranslator_analytics', 0);
140
- add_option('googlelanguagetranslator_analytics_id','');
141
- add_option('googlelanguagetranslator_css','');
142
- add_option('googlelanguagetranslator_manage_translations',0);
143
- add_option('googlelanguagetranslator_multilanguage',0);
144
- add_option('googlelanguagetranslator_floating_widget','yes');
145
- add_option('googlelanguagetranslator_flag_size','18');
146
- add_option('googlelanguagetranslator_flags_order','');
147
- }
148
-
149
- public function glt_deactivate() {
150
- delete_option('googlelanguagetranslator_active', 1);
151
- delete_option('googlelanguagetranslator_language','en');
152
- delete_option('googlelanguagetranslator_language_option','all');
153
- delete_option('googlelanguagetranslator_flags','show_flags');
154
- delete_option('language_display_settings',array ('en' => 1));
155
- delete_option('flag_display_settings',array ('flag-en' => 1));
156
- delete_option('googlelanguagetranslator_translatebox','yes');
157
- delete_option('googlelanguagetranslator_display','Vertical');
158
- delete_option('googlelanguagetranslator_toolbar','Yes');
159
- delete_option('googlelanguagetranslator_showbranding','Yes');
160
- delete_option('googlelanguagetranslator_flags_alignment','flags_left');
161
- delete_option('googlelanguagetranslator_analytics',1);
162
- delete_option('googlelanguagetranslator_analytics_id','');
163
- delete_option('googlelanguagetranslator_css','');
164
- delete_option('googlelanguagetranslator_manage_translations',0);
165
- delete_option('googlelanguagetranslator_multilanguage',0);
166
- delete_option('googlelanguagetranslator_floating_widget','yes');
167
- delete_option('googlelanguagetranslator_flag_size','18');
168
- delete_option('googlelanguagetranslator_flags_order','');
169
- }
170
-
171
- public function glt_settings_link ( $links ) {
172
- $settings_link = array(
173
- '<a href="' . admin_url( 'options-general.php?page=google_language_translator' ) . '">Settings</a>',
174
- );
175
- return array_merge( $links, $settings_link );
176
- }
177
-
178
- public function add_my_admin_menus(){
179
- $p = add_options_page('Google Language Translator', 'Google Language Translator', 'manage_options', 'google_language_translator', array(&$this, 'page_layout_cb'));
180
-
181
- add_action( 'load-' . $p, array(&$this, 'load_admin_js' ));
182
- }
183
-
184
- public function load_admin_js(){
185
- add_action( 'admin_enqueue_scripts', array(&$this, 'enqueue_admin_js' ));
186
- add_action('admin_footer',array(&$this, 'footer_script'));
187
- }
188
-
189
- public function enqueue_admin_js(){
190
- wp_enqueue_script( 'my-admin-script', plugins_url('js/admin.js',__FILE__), array('jquery'));
191
- wp_enqueue_script( 'my-flag-script', plugins_url('js/flags.js',__FILE__), array('jquery'));
192
-
193
- if (get_option ('googlelanguagetranslator_floating_widget') == 'yes') {
194
- wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
195
- wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
196
- wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
197
- wp_enqueue_style( 'toolbar.css' );
198
- }
199
-
200
- wp_enqueue_script( 'jquery-ui-core');
201
- wp_enqueue_script( 'jquery-ui-sortable');
202
- wp_enqueue_script( 'load_sortable_flags', plugins_url('js/load-sortable-flags.js',__FILE__), array('jquery'));
203
- wp_register_style( 'jquery-ui.css', plugins_url('css/jquery-ui.css',__FILE__) );
204
- wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
205
- wp_enqueue_style( 'style.css' );
206
- //wp_enqueue_style( 'jquery-ui.css' );
207
- }
208
-
209
- public function flags() {
210
- wp_enqueue_script( 'flags', plugins_url('js/flags.js',__FILE__), array('jquery'));
211
-
212
- if (get_option ('googlelanguagetranslator_floating_widget') == 'yes') {
213
- wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
214
- wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
215
- wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
216
- wp_enqueue_style( 'toolbar.css' );
217
- }
218
-
219
- wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
220
- wp_enqueue_style( 'style.css' );
221
- }
222
-
223
- public function load_css() {
224
- include( plugin_dir_path( __FILE__ ) . '/css/style.php');
225
- }
226
-
227
- public function google_translator_shortcode() {
228
-
229
- if (get_option('googlelanguagetranslator_display')=='Vertical'){
230
- return $this->googlelanguagetranslator_vertical();
231
- }
232
- elseif(get_option('googlelanguagetranslator_display')=='Horizontal'){
233
- return $this->googlelanguagetranslator_horizontal();
234
- }
235
- }
236
-
237
- public function googlelanguagetranslator_included_languages() {
238
- if ( get_option('googlelanguagetranslator_language_option')=='specific') {
239
- $get_language_choices = get_option ('language_display_settings');
240
-
241
- foreach ($get_language_choices as $key=>$value) {
242
- if($value == 1) {
243
- $items[] = $key;
244
- }
245
- }
246
-
247
- $comma_separated = implode(",",array_values($items));
248
-
249
- if ( get_option('googlelanguagetranslator_display') == 'Vertical') {
250
- $lang = ", includedLanguages:'".$comma_separated."'";
251
- return $lang;
252
- } elseif ( get_option('googlelanguagetranslator_display') == 'Horizontal') {
253
- $lang = ", includedLanguages:'".$comma_separated."'";
254
- return $lang;
255
- }
256
- }
257
- }
258
-
259
- public function analytics() {
260
- if ( get_option('googlelanguagetranslator_analytics') == 1 ) {
261
- $analytics_id = get_option('googlelanguagetranslator_analytics_id');
262
- $analytics = "gaTrack: true, gaId: '".$analytics_id."'";
263
-
264
- if (!empty ($analytics_id) ):
265
- return ', '.$analytics;
266
- endif;
267
- }
268
- }
269
-
270
- public function menu_shortcodes( $item_output,$item ) {
271
- if ( !empty($item->description)) {
272
- $output = do_shortcode($item->description);
273
-
274
- if ( $output != $item->description )
275
- $item_output = $output;
276
- }
277
- return $item_output;
278
- }
279
-
280
- public function google_translator_menu_language($atts, $content = '') {
281
- extract(shortcode_atts(array(
282
- "language" => 'Spanish',
283
- "label" => 'Spanish'
284
- ), $atts));
285
-
286
- $default_language = get_option('googlelanguagetranslator_language');
287
- $language_code = array_search($language,$this->languages_array);
288
-
289
- return "<a class='nturl notranslate ".$language_code." single-language flag' title='".$language."'>".$label."</a>";
290
- }
291
-
292
- public function footer_script() {
293
- global $shortcode_started;
294
- $default_language = get_option('googlelanguagetranslator_language');
295
- $language_choices = $this->googlelanguagetranslator_included_languages();
296
- $get_language_option = get_option('googlelanguagetranslator_language_option');
297
- $get_flag_choices = get_option ('flag_display_settings');
298
- $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
299
- $is_active = get_option ( 'googlelanguagetranslator_active' );
300
- $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
301
- $auto_display = ', autoDisplay: false';
302
- $str = ''; ?>
303
- <script>jQuery(document).ready(function(a){a("a.nturl").on("click",function(){function l(){doGoogleLanguageTranslator(default_lang+"|"+default_lang)}function n(){doGoogleLanguageTranslator(default_lang+"|"+lang_prefix)}default_lang="<?php echo get_option('googlelanguagetranslator_language'); ?>",lang_prefix=a(this).attr("class").split(" ")[2],lang_prefix==default_lang?l():n()}),a("a.flag").on("click",function(){function l(){doGoogleLanguageTranslator(default_lang+"|"+default_lang)}function n(){doGoogleLanguageTranslator(default_lang+"|"+lang_prefix)}default_lang="<?php echo get_option('googlelanguagetranslator_language'); ?>",lang_prefix=a(this).attr("class").split(" ")[2],a(".tool-container").hide(),lang_prefix==default_lang?l():n()}),0==a("body > #google_language_translator").length&&a("#glt-footer").html("<div id='google_language_translator'></div>")});</script>
304
-
305
- <?php
306
-
307
- if( $is_active == 1) {
308
-
309
- foreach ($get_flag_choices as $flag_choice_key) {}
310
-
311
- if ($floating_widget=='yes' && $get_language_option != 'specific') {
312
- $str.='<div id="glt-translate-trigger"><span class="notranslate">Translate &raquo;</span></div>';
313
- $str.='<div id="glt-toolbar"></div>';
314
- } //endif $floating_widget
315
-
316
- if ($shortcode_started != 'true') {
317
- $str.='<div id="flags" style="display:none">';
318
- $str.='<ul id="sortable" class="ui-sortable">';
319
-
320
- if ((empty($new_languages_array_string)) || ($new_languages_array_count != $get_flag_choices_count)) {
321
- foreach ($this->languages_array as $key=>$value) {
322
- $language_code = $key;
323
- $language_name = $value;
324
- $language_name_flag = $language_name;
325
- if ($flag_choice_key == '1') {
326
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
327
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code."'></a></li>";
328
- }
329
- } //$key
330
- }//foreach
331
- } else {
332
- foreach ($new_languages_array_codes as $value) {
333
- $language_name = $value;
334
- $language_code = array_search ($language_name,$this->languages_array);
335
- $language_name_flag = $language_name;
336
- if ($flag_choice_key == '1') {
337
- if (in_array($language_name,$this->languages_array)) {
338
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
339
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code."'></a></li>";
340
- } //isset
341
- } //in_array
342
- }//flag_choice_key
343
- }//foreach
344
- }//endif
345
- $str.='</ul>';
346
- $str.='</div>';
347
- }
348
- }
349
-
350
- $language_choices = $this->googlelanguagetranslator_included_languages();
351
- $layout = get_option('googlelanguagetranslator_display');
352
- $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
353
- $horizontal_layout = ', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL';
354
- $auto_display = ', autoDisplay: false';
355
- $default_language = get_option('googlelanguagetranslator_language');
356
-
357
- if ($is_multilanguage == 1) {
358
- $multilanguagePage = ', multilanguagePage:true';
359
- $str.="<div id='glt-footer'></div><script type='text/javascript'>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : '') . $auto_display . $multilanguagePage . $this->analytics()."}, 'google_language_translator');}</script>";
360
- $str.="<script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit'></script>";
361
- echo $str;
362
-
363
- } elseif ($is_multilanguage == 0) {
364
- $str.="<div id='glt-footer'></div><script type='text/javascript'>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : '') . $auto_display . $this->analytics()."}, 'google_language_translator');}</script>";
365
- $str.="<script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit'></script>";
366
- echo $str;
367
- }
368
- }
369
-
370
- public function googlelanguagetranslator_vertical() {
371
-
372
- global $shortcode_started;
373
-
374
- $shortcode_started = 'true';
375
- $get_flag_choices = get_option ('flag_display_settings');
376
- $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
377
- $new_languages_array = explode(",",$new_languages_array_string);
378
- $new_languages_array_codes = array_values($new_languages_array);
379
- $new_languages_array_count = count($new_languages_array);
380
- $get_flag_choices_count = count($get_flag_choices);
381
- $get_language_choices = get_option ('language_display_settings');
382
- $flag_width = get_option('googlelanguagetranslator_flag_size');
383
- $default_language_code = get_option('googlelanguagetranslator_language');
384
- $is_active = get_option ( 'googlelanguagetranslator_active' );
385
- $get_language_option = get_option('googlelanguagetranslator_language_option');
386
- $language_choices = $this->googlelanguagetranslator_included_languages();
387
- $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
388
- $str = '';
389
-
390
- if( $is_active == 1){
391
-
392
- foreach ($get_flag_choices as $flag_choice_key) {}
393
-
394
- $str.='<div id="flags" class="size'.$flag_width.'">';
395
- $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
396
-
397
- if ((empty($new_languages_array_string)) || ($new_languages_array_count != $get_flag_choices_count)) {
398
- foreach ($this->languages_array as $key=>$value) {
399
- $language_code = $key;
400
- $language_name = $value;
401
- $language_name_flag = $language_name;
402
- if ($flag_choice_key == '1') {
403
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
404
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code."'></a></li>";
405
- }
406
- } //$key
407
- }//foreach
408
- } else {
409
- foreach ($new_languages_array_codes as $value) {
410
- $language_name = $value;
411
- $language_code = array_search ($language_name,$this->languages_array);
412
- $language_name_flag = $language_name;
413
- if ($flag_choice_key == '1') {
414
- if (in_array($language_name,$this->languages_array)) {
415
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
416
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code."'></a></li>";
417
- } //isset
418
- } //in_array
419
- }//flag_choice_key
420
- }//foreach
421
- }//endif
422
- $str.='</ul>';
423
- $str.='</div>';
424
- $str.='<div id="google_language_translator"></div>';
425
- return $str;
426
- } //End is_active
427
- } // End glt_vertical
428
-
429
- public function googlelanguagetranslator_horizontal(){
430
- $shortcode_started = true;
431
- $get_flag_choices = get_option ('flag_display_settings');
432
- $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
433
- $new_languages_array = explode(",",$new_languages_array_string);
434
- $new_languages_array_codes = array_values($new_languages_array);
435
- $new_languages_array_count = count($new_languages_array);
436
- $get_flag_choices_count = count($get_flag_choices);
437
- $get_language_choices = get_option ('language_display_settings');
438
- $flag_width = get_option('googlelanguagetranslator_flag_size');
439
- $default_language_code = get_option('googlelanguagetranslator_language');
440
- $is_active = get_option ( 'googlelanguagetranslator_active' );
441
- $get_language_option = get_option('googlelanguagetranslator_language_option');
442
- $language_choices = $this->googlelanguagetranslator_included_languages();
443
- $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
444
- $str = '';
445
-
446
- if( $is_active == 1) {
447
- foreach ($get_flag_choices as $flag_choice_key) {}
448
-
449
- $str.='<div id="flags" class="size'.$flag_width.'">';
450
- $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
451
-
452
- if ((empty($new_languages_array_string)) || ($new_languages_array_count != $get_flag_choices_count)) {
453
- foreach ($this->languages_array as $key=>$value) {
454
- $language_code = $key;
455
- $language_name = $value;
456
- $language_name_flag = $language_name;
457
-
458
- if ($flag_choice_key == '1') {
459
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
460
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code."'></a></li>";
461
- }
462
- } //$key
463
- }//foreach
464
-
465
- } else {
466
-
467
- foreach ($new_languages_array_codes as $value) {
468
- $language_name = $value;
469
- $language_code = array_search ($language_name,$this->languages_array);
470
- $language_name_flag = $language_name;
471
- if ($flag_choice_key == '1') {
472
- if (in_array($language_name,$this->languages_array)) {
473
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
474
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code."'></a></li>";
475
- } //isset
476
- } //in_array
477
- }//flag_choice_key
478
- }//foreach
479
- }//endif
480
- $str.='</ul>';
481
- $str.='</div>';
482
- $str.='<div id="google_language_translator"></div>';
483
- return $str;
484
- }
485
- } // End glt_horizontal
486
-
487
- public function initialize_settings() {
488
- add_settings_section('glt_settings','Settings','','google_language_translator');
489
-
490
- $settings_name_array = array (
491
- 'googlelanguagetranslator_active','googlelanguagetranslator_language','googlelanguagetranslator_language_option','language_display_settings','googlelanguagetranslator_flags','flag_display_settings','googlelanguagetranslator_translatebox','googlelanguagetranslator_display','googlelanguagetranslator_toolbar','googlelanguagetranslator_showbranding','googlelanguagetranslator_flags_alignment','googlelanguagetranslator_analytics','googlelanguagetranslator_analytics_id','googlelanguagetranslator_css','googlelanguagetranslator_manage_translations','googlelanguagetranslator_multilanguage','googlelanguagetranslator_floating_widget','googlelanguagetranslator_flag_size','googlelanguagetranslator_flags_order','googlelanguagetranslator_exclude_translation'
492
- );
493
-
494
- $settings_callback_array = array ( 'googlelanguagetranslator_active_cb','googlelanguagetranslator_language_cb','googlelanguagetranslator_language_option_cb','language_display_settings_cb','googlelanguagetranslator_flags_cb','flag_display_settings_cb','googlelanguagetranslator_translatebox_cb','googlelanguagetranslator_display_cb','googlelanguagetranslator_toolbar_cb','googlelanguagetranslator_showbranding_cb','googlelanguagetranslator_flags_alignment_cb','googlelanguagetranslator_analytics_cb','googlelanguagetranslator_analytics_id_cb','googlelanguagetranslator_css_cb','googlelanguagetranslator_manage_translations_cb','googlelanguagetranslator_multilanguage_cb','googlelanguagetranslator_floating_widget_cb','googlelanguagetranslator_flag_size_cb','googlelanguagetranslator_flags_order_cb','googlelanguagetranslator_exclude_translation_cb'
495
- );
496
-
497
- foreach ($settings_name_array as $setting) {
498
- add_settings_field( $setting,'',$setting.'_cb','google_language_translator','glt_settings');
499
- register_setting( 'google_language_translator',$setting);
500
- }
501
- }
502
-
503
- public function googlelanguagetranslator_active_cb() {
504
- $option_name = 'googlelanguagetranslator_active' ;
505
- $new_value = 1;
506
- if ( get_option( $option_name ) === false ) {
507
-
508
- // The option does not exist, so we update it.
509
- update_option( $option_name, $new_value );
510
- }
511
-
512
- $options = get_option (''.$option_name.'');
513
-
514
- $html = '<input type="checkbox" name="googlelanguagetranslator_active" id="googlelanguagetranslator_active" value="1" '.checked(1,$options,false).'/> &nbsp; Check this box to activate';
515
- echo $html;
516
- }
517
-
518
- public function googlelanguagetranslator_language_cb() {
519
-
520
- $option_name = 'googlelanguagetranslator_language';
521
- $new_value = 'en';
522
-
523
- if ( get_option( $option_name ) === false ) {
524
-
525
- // The option does not exist, so we update it.
526
- update_option( $option_name, $new_value );
527
- }
528
-
529
- $options = get_option (''.$option_name.''); ?>
530
-
531
- <select name="googlelanguagetranslator_language" id="googlelanguagetranslator_language">
532
-
533
- <?php
534
-
535
- foreach ($this->languages_array as $key => $value) {
536
- $language_code = $key;
537
- $language_name = $value; ?>
538
- <option value="<?php echo $language_code; ?>" <?php if($options==''.$language_code.''){echo "selected";}?>><?php echo $language_name; ?></option>
539
- <?php } ?>
540
- </select>
541
- <?php
542
- }
543
-
544
- public function googlelanguagetranslator_language_option_cb() {
545
-
546
- $option_name = 'googlelanguagetranslator_language_option' ;
547
- $new_value = 'all';
548
-
549
- if ( get_option( $option_name ) === false ) {
550
-
551
- // The option does not exist, so we update it.
552
- update_option( $option_name, $new_value );
553
- }
554
-
555
- $options = get_option (''.$option_name.''); ?>
556
-
557
- <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="all" <?php if($options=='all'){echo "checked";}?>/> All Languages<br/>
558
- <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="specific" <?php if($options=='specific'){echo "checked";}?>/> Specific Languages
559
- <?php
560
- }
561
-
562
- public function language_display_settings_cb() {
563
- $default_language_code = get_option('googlelanguagetranslator_language');
564
- $option_name = 'language_display_settings';
565
- $new_value = array(''.$default_language_code.'' => 1);
566
-
567
- if ( get_option( $option_name ) == false ) {
568
- // The option does not exist, so we update it.
569
- update_option( $option_name, $new_value );
570
- }
571
-
572
- $get_language_choices = get_option (''.$option_name.'');
573
-
574
- foreach ($this->languages_array as $key => $value) {
575
- $language_code = $key;
576
- $language_name = $value;
577
- $language_code_array[] = $key;
578
-
579
- if (!isset($get_language_choices[''.$language_code.''])) {
580
- $get_language_choices[''.$language_code.''] = 0;
581
- }
582
-
583
- $items[] = $get_language_choices[''.$language_code.''];
584
- $language_codes = $language_code_array;
585
- $item_count = count($items);
586
-
587
- if ($item_count == 1 || $item_count == 24 || $item_count == 47 || $item_count == 70) { ?>
588
- <div class="languages" style="width:25%; float:left">
589
- <?php } ?>
590
- <div><input type="checkbox" name="language_display_settings[<?php echo $language_code; ?>]" value="1"<?php checked( 1,$get_language_choices[''.$language_code.'']); ?>/><?php echo $language_name; ?></div>
591
- <?php
592
- if ($item_count == 23 || $item_count == 46 || $item_count == 69 || $item_count == 91) { ?>
593
- </div>
594
- <?php }
595
- } ?>
596
- <div class="clear"></div>
597
- <?php
598
- }
599
-
600
- public function googlelanguagetranslator_flags_cb() {
601
-
602
- $option_name = 'googlelanguagetranslator_flags' ;
603
- $new_value = 'show_flags';
604
-
605
- if ( get_option( $option_name ) === false ) {
606
-
607
- // The option does not exist, so we update it.
608
- update_option( $option_name, $new_value );
609
- }
610
-
611
- $options = get_option (''.$option_name.''); ?>
612
-
613
- <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="show_flags" <?php if($options=='show_flags'){echo "checked";}?>/> Yes, show flag images<br/>
614
- <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="hide_flags" <?php if($options=='hide_flags'){echo "checked";}?>/> No, hide flag images
615
- <?php
616
- }
617
-
618
- public function flag_display_settings_cb() {
619
- $default_language_code = get_option('googlelanguagetranslator_language');
620
- $option_name = 'flag_display_settings';
621
- $new_value = array('flag-'.$default_language_code.'' => 1);
622
-
623
- if ( get_option( $option_name ) == false ) {
624
- // The option does not exist, so we update it.
625
- update_option( $option_name, $new_value );
626
- }
627
-
628
- $get_flag_choices = get_option (''.$option_name.'');
629
-
630
- foreach ($this->languages_array as $key => $value) {
631
- $language_code = $key;
632
- $language_name = $value;
633
- $language_code_array[] = $key;
634
-
635
- if (!isset($get_flag_choices['flag-'.$language_code.''])) {
636
- $get_flag_choices['flag-'.$language_code.''] = 0;
637
- }
638
-
639
- $items[] = $get_flag_choices['flag-'.$language_code.''];
640
- $language_codes = $language_code_array;
641
- $item_count = count($items);
642
-
643
- if ($item_count == 1 || $item_count == 24 || $item_count == 47 || $item_count == 70) { ?>
644
- <div class="flagdisplay" style="width:25%; float:left">
645
- <?php } ?>
646
- <div><input type="checkbox" name="flag_display_settings[flag-<?php echo $language_code; ?>]" value="1"<?php checked( 1,$get_flag_choices['flag-'.$language_code.'']); ?>/><?php echo $language_name; ?></div>
647
- <?php
648
- if ($item_count == 23 || $item_count == 46 || $item_count == 69 || $item_count == 91) { ?>
649
- </div>
650
- <?php }
651
- } ?>
652
- <div class="clear"></div>
653
- <?php
654
- }
655
-
656
- public function googlelanguagetranslator_floating_widget_cb() {
657
-
658
- $option_name = 'googlelanguagetranslator_floating_widget' ;
659
- $new_value = 'yes';
660
-
661
- if ( get_option( $option_name ) === false ) {
662
-
663
- // The option does not exist, so we update it.
664
- update_option( $option_name, $new_value );
665
- }
666
-
667
- $options = get_option (''.$option_name.''); ?>
668
-
669
- <select name="googlelanguagetranslator_floating_widget" id="googlelanguagetranslator_floating_widget" style="width:170px">
670
- <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show widget</option>
671
- <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide widget</option>
672
- </select>
673
- <?php }
674
-
675
- public function googlelanguagetranslator_translatebox_cb() {
676
-
677
- $option_name = 'googlelanguagetranslator_translatebox' ;
678
- $new_value = 'yes';
679
-
680
- if ( get_option( $option_name ) === false ) {
681
-
682
- // The option does not exist, so we update it.
683
- update_option( $option_name, $new_value );
684
- }
685
-
686
- $options = get_option (''.$option_name.''); ?>
687
-
688
- <select name="googlelanguagetranslator_translatebox" id="googlelanguagetranslator_translatebox" style="width:190px">
689
- <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show language box</option>
690
- <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide language box</option>
691
- </select>
692
- <?php }
693
-
694
- public function googlelanguagetranslator_display_cb() {
695
-
696
- $option_name = 'googlelanguagetranslator_display' ;
697
- $new_value = 'Vertical';
698
-
699
- if ( get_option( $option_name ) === false ) {
700
-
701
- // The option does not exist, so we update it.
702
- update_option( $option_name, $new_value );
703
- }
704
-
705
- $options = get_option (''.$option_name.''); ?>
706
-
707
- <select name="googlelanguagetranslator_display" id="googlelanguagetranslator_display" style="width:170px;">
708
- <option value="Vertical" <?php if(get_option('googlelanguagetranslator_display')=='Vertical'){echo "selected";}?>>Vertical</option>
709
- <option value="Horizontal" <?php if(get_option('googlelanguagetranslator_display')=='Horizontal'){echo "selected";}?>>Horizontal</option>
710
- </select>
711
- <?php }
712
-
713
- public function googlelanguagetranslator_toolbar_cb() {
714
-
715
- $option_name = 'googlelanguagetranslator_toolbar' ;
716
- $new_value = 'Yes';
717
-
718
- if ( get_option( $option_name ) === false ) {
719
-
720
- // The option does not exist, so we update it.
721
- update_option( $option_name, $new_value );
722
- }
723
-
724
- $options = get_option (''.$option_name.''); ?>
725
-
726
- <select name="googlelanguagetranslator_toolbar" id="googlelanguagetranslator_toolbar" style="width:170px;">
727
- <option value="Yes" <?php if(get_option('googlelanguagetranslator_toolbar')=='Yes'){echo "selected";}?>>Yes</option>
728
- <option value="No" <?php if(get_option('googlelanguagetranslator_toolbar')=='No'){echo "selected";}?>>No</option>
729
- </select>
730
- <?php }
731
-
732
- public function googlelanguagetranslator_showbranding_cb() {
733
-
734
- $option_name = 'googlelanguagetranslator_showbranding' ;
735
- $new_value = 'Yes';
736
-
737
- if ( get_option( $option_name ) === false ) {
738
-
739
- // The option does not exist, so we update it.
740
- update_option( $option_name, $new_value );
741
- }
742
-
743
- $options = get_option (''.$option_name.''); ?>
744
-
745
- <select name="googlelanguagetranslator_showbranding" id="googlelanguagetranslator_showbranding" style="width:170px;">
746
- <option value="Yes" <?php if(get_option('googlelanguagetranslator_showbranding')=='Yes'){echo "selected";}?>>Yes</option>
747
- <option value="No" <?php if(get_option('googlelanguagetranslator_showbranding')=='No'){echo "selected";}?>>No</option>
748
- </select>
749
- <?php }
750
-
751
- public function googlelanguagetranslator_flags_alignment_cb() {
752
-
753
- $option_name = 'googlelanguagetranslator_flags_alignment' ;
754
- $new_value = 'flags_left';
755
-
756
- if ( get_option( $option_name ) === false ) {
757
-
758
- // The option does not exist, so we update it.
759
- update_option( $option_name, 'flags_left' );
760
- }
761
-
762
- $options = get_option (''.$option_name.''); ?>
763
-
764
- <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_left" value="flags_left" <?php if($options=='flags_left'){echo "checked";}?>/> Align Left<br/>
765
- <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_right" value="flags_right" <?php if($options=='flags_right'){echo "checked";}?>/> Align Right
766
- <?php }
767
-
768
- public function googlelanguagetranslator_analytics_cb() {
769
-
770
- $option_name = 'googlelanguagetranslator_analytics' ;
771
- $new_value = 0;
772
-
773
- if ( get_option( $option_name ) === false ) {
774
-
775
- // The option does not exist, so we update it.
776
- update_option( $option_name, $new_value );
777
- }
778
-
779
- $options = get_option (''.$option_name.'');
780
-
781
- $html = '<input type="checkbox" name="googlelanguagetranslator_analytics" id="googlelanguagetranslator_analytics" value="1" '.checked(1,$options,false).'/> &nbsp; Activate Google Analytics tracking?';
782
- echo $html;
783
- }
784
-
785
- public function googlelanguagetranslator_analytics_id_cb() {
786
-
787
- $option_name = 'googlelanguagetranslator_analytics_id' ;
788
- $new_value = '';
789
-
790
- if ( get_option( $option_name ) === false ) {
791
-
792
- // The option does not exist, so we update it.
793
- update_option( $option_name, $new_value );
794
- }
795
-
796
- $options = get_option (''.$option_name.'');
797
-
798
- $html = '<input type="text" name="googlelanguagetranslator_analytics_id" id="googlelanguagetranslator_analytics_id" value="'.$options.'" />';
799
- echo $html;
800
- }
801
-
802
- public function googlelanguagetranslator_flag_size_cb() {
803
-
804
- $option_name = 'googlelanguagetranslator_flag_size' ;
805
- $new_value = '18';
806
-
807
- if ( get_option( $option_name ) === false ) {
808
-
809
- // The option does not exist, so we update it.
810
- update_option( $option_name, $new_value );
811
- }
812
-
813
- $options = get_option (''.$option_name.''); ?>
814
-
815
- <select name="googlelanguagetranslator_flag_size" id="googlelanguagetranslator_flag_size" style="width:110px;">
816
- <option value="16" <?php if($options=='16'){echo "selected";}?>>16px</option>
817
- <option value="18" <?php if($options=='18'){echo "selected";}?>>18px</option>
818
- <option value="20" <?php if($options=='20'){echo "selected";}?>>20px</option>
819
- <option value="22" <?php if($options=='22'){echo "selected";}?>>22px</option>
820
- <option value="24" <?php if($options=='24'){echo "selected";}?>>24px</option>
821
- </select>
822
- <?php }
823
-
824
- public function googlelanguagetranslator_flags_order_cb() {
825
- $option_name = 'googlelanguagetranslator_flags_order';
826
- $new_value = '';
827
-
828
- if ( get_option ( $option_name ) === false ) {
829
-
830
- // The option does not exist, so we update it.
831
- update_option( $option_name, $new_value );
832
- }
833
-
834
- $options = get_option ( ''.$option_name.'' ); ?>
835
-
836
- <input type="hidden" id="order" name="googlelanguagetranslator_flags_order" value="<?php print_r(get_option('googlelanguagetranslator_flags_order')); ?>" />
837
- <?php
838
- }
839
-
840
- public function googlelanguagetranslator_css_cb() {
841
-
842
- $option_name = 'googlelanguagetranslator_css' ;
843
- $new_value = '';
844
-
845
- if ( get_option( $option_name ) === false ) {
846
-
847
- // The option does not exist, so we update it.
848
- update_option( $option_name, $new_value );
849
- }
850
-
851
- $options = get_option (''.$option_name.'');
852
-
853
- $html = '<textarea style="width:100%; height:200px" name="googlelanguagetranslator_css" id="googlelanguagetranslator_css">'.$options.'</textarea>';
854
- echo $html;
855
- }
856
-
857
- public function googlelanguagetranslator_manage_translations_cb() {
858
- $option_name = 'googlelanguagetranslator_manage_translations' ;
859
- $new_value = 0;
860
-
861
- if ( get_option( $option_name ) === false ) {
862
-
863
- // The option does not exist, so we update it.
864
- update_option( $option_name, $new_value );
865
- }
866
-
867
- $options = get_option (''.$option_name.'');
868
-
869
- $html = '<input type="checkbox" name="googlelanguagetranslator_manage_translations" id="googlelanguagetranslator_manage_translations" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on translation management?';
870
- echo $html;
871
- }
872
-
873
- public function googlelanguagetranslator_multilanguage_cb() {
874
-
875
- $option_name = 'googlelanguagetranslator_multilanguage' ;
876
- $new_value = 0;
877
-
878
- if ( get_option( $option_name ) === false ) {
879
-
880
- // The option does not exist, so we update it.
881
- update_option( $option_name, $new_value );
882
- }
883
-
884
- $options = get_option (''.$option_name.'');
885
-
886
- $html = '<input type="checkbox" name="googlelanguagetranslator_multilanguage" id="googlelanguagetranslator_multilanguage" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on multilanguage mode?';
887
- echo $html;
888
- }
889
-
890
- public function googlelanguagetranslator_exclude_translation_cb() {
891
-
892
- $option_name = 'googlelanguagetranslator_exclude_translation';
893
- $new_value = '';
894
-
895
- if (get_option($option_name) === false ) {
896
- // The option does not exist, so we update it.
897
- update_option( $option_name, $new_value );
898
- }
899
-
900
- $options = get_option (''.$option_name.'');
901
-
902
- $html = '<input type="text" name="'.$option_name.'" id="'.$option_name.'" value="'.$options.'" />';
903
-
904
- echo $html;
905
- }
906
-
907
- public function page_layout_cb() {
908
- include( plugin_dir_path( __FILE__ ) . '/css/style.php'); ?>
909
- <?php add_thickbox(); ?>
910
- <div class="wrap">
911
- <div id="icon-options-general" class="icon32"></div>
912
- <h2><span class="notranslate">Google Language Translator</span></h2>
913
- <form action="<?php echo admin_url( '/options.php'); ?>" method="post">
914
- <div class="metabox-holder has-right-sidebar" style="float:left; width:65%">
915
- <div class="postbox" style="width: 100%">
916
- <h3 class="notranslate">Settings</h3>
917
-
918
- <?php settings_fields('google_language_translator'); ?>
919
- <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
920
- <tr>
921
- <td style="width:60%" class="notranslate">Plugin Status:</td>
922
- <td class="notranslate"><?php $this->googlelanguagetranslator_active_cb(); ?></td>
923
- </tr>
924
-
925
- <tr class="notranslate">
926
- <td>Choose the original language of your website</td>
927
- <td><?php $this->googlelanguagetranslator_language_cb(); ?></td>
928
- </tr>
929
-
930
- <tr class="notranslate">
931
- <td>What translation languages will display in the language box?<br/>("All Languages" option <strong><u>must</u></strong> be chosen to show flags.)</td>
932
- <td><?php $this->googlelanguagetranslator_language_option_cb(); ?></td>
933
- </tr>
934
-
935
- <tr class="notranslate languages">
936
- <td colspan="2"><?php $this->language_display_settings_cb(); ?></td>
937
- </tr>
938
-
939
- <tr class="notranslate">
940
- <td class="choose_flags_intro">Show flag images?<br/>(Display up to 91 flags above the translator)</td>
941
- <td class="choose_flags_intro"><?php $this->googlelanguagetranslator_flags_cb(); ?></td>
942
- </tr>
943
-
944
- <tr class="notranslate choose_flags">
945
- <td class="choose_flags">Choose the flags you want to display:</td>
946
- <td></td>
947
- </tr>
948
-
949
- <tr class="notranslate">
950
- <td colspan="2" class="choose_flags"><?php $this->flag_display_settings_cb(); ?></td>
951
- </tr>
952
-
953
- <tr class="notranslate">
954
- <td>Show floating translation widget?<br/>
955
- <span>("All Languages" option <strong><u>must</u></strong> be chosen to show widget.)</span>
956
- </td>
957
- <td><?php $this->googlelanguagetranslator_floating_widget_cb(); ?></td>
958
- </tr>
959
-
960
- <tr class="notranslate">
961
- <td>Show translate box?</td>
962
- <td><?php $this->googlelanguagetranslator_translatebox_cb(); ?></td>
963
- </tr>
964
-
965
- <tr class="notranslate">
966
- <td>Layout option:</td>
967
- <td><?php $this->googlelanguagetranslator_display_cb(); ?></td>
968
- </tr>
969
-
970
- <tr class="notranslate">
971
- <td>Show Google Toolbar?</td>
972
- <td><?php $this->googlelanguagetranslator_toolbar_cb(); ?></td>
973
- </tr>
974
-
975
- <tr class="notranslate">
976
- <td>Show Google Branding? &nbsp;<a href="https://developers.google.com/translate/v2/attribution" target="_blank">Learn more</a></td>
977
- <td><?php $this->googlelanguagetranslator_showbranding_cb(); ?></td>
978
- </tr>
979
-
980
- <tr class="alignment notranslate">
981
- <td class="flagdisplay">Align the translator left or right?</td>
982
- <td class="flagdisplay"><?php $this->googlelanguagetranslator_flags_alignment_cb(); ?></td>
983
- </tr>
984
-
985
- <!--<tr class="manage_translations notranslate">
986
- <td>Turn on translation management? &nbsp;<a href="#TB_inline?width=200&height=300&inlineId=translation-management-description" title="What is Translation Management?" class="thickbox">Learn more</a><div id="translation-management-description" style="display:none"><p>Translation management is an interface that allows you to manage specific words and phrases on your website. The interface is linked directly to your Google Account, and no special subscriptions are necessary to setup this feature.</p><p>If translation management setting is checked, users who browse your website can hover their mouse over specific words and phrases, then send translation suggestions directly to your Google Translate account! You can then "approve" those suggestions, and Google will automatically display them when translations are requested by your users.</p><p>Translation management requires that you insert a custom meta tag into the <code>head</code> section of your website.</p><p><a href="http://translate.google.com/manager/website/settings" target="_blank">Click here to to get the required meta tag</a></p></div></td>
987
- <td><?php $this->googlelanguagetranslator_manage_translations_cb(); ?></td>
988
- </tr>-->
989
-
990
- <tr class="multilanguage notranslate">
991
- <td>Multilanguage Page option? &nbsp;<a href="#TB_inline?width=200&height=150&inlineId=multilanguage-page-description" title="What is the Multi-Language Page Option?" class="thickbox">Learn more</a><div id="multilanguage-page-description" style="display:none"><p>If checked, Google will automatically convert text written in multiple languages, into the single language requested by your user.</p><p>In most cases, this setting is not recommended, although for certain websites it might be necessary.</p></div></td>
992
- <td><?php $this->googlelanguagetranslator_multilanguage_cb(); ?></td>
993
- </tr>
994
-
995
- <tr class="notranslate">
996
- <td>Google Analytics:</td>
997
- <td><?php $this->googlelanguagetranslator_analytics_cb(); ?></td>
998
- </tr>
999
-
1000
- <tr class="analytics notranslate">
1001
- <td>Google Analytics ID (Ex. 'UA-11117410-2')</td>
1002
- <td><?php $this->googlelanguagetranslator_analytics_id_cb(); ?></td>
1003
- </tr>
1004
-
1005
- <tr class="notranslate">
1006
- <td>Full widget usage in pages/posts/sidebar:</td>
1007
- <td><code>[google-translator]</code></td>
1008
- </tr>
1009
- </table>
1010
-
1011
- <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1012
- <tr class="notranslate">
1013
- <td style="width:40%">Full widget usage in header/footer or page template:</td>
1014
- <td style="width:60%"><code>&lt;?php echo do_shortcode('[google-translator]'); ?&gt;</code></td>
1015
- </tr>
1016
-
1017
- <tr class="notranslate">
1018
- <td>Single language usage in<br/>nav menu/pages/posts</td>
1019
- <td><code>[glt language="Spanish" label="Español"]</code></td>
1020
- </tr>
1021
-
1022
- <tr class="notranslate">
1023
- <td colspan="2">
1024
- <a href="#TB_inline?width=200&height=450&inlineId=single-language-shortcode-description" title="How to place a single language in your Wordpress menu" class="thickbox">How to place a single language in your Wordpress menu</a>
1025
- <div id="single-language-shortcode-description" style="display:none">
1026
- <p>For menu usage, you need to create a new menu, or use an existing menu, by navigating to "Appearance > Menus".</p>
1027
- <p>First you will need to enable "descriptions" for your menu items, which can be found in a tab labeled "Screen Options" in the upper-right area of the page.</p>
1028
- <p>Once descriptions are enabled, follow these steps:<br/>
1029
- <ol>
1030
- <li>Create a new menu item using "Link" as the menu item type.</li>
1031
- <li>Use <code style="border:none">#</code> for the URL</li>
1032
- <li>Enter a navigation label of your choice. This label does not appear on your website - it is meant only to help you identify the menu item.</li>
1033
- <li>Place the following shortcode into the "description" field, and modify it to display the language and navigation label of your choice:</li>
1034
- </ol>
1035
- <p><code>[glt language="Spanish" label="Español"]</code></p>
1036
- </div>
1037
- </td>
1038
- </tr>
1039
-
1040
- <tr class="notranslate">
1041
- <td>
1042
- <?php
1043
- if (isset($_POST['submit'])) {
1044
- if (empty($_POST['submit']) && !check_admin_referer( 'glt-save-settings', 'glt-save-settings-nonce' )) {
1045
- wp_die();
1046
- } else { echo 'hello'; }
1047
- }
1048
- wp_nonce_field('glt-save-settings, glt-save-settings-nonce', false);
1049
- submit_button();
1050
- ?>
1051
- </td>
1052
- <td></td>
1053
- </tr>
1054
- </table>
1055
- </div> <!-- .postbox -->
1056
- </div> <!-- .metbox-holder -->
1057
-
1058
- <div class="metabox-holder" style="float:right; clear:right; width:33%">
1059
- <div class="postbox">
1060
- <h3 class="notranslate">Preview</h3>
1061
- <table style="width:100%">
1062
- <tr>
1063
- <td style="box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; padding:15px 15px; margin:0px"><span class="notranslate"> Drag &amp; drop flags to change their position.<br/><br/>(Note: flag order resets when flags are added/removed)</span><br/><br/><?php echo do_shortcode('[google-translator]'); ?><p class="hello"><span class="notranslate">Translated text:</span> &nbsp; <span>Hello</span></p></td>
1064
- </tr>
1065
-
1066
- <tr>
1067
- <td><?php if (isset ($_POST['googlelanguagetranslator_flags_order']) ) { echo $_POST['googlelanguagetranslator_flags_order']; } ?></td>
1068
- </tr>
1069
-
1070
-
1071
- </table>
1072
- </div> <!-- .postbox -->
1073
- </div> <!-- .metabox-holder -->
1074
-
1075
- <div id="glt_advanced_settings" class="metabox-holder notranslate" style="float: right; width: 33%;">
1076
- <div class="postbox">
1077
- <h3>Advanced Settings</h3>
1078
- <div class="inside">
1079
- <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1080
- <tr class="notranslate">
1081
- <td class="advanced">Select flag size:</td>
1082
- <td class="advanced"><?php $this->googlelanguagetranslator_flag_size_cb(); ?></td>
1083
- </tr>
1084
- </table>
1085
- </div>
1086
- </div>
1087
- </div>
1088
-
1089
-
1090
- <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1091
- <div class="postbox">
1092
- <h3>Add CSS Styles</h3>
1093
- <div class="inside">
1094
- <p>You can apply any necessary CSS styles below:</p>
1095
- <?php $this->googlelanguagetranslator_css_cb(); ?>
1096
- </div>
1097
- </div>
1098
- </div>
1099
- <?php $this->googlelanguagetranslator_flags_order_cb(); ?>
1100
- </form>
1101
-
1102
- <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1103
- <div class="postbox">
1104
- <h3>GLT Premium 4.0.9 is Here! $30</h3>
1105
- <div class="inside"><a href="http://www.wp-studio.net/" target="_blank"><img style="background:#444; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px" src="<?php echo plugins_url('google-language-translator/images/logo.png'); ?>"></a><br />
1106
- <ul id="features" style="margin-left:15px">
1107
- <li style="list-style:square outside"><span style="color:red; font-weight:bold">New!</span> Manual Translation Module (Experimental)!</li>
1108
- <li style="list-style:square outside"><span style="color:red; font-weight:bold">New!</span> Exclude any specific area of your website from translation, directly from your settings panel</li>
1109
- <li style="list-style:square outside">81 Languages</li>
1110
- <li style="list-style:square outside">jQuery-powered language switcher<br/>(No Adobe Flash required)</li>
1111
- <li style="list-style:square outside">Add single languages to your menus/pages/posts</li>
1112
- <li style="list-style:square outside">Show/hide images or text for each language</li>
1113
- <li style="list-style:square outside">Language switcher loads inline with page content</li>
1114
- <li style="list-style:square outside">Custom flag choices for English, Spanish and Portuguese</li>
1115
- <li style="list-style:square outside">User-friendly URLs, hide or show <code>lang</code> attribute</li>
1116
- <li style="list-style:square outside">Drag/drop flags to re-arrange their order</li>
1117
- <li style="list-style:square outside">Full access to our support forum</li>
1118
- <li style="list-style:square outside">FREE access to all future updates</li>
1119
- </ul>
1120
- </div>
1121
- </div>
1122
- </div>
1123
-
1124
- <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1125
- <div class="postbox">
1126
- <h3>Please Consider A Donation</h3>
1127
- <div class="inside">If you like this plugin and find it useful, help keep this plugin actively developed by clicking the donate button <br /><br />
1128
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
1129
- <input type="hidden" name="cmd" value="_donations">
1130
- <input type="hidden" name="business" value="robertmyrick@hotmail.com">
1131
- <input type="hidden" name="lc" value="US">
1132
- <input type="hidden" name="item_name" value="Support Studio 88 Design and help us bring you more Wordpress goodies! Any donation is kindly appreciated. Thank you!">
1133
- <input type="hidden" name="no_note" value="0">
1134
- <input type="hidden" name="currency_code" value="USD">
1135
- <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest">
1136
- <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
1137
- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
1138
- </form>
1139
- <br />
1140
- <br />
1141
- </div>
1142
- </div>
1143
- </div>
1144
- </div> <!-- .wrap -->
1145
- <?php
1146
- }
1147
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1148
  $google_language_translator = new google_language_translator();
1
+ <?php
2
+ /*
3
+ Plugin Name: Google Language Translator
4
+ Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
+ Version: 5.0.05
6
+ Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
+ Author: Rob Myrick
8
+ Author URI: http://www.wp-studio.net/
9
+ */
10
+
11
+ //ini_set('display_errors', 1);
12
+ //ini_set('display_startup_errors', 1);
13
+ //error_reporting(E_ALL);
14
+
15
+ include( plugin_dir_path( __FILE__ ) . 'widget.php');
16
+
17
+ class google_language_translator {
18
+
19
+ public $languages_array = array (
20
+ 'af' => 'Afrikaans',
21
+ 'sq' => 'Albanian',
22
+ 'ar' => 'Arabic',
23
+ 'hy' => 'Armenian',
24
+ 'az' => 'Azerbaijani',
25
+ 'eu' => 'Basque',
26
+ 'be' => 'Belarusian',
27
+ 'bn' => 'Bengali',
28
+ 'bs' => 'Bosnian',
29
+ 'bg' => 'Bulgarian',
30
+ 'ca' => 'Catalan',
31
+ 'ceb' => 'Cebuano',
32
+ 'ny' => 'Chichewa',
33
+ 'zh-CN' => 'Chinese',
34
+ 'zh-TW' => 'Chinese(Traditional)',
35
+ 'hr' => 'Croatian',
36
+ 'cs' => 'Czech',
37
+ 'da' => 'Danish',
38
+ 'nl' => 'Dutch',
39
+ 'en' => 'English',
40
+ 'eo' => 'Esperanto',
41
+ 'et' => 'Estonian',
42
+ 'tl' => 'Filipino',
43
+ 'fi' => 'Finnish',
44
+ 'fr' => 'French',
45
+ 'gl' => 'Galician',
46
+ 'ka' => 'Georgian',
47
+ 'de' => 'German',
48
+ 'el' => 'Greek',
49
+ 'gu' => 'Gujarati',
50
+ 'ht' => 'Haitian',
51
+ 'ha' => 'Hausa',
52
+ 'iw' => 'Hebrew',
53
+ 'hi' => 'Hindi',
54
+ 'hmn' => 'Hmong',
55
+ 'hu' => 'Hungarian',
56
+ 'is' => 'Icelandic',
57
+ 'ig' => 'Igbo',
58
+ 'id' => 'Indonesian',
59
+ 'ga' => 'Irish',
60
+ 'it' => 'Italian',
61
+ 'ja' => 'Japanese',
62
+ 'jw' => 'Javanese',
63
+ 'kn' => 'Kannada',
64
+ 'kk' => 'Kazakh',
65
+ 'km' => 'Khmer',
66
+ 'ko' => 'Korean',
67
+ 'lo' => 'Lao',
68
+ 'la' => 'Latin',
69
+ 'lv' => 'Latvian',
70
+ 'lt' => 'Lithuanian',
71
+ 'mk' => 'Macedonian',
72
+ 'mg' => 'Malagasy',
73
+ 'ms' => 'Malay',
74
+ 'ml' => 'Malayalam',
75
+ 'mt' => 'Maltese',
76
+ 'mi' => 'Maori',
77
+ 'mr' => 'Marathi',
78
+ 'mn' => 'Mongolian',
79
+ 'my' => 'Myanmar(Burmese)',
80
+ 'ne' => 'Nepali',
81
+ 'no' => 'Norwegian',
82
+ 'fa' => 'Persian',
83
+ 'pl' => 'Polish',
84
+ 'pt' => 'Portuguese',
85
+ 'pa' => 'Punjabi',
86
+ 'ro' => 'Romanian',
87
+ 'ru' => 'Russian',
88
+ 'sr' => 'Serbian',
89
+ 'st' => 'Sesotho',
90
+ 'si' => 'Sinhala',
91
+ 'sk' => 'Slovak',
92
+ 'sl' => 'Slovenian',
93
+ 'so' => 'Somali',
94
+ 'es' => 'Spanish',
95
+ 'su' => 'Sundanese',
96
+ 'sw' => 'Swahili',
97
+ 'sv' => 'Swedish',
98
+ 'tg' => 'Tajik',
99
+ 'ta' => 'Tamil',
100
+ 'te' => 'Telugu',
101
+ 'th' => 'Thai',
102
+ 'tr' => 'Turkish',
103
+ 'uk' => 'Ukranian',
104
+ 'ur' => 'Urdu',
105
+ 'uz' => 'Uzbek',
106
+ 'vi' => 'Vietnamese',
107
+ 'cy' => 'Welsh',
108
+ 'yi' => 'Yiddish',
109
+ 'yo' => 'Yoruba',
110
+ 'zu' => 'Zulu'
111
+ );
112
+
113
+ public function __construct() {
114
+ register_activation_hook( __FILE__, array( &$this, 'glt_activate' ));
115
+ register_uninstall_hook( __FILE__, 'glt_deactivate' );
116
+ add_action( 'admin_menu', array( &$this, 'add_my_admin_menus'));
117
+ add_action('admin_init',array(&$this, 'initialize_settings'));
118
+ add_action('wp_head',array(&$this, 'load_css'));
119
+ add_action('wp_footer',array(&$this, 'footer_script'));
120
+ add_shortcode( 'google-translator',array(&$this, 'google_translator_shortcode'));
121
+ add_shortcode( 'glt', array(&$this, 'google_translator_menu_language'));
122
+ add_filter('widget_text','do_shortcode');
123
+ add_filter('walker_nav_menu_start_el', array(&$this,'menu_shortcodes') , 10 , 2);
124
+ add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'glt_settings_link') );
125
+
126
+ if (!is_admin()) {
127
+ add_action('init',array(&$this, 'flags'));
128
+ }
129
+ }
130
+
131
+ public function glt_activate() {
132
+ add_option('googlelanguagetranslator_active', 1);
133
+ add_option('googlelanguagetranslator_language','en');
134
+ add_option('googlelanguagetranslator_language_option','all');
135
+ add_option('googlelanguagetranslator_flags','show_flags');
136
+ add_option('language_display_settings',array ('en' => 1));
137
+ add_option('flag_display_settings',array ('flag-en' => 1));
138
+ add_option('googlelanguagetranslator_translatebox','yes');
139
+ add_option('googlelanguagetranslator_display','Vertical');
140
+ add_option('googlelanguagetranslator_toolbar','Yes');
141
+ add_option('googlelanguagetranslator_showbranding','Yes');
142
+ add_option('googlelanguagetranslator_flags_alignment','flags_left');
143
+ add_option('googlelanguagetranslator_analytics', 0);
144
+ add_option('googlelanguagetranslator_analytics_id','');
145
+ add_option('googlelanguagetranslator_css','');
146
+ add_option('googlelanguagetranslator_multilanguage',0);
147
+ add_option('googlelanguagetranslator_floating_widget','yes');
148
+ add_option('googlelanguagetranslator_flag_size','18');
149
+ add_option('googlelanguagetranslator_flags_order','');
150
+ add_option('googlelanguagetranslator_english_flag_choice_cb','');
151
+ delete_option('googlelanguagetranslator_manage_translations',0);
152
+ }
153
+
154
+ public function glt_deactivate() {
155
+ delete_option('googlelanguagetranslator_active', 1);
156
+ delete_option('googlelanguagetranslator_language','en');
157
+ delete_option('googlelanguagetranslator_language_option','all');
158
+ delete_option('googlelanguagetranslator_flags','show_flags');
159
+ delete_option('language_display_settings',array ('en' => 1));
160
+ delete_option('flag_display_settings',array ('flag-en' => 1));
161
+ delete_option('googlelanguagetranslator_translatebox','yes');
162
+ delete_option('googlelanguagetranslator_display','Vertical');
163
+ delete_option('googlelanguagetranslator_toolbar','Yes');
164
+ delete_option('googlelanguagetranslator_showbranding','Yes');
165
+ delete_option('googlelanguagetranslator_flags_alignment','flags_left');
166
+ delete_option('googlelanguagetranslator_analytics',1);
167
+ delete_option('googlelanguagetranslator_analytics_id','');
168
+ delete_option('googlelanguagetranslator_css','');
169
+ delete_option('googlelanguagetranslator_multilanguage',0);
170
+ delete_option('googlelanguagetranslator_floating_widget','yes');
171
+ delete_option('googlelanguagetranslator_flag_size','18');
172
+ delete_option('googlelanguagetranslator_flags_order','');
173
+ }
174
+
175
+ public function glt_settings_link ( $links ) {
176
+ $settings_link = array(
177
+ '<a href="' . admin_url( 'options-general.php?page=google_language_translator' ) . '">Settings</a>',
178
+ );
179
+ return array_merge( $links, $settings_link );
180
+ }
181
+
182
+ public function add_my_admin_menus(){
183
+ $p = add_options_page('Google Language Translator', 'Google Language Translator', 'manage_options', 'google_language_translator', array(&$this, 'page_layout_cb'));
184
+
185
+ add_action( 'load-' . $p, array(&$this, 'load_admin_js' ));
186
+ }
187
+
188
+ public function load_admin_js(){
189
+ add_action( 'admin_enqueue_scripts', array(&$this, 'enqueue_admin_js' ));
190
+ add_action('admin_footer',array(&$this, 'footer_script'));
191
+ }
192
+
193
+ public function enqueue_admin_js(){
194
+ wp_enqueue_script( 'my-admin-script', plugins_url('js/admin.js',__FILE__), array('jquery'));
195
+ wp_enqueue_script( 'my-flag-script', plugins_url('js/flags.js',__FILE__), array('jquery'));
196
+
197
+ if (get_option ('googlelanguagetranslator_floating_widget') == 'yes') {
198
+ wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
199
+ wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
200
+ wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
201
+ wp_enqueue_style( 'toolbar.css' );
202
+ }
203
+
204
+ wp_enqueue_script( 'jquery-ui-core');
205
+ wp_enqueue_script( 'jquery-ui-sortable');
206
+ wp_enqueue_script( 'load_sortable_flags', plugins_url('js/load-sortable-flags.js',__FILE__), array('jquery'));
207
+ wp_register_style( 'jquery-ui.css', plugins_url('css/jquery-ui.css',__FILE__) );
208
+ wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
209
+ wp_enqueue_style( 'style.css' );
210
+ //wp_enqueue_style( 'jquery-ui.css' );
211
+ }
212
+
213
+ public function flags() {
214
+ wp_enqueue_script( 'flags', plugins_url('js/flags.js',__FILE__), array('jquery'));
215
+
216
+ if (get_option ('googlelanguagetranslator_floating_widget') == 'yes') {
217
+ wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
218
+ wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
219
+ wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
220
+ wp_enqueue_style( 'toolbar.css' );
221
+ }
222
+
223
+ wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
224
+ wp_enqueue_style( 'style.css' );
225
+ }
226
+
227
+ public function load_css() {
228
+ include( plugin_dir_path( __FILE__ ) . '/css/style.php');
229
+ }
230
+
231
+ public function google_translator_shortcode() {
232
+
233
+ if (get_option('googlelanguagetranslator_display')=='Vertical'){
234
+ return $this->googlelanguagetranslator_vertical();
235
+ }
236
+ elseif(get_option('googlelanguagetranslator_display')=='Horizontal'){
237
+ return $this->googlelanguagetranslator_horizontal();
238
+ }
239
+ }
240
+
241
+ public function googlelanguagetranslator_included_languages() {
242
+ if ( get_option('googlelanguagetranslator_language_option')=='specific') {
243
+ $get_language_choices = get_option ('language_display_settings');
244
+
245
+ foreach ($get_language_choices as $key=>$value) {
246
+ if($value == 1) {
247
+ $items[] = $key;
248
+ }
249
+ }
250
+
251
+ $comma_separated = implode(",",array_values($items));
252
+
253
+ if ( get_option('googlelanguagetranslator_display') == 'Vertical') {
254
+ $lang = ", includedLanguages:'".$comma_separated."'";
255
+ return $lang;
256
+ } elseif ( get_option('googlelanguagetranslator_display') == 'Horizontal') {
257
+ $lang = ", includedLanguages:'".$comma_separated."'";
258
+ return $lang;
259
+ }
260
+ }
261
+ }
262
+
263
+ public function analytics() {
264
+ if ( get_option('googlelanguagetranslator_analytics') == 1 ) {
265
+ $analytics_id = get_option('googlelanguagetranslator_analytics_id');
266
+ $analytics = "gaTrack: true, gaId: '".$analytics_id."'";
267
+
268
+ if (!empty ($analytics_id) ):
269
+ return ', '.$analytics;
270
+ endif;
271
+ }
272
+ }
273
+
274
+ public function menu_shortcodes( $item_output,$item ) {
275
+ if ( !empty($item->description)) {
276
+ $output = do_shortcode($item->description);
277
+
278
+ if ( $output != $item->description )
279
+ $item_output = $output;
280
+ }
281
+ return $item_output;
282
+ }
283
+
284
+ public function google_translator_menu_language($atts, $content = '') {
285
+ extract(shortcode_atts(array(
286
+ "language" => 'Spanish',
287
+ "label" => 'Spanish'
288
+ ), $atts));
289
+
290
+ $default_language = get_option('googlelanguagetranslator_language');
291
+ $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
292
+ $language_code = array_search($language,$this->languages_array);
293
+ $language_name = $language;
294
+ $language_name_flag = $language_name;
295
+
296
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
297
+ $language_name_flag = 'canada';
298
+ }
299
+
300
+ return "<a class='nturl notranslate ".$language_code."' single-language flag' title='".$language."'>".$label."</a>";
301
+ }
302
+
303
+ public function footer_script() {
304
+ global $shortcode_started;
305
+ $default_language = get_option('googlelanguagetranslator_language');
306
+ $language_choices = $this->googlelanguagetranslator_included_languages();
307
+ $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
308
+ $new_languages_array = explode(",",$new_languages_array_string);
309
+ $new_languages_array_codes = array_values($new_languages_array);
310
+ $new_languages_array_count = count($new_languages_array);
311
+ $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
312
+ $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
313
+ $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
314
+ $get_language_option = get_option('googlelanguagetranslator_language_option');
315
+ $get_flag_choices = get_option ('flag_display_settings');
316
+ $get_flag_choices_count = count($get_flag_choices);
317
+ $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
318
+ $is_active = get_option ( 'googlelanguagetranslator_active' );
319
+ $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
320
+ $auto_display = ', autoDisplay: false';
321
+ $str = ''; ?>
322
+ <script>jQuery(document).ready(function(a){a("a.nturl").on("click",function(){function l(){doGoogleLanguageTranslator(default_lang+"|"+default_lang)}function n(){doGoogleLanguageTranslator(default_lang+"|"+lang_prefix)}default_lang="<?php echo get_option('googlelanguagetranslator_language'); ?>",lang_prefix=a(this).attr("class").split(" ")[2],lang_prefix==default_lang?l():n()}),a("a.flag").on("click",function(){function l(){doGoogleLanguageTranslator(default_lang+"|"+default_lang)}function n(){doGoogleLanguageTranslator(default_lang+"|"+lang_prefix)}default_lang="<?php echo get_option('googlelanguagetranslator_language'); ?>",lang_prefix=a(this).attr("class").split(" ")[2],a(".tool-container").hide(),lang_prefix==default_lang?l():n()}),0==a("body > #google_language_translator").length&&a("#glt-footer").html("<div id='google_language_translator'></div>")});</script>
323
+
324
+ <?php
325
+
326
+ if( $is_active == 1) {
327
+
328
+ foreach ($get_flag_choices as $flag_choice_key) {}
329
+
330
+ if ($floating_widget=='yes' && $get_language_option != 'specific') {
331
+ $str.='<div id="glt-translate-trigger"><span class="notranslate">Translate &raquo;</span></div>';
332
+ $str.='<div id="glt-toolbar"></div>';
333
+ } //endif $floating_widget
334
+
335
+ if ($shortcode_started != 'true') {
336
+ $str.='<div id="flags" style="display:none">';
337
+ $str.='<ul id="sortable" class="ui-sortable">';
338
+
339
+ if ((empty($new_languages_array_string)) || ($new_languages_array_count != $get_flag_choices_count)) {
340
+ foreach ($this->languages_array as $key=>$value) {
341
+ $language_code = $key;
342
+ $language_name = $value;
343
+ $language_name_flag = $language_name;
344
+
345
+ if ($flag_choice_key == '1') {
346
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
347
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
348
+ $language_name_flag = 'canada';
349
+ }
350
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
351
+ $language_name_flag = 'united-states';
352
+ }
353
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
354
+ $language_name_flag = 'mexico';
355
+ }
356
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
357
+ $language_name_flag = 'brazil';
358
+ }
359
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
360
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
361
+ }
362
+ } //isset
363
+ } //endif
364
+ } //endforeach
365
+
366
+ } else {
367
+ foreach ($new_languages_array_codes as $value) {
368
+ $language_name = $value;
369
+ $language_code = array_search ($language_name,$this->languages_array);
370
+ $language_name_flag = $language_name;
371
+
372
+ if ($flag_choice_key == '1') {
373
+ if (in_array($language_name,$this->languages_array)) {
374
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
375
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
376
+ $language_name_flag = 'canada';
377
+ }
378
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
379
+ $language_name_flag = 'united-states';
380
+ }
381
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
382
+ $language_name_flag = 'mexico';
383
+ }
384
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
385
+ $language_name_flag = 'brazil';
386
+ }
387
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
388
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
389
+ }
390
+ } //isset
391
+ } //in_array
392
+ }//flag_choice_key
393
+ }//foreach
394
+ }//endif
395
+ $str.='</ul>';
396
+ $str.='</div>';
397
+ }
398
+ }
399
+
400
+ $language_choices = $this->googlelanguagetranslator_included_languages();
401
+ $layout = get_option('googlelanguagetranslator_display');
402
+ $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
403
+ $horizontal_layout = ', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL';
404
+ $auto_display = ', autoDisplay: false';
405
+ $default_language = get_option('googlelanguagetranslator_language');
406
+
407
+ if ($is_multilanguage == 1) {
408
+ $multilanguagePage = ', multilanguagePage:true';
409
+ $str.="<div id='glt-footer'></div><script type='text/javascript'>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : '') . $auto_display . $multilanguagePage . $this->analytics()."}, 'google_language_translator');}</script>";
410
+ $str.="<script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit'></script>";
411
+ echo $str;
412
+
413
+ } elseif ($is_multilanguage == 0) {
414
+ $str.="<div id='glt-footer'></div><script type='text/javascript'>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : '') . $auto_display . $this->analytics()."}, 'google_language_translator');}</script>";
415
+ $str.="<script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit'></script>";
416
+ echo $str;
417
+ }
418
+ }
419
+
420
+ public function googlelanguagetranslator_vertical() {
421
+
422
+ global $shortcode_started;
423
+
424
+ $shortcode_started = 'true';
425
+ $get_flag_choices = get_option ('flag_display_settings');
426
+ $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
427
+ $new_languages_array = explode(",",$new_languages_array_string);
428
+ $new_languages_array_codes = array_values($new_languages_array);
429
+ $new_languages_array_count = count($new_languages_array);
430
+ $get_flag_choices_count = count($get_flag_choices);
431
+ $get_language_choices = get_option ('language_display_settings');
432
+ $flag_width = get_option('googlelanguagetranslator_flag_size');
433
+ $default_language_code = get_option('googlelanguagetranslator_language');
434
+ $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
435
+ $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
436
+ $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
437
+ $is_active = get_option ( 'googlelanguagetranslator_active' );
438
+ $get_language_option = get_option('googlelanguagetranslator_language_option');
439
+ $language_choices = $this->googlelanguagetranslator_included_languages();
440
+ $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
441
+ $str = '';
442
+
443
+ if( $is_active == 1){
444
+
445
+ foreach ($get_flag_choices as $flag_choice_key) {}
446
+
447
+ $str.='<div id="flags" class="size'.$flag_width.'">';
448
+ $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
449
+
450
+ if ((empty($new_languages_array_string)) || ($new_languages_array_count != $get_flag_choices_count)) {
451
+ foreach ($this->languages_array as $key=>$value) {
452
+ $language_code = $key;
453
+ $language_name = $value;
454
+ $language_name_flag = $language_name;
455
+ if ($flag_choice_key == '1') {
456
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
457
+ $language_name_flag = 'canada';
458
+ }
459
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
460
+ $language_name_flag = 'united-states';
461
+ }
462
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
463
+ $language_name_flag = 'mexico';
464
+ }
465
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
466
+ $language_name_flag = 'brazil';
467
+ }
468
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
469
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
470
+ }
471
+ } //$key
472
+ }//foreach
473
+ } else {
474
+ foreach ($new_languages_array_codes as $value) {
475
+ $language_name = $value;
476
+ $language_code = array_search ($language_name,$this->languages_array);
477
+ $language_name_flag = $language_name;
478
+ if ($flag_choice_key == '1') {
479
+ if (in_array($language_name,$this->languages_array)) {
480
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
481
+ $language_name_flag = 'canada';
482
+ }
483
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
484
+ $language_name_flag = 'united-states';
485
+ }
486
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
487
+ $language_name_flag = 'mexico';
488
+ }
489
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
490
+ $language_name_flag = 'brazil';
491
+ }
492
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
493
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
494
+ } //isset
495
+ } //in_array
496
+ }//flag_choice_key
497
+ }//foreach
498
+ }//endif
499
+ $str.='</ul>';
500
+ $str.='</div>';
501
+ $str.='<div id="google_language_translator"></div>';
502
+ return $str;
503
+ } //End is_active
504
+ } // End glt_vertical
505
+
506
+ public function googlelanguagetranslator_horizontal(){
507
+ $shortcode_started = true;
508
+ $get_flag_choices = get_option ('flag_display_settings');
509
+ $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
510
+ $new_languages_array = explode(",",$new_languages_array_string);
511
+ $new_languages_array_codes = array_values($new_languages_array);
512
+ $new_languages_array_count = count($new_languages_array);
513
+ $get_flag_choices_count = count($get_flag_choices);
514
+ $get_language_choices = get_option ('language_display_settings');
515
+ $flag_width = get_option('googlelanguagetranslator_flag_size');
516
+ $default_language_code = get_option('googlelanguagetranslator_language');
517
+ $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
518
+ $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
519
+ $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
520
+ $is_active = get_option ( 'googlelanguagetranslator_active' );
521
+ $get_language_option = get_option('googlelanguagetranslator_language_option');
522
+ $language_choices = $this->googlelanguagetranslator_included_languages();
523
+ $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
524
+ $str = '';
525
+
526
+ if( $is_active == 1) {
527
+ foreach ($get_flag_choices as $flag_choice_key) {}
528
+ $str.='<div id="flags" class="size'.$flag_width.'">';
529
+ $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
530
+
531
+ if ((empty($new_languages_array_string)) || ($new_languages_array_count != $get_flag_choices_count)) {
532
+ foreach ($this->languages_array as $key=>$value) {
533
+ $language_code = $key;
534
+ $language_name = $value;
535
+ $language_name_flag = $language_name;
536
+
537
+ if ($flag_choice_key == '1') {
538
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
539
+ $language_name_flag = 'canada';
540
+ }
541
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
542
+ $language_name_flag = 'united-states';
543
+ }
544
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
545
+ $language_name_flag = 'mexico';
546
+ }
547
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
548
+ $language_name_flag = 'brazil';
549
+ }
550
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
551
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
552
+ } //endif
553
+ } //$key
554
+ } //foreach
555
+ } else {
556
+ foreach ($new_languages_array_codes as $value) {
557
+ $language_name = $value;
558
+ $language_code = array_search ($language_name,$this->languages_array);
559
+ $language_name_flag = $language_name;
560
+ if ($flag_choice_key == '1') {
561
+ if (in_array($language_name,$this->languages_array)) {
562
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
563
+ $language_name_flag = 'canada';
564
+ }
565
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
566
+ $language_name_flag = 'united-states';
567
+ }
568
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
569
+ $language_name_flag = 'mexico';
570
+ }
571
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
572
+ $language_name_flag = 'brazil';
573
+ }
574
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
575
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
576
+ } //isset
577
+ } //in_array
578
+ } //endif
579
+ }//foreach
580
+ }//endif
581
+ $str.='</ul>';
582
+ $str.='</div>';
583
+ $str.='<div id="google_language_translator"></div>';
584
+ return $str;
585
+ }
586
+ } // End glt_horizontal
587
+
588
+ public function initialize_settings() {
589
+ add_settings_section('glt_settings','Settings','','google_language_translator');
590
+
591
+ $settings_name_array = array (
592
+ 'googlelanguagetranslator_active','googlelanguagetranslator_language','googlelanguagetranslator_language_option','language_display_settings','googlelanguagetranslator_flags','flag_display_settings','googlelanguagetranslator_translatebox','googlelanguagetranslator_display','googlelanguagetranslator_toolbar','googlelanguagetranslator_showbranding','googlelanguagetranslator_flags_alignment','googlelanguagetranslator_analytics','googlelanguagetranslator_analytics_id','googlelanguagetranslator_css','googlelanguagetranslator_multilanguage','googlelanguagetranslator_floating_widget','googlelanguagetranslator_flag_size','googlelanguagetranslator_flags_order','googlelanguagetranslator_english_flag_choice','googlelanguagetranslator_spanish_flag_choice','googlelanguagetranslator_portuguese_flag_choice'
593
+ );
594
+
595
+ $settings_callback_array = array ( 'googlelanguagetranslator_active_cb','googlelanguagetranslator_language_cb','googlelanguagetranslator_language_option_cb','language_display_settings_cb','googlelanguagetranslator_flags_cb','flag_display_settings_cb','googlelanguagetranslator_translatebox_cb','googlelanguagetranslator_display_cb','googlelanguagetranslator_toolbar_cb','googlelanguagetranslator_showbranding_cb','googlelanguagetranslator_flags_alignment_cb','googlelanguagetranslator_analytics_cb','googlelanguagetranslator_analytics_id_cb','googlelanguagetranslator_css_cb','googlelanguagetranslator_multilanguage_cb','googlelanguagetranslator_floating_widget_cb','googlelanguagetranslator_flag_size_cb','googlelanguagetranslator_flags_order_cb','googlelanguagetranslator_english_flag_choice_cb','googlelanguagetranslator_spanish_flag_choice_cb','googlelanguagetranslator_portuguese_flag_choice_cb'
596
+ );
597
+
598
+ foreach ($settings_name_array as $setting) {
599
+ add_settings_field( $setting,'',$setting.'_cb','google_language_translator','glt_settings');
600
+ register_setting( 'google_language_translator',$setting);
601
+ }
602
+ }
603
+
604
+ public function googlelanguagetranslator_active_cb() {
605
+ $option_name = 'googlelanguagetranslator_active' ;
606
+ $new_value = 1;
607
+ if ( get_option( $option_name ) === false ) {
608
+
609
+ // The option does not exist, so we update it.
610
+ update_option( $option_name, $new_value );
611
+ }
612
+
613
+ $options = get_option (''.$option_name.'');
614
+
615
+ $html = '<input type="checkbox" name="googlelanguagetranslator_active" id="googlelanguagetranslator_active" value="1" '.checked(1,$options,false).'/> &nbsp; Check this box to activate';
616
+ echo $html;
617
+ }
618
+
619
+ public function googlelanguagetranslator_language_cb() {
620
+
621
+ $option_name = 'googlelanguagetranslator_language';
622
+ $new_value = 'en';
623
+
624
+ if ( get_option( $option_name ) === false ) {
625
+
626
+ // The option does not exist, so we update it.
627
+ update_option( $option_name, $new_value );
628
+ }
629
+
630
+ $options = get_option (''.$option_name.''); ?>
631
+
632
+ <select name="googlelanguagetranslator_language" id="googlelanguagetranslator_language">
633
+
634
+ <?php
635
+
636
+ foreach ($this->languages_array as $key => $value) {
637
+ $language_code = $key;
638
+ $language_name = $value; ?>
639
+ <option value="<?php echo $language_code; ?>" <?php if($options==''.$language_code.''){echo "selected";}?>><?php echo $language_name; ?></option>
640
+ <?php } ?>
641
+ </select>
642
+ <?php
643
+ }
644
+
645
+ public function googlelanguagetranslator_language_option_cb() {
646
+
647
+ $option_name = 'googlelanguagetranslator_language_option' ;
648
+ $new_value = 'all';
649
+
650
+ if ( get_option( $option_name ) === false ) {
651
+
652
+ // The option does not exist, so we update it.
653
+ update_option( $option_name, $new_value );
654
+ }
655
+
656
+ $options = get_option (''.$option_name.''); ?>
657
+
658
+ <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="all" <?php if($options=='all'){echo "checked";}?>/> All Languages<br/>
659
+ <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="specific" <?php if($options=='specific'){echo "checked";}?>/> Specific Languages
660
+ <?php
661
+ }
662
+
663
+ public function language_display_settings_cb() {
664
+ $default_language_code = get_option('googlelanguagetranslator_language');
665
+ $option_name = 'language_display_settings';
666
+ $new_value = array(''.$default_language_code.'' => 1);
667
+
668
+ if ( get_option( $option_name ) == false ) {
669
+ // The option does not exist, so we update it.
670
+ update_option( $option_name, $new_value );
671
+ }
672
+
673
+ $get_language_choices = get_option (''.$option_name.'');
674
+
675
+ foreach ($this->languages_array as $key => $value) {
676
+ $language_code = $key;
677
+ $language_name = $value;
678
+ $language_code_array[] = $key;
679
+
680
+ if (!isset($get_language_choices[''.$language_code.''])) {
681
+ $get_language_choices[''.$language_code.''] = 0;
682
+ }
683
+
684
+ $items[] = $get_language_choices[''.$language_code.''];
685
+ $language_codes = $language_code_array;
686
+ $item_count = count($items);
687
+
688
+ if ($item_count == 1 || $item_count == 24 || $item_count == 47 || $item_count == 70) { ?>
689
+ <div class="languages" style="width:25%; float:left">
690
+ <?php } ?>
691
+ <div><input type="checkbox" name="language_display_settings[<?php echo $language_code; ?>]" value="1"<?php checked( 1,$get_language_choices[''.$language_code.'']); ?>/><?php echo $language_name; ?></div>
692
+ <?php
693
+ if ($item_count == 23 || $item_count == 46 || $item_count == 69 || $item_count == 91) { ?>
694
+ </div>
695
+ <?php }
696
+ } ?>
697
+ <div class="clear"></div>
698
+ <?php
699
+ }
700
+
701
+ public function googlelanguagetranslator_flags_cb() {
702
+
703
+ $option_name = 'googlelanguagetranslator_flags' ;
704
+ $new_value = 'show_flags';
705
+
706
+ if ( get_option( $option_name ) === false ) {
707
+
708
+ // The option does not exist, so we update it.
709
+ update_option( $option_name, $new_value );
710
+ }
711
+
712
+ $options = get_option (''.$option_name.''); ?>
713
+
714
+ <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="show_flags" <?php if($options=='show_flags'){echo "checked";}?>/> Yes, show flag images<br/>
715
+ <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="hide_flags" <?php if($options=='hide_flags'){echo "checked";}?>/> No, hide flag images
716
+ <?php
717
+ }
718
+
719
+ public function flag_display_settings_cb() {
720
+ $default_language_code = get_option('googlelanguagetranslator_language');
721
+ $option_name = 'flag_display_settings';
722
+ $new_value = array('flag-'.$default_language_code.'' => 1);
723
+
724
+ if ( get_option( $option_name ) == false ) {
725
+ // The option does not exist, so we update it.
726
+ update_option( $option_name, $new_value );
727
+ }
728
+
729
+ $get_flag_choices = get_option (''.$option_name.'');
730
+
731
+ foreach ($this->languages_array as $key => $value) {
732
+ $language_code = $key;
733
+ $language_name = $value;
734
+ $language_code_array[] = $key;
735
+
736
+ if (!isset($get_flag_choices['flag-'.$language_code.''])) {
737
+ $get_flag_choices['flag-'.$language_code.''] = 0;
738
+ }
739
+
740
+ $items[] = $get_flag_choices['flag-'.$language_code.''];
741
+ $language_codes = $language_code_array;
742
+ $item_count = count($items);
743
+
744
+ if ($item_count == 1 || $item_count == 24 || $item_count == 47 || $item_count == 70) { ?>
745
+ <div class="flagdisplay" style="width:25%; float:left">
746
+ <?php } ?>
747
+ <div><input type="checkbox" name="flag_display_settings[flag-<?php echo $language_code; ?>]" value="1"<?php checked( 1,$get_flag_choices['flag-'.$language_code.'']); ?>/><?php echo $language_name; ?></div>
748
+ <?php
749
+ if ($item_count == 23 || $item_count == 46 || $item_count == 69 || $item_count == 91) { ?>
750
+ </div>
751
+ <?php }
752
+ } ?>
753
+ <div class="clear"></div>
754
+ <?php
755
+ }
756
+
757
+ public function googlelanguagetranslator_floating_widget_cb() {
758
+
759
+ $option_name = 'googlelanguagetranslator_floating_widget' ;
760
+ $new_value = 'yes';
761
+
762
+ if ( get_option( $option_name ) === false ) {
763
+
764
+ // The option does not exist, so we update it.
765
+ update_option( $option_name, $new_value );
766
+ }
767
+
768
+ $options = get_option (''.$option_name.''); ?>
769
+
770
+ <select name="googlelanguagetranslator_floating_widget" id="googlelanguagetranslator_floating_widget" style="width:170px">
771
+ <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show widget</option>
772
+ <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide widget</option>
773
+ </select>
774
+ <?php }
775
+
776
+ public function googlelanguagetranslator_translatebox_cb() {
777
+
778
+ $option_name = 'googlelanguagetranslator_translatebox' ;
779
+ $new_value = 'yes';
780
+
781
+ if ( get_option( $option_name ) === false ) {
782
+
783
+ // The option does not exist, so we update it.
784
+ update_option( $option_name, $new_value );
785
+ }
786
+
787
+ $options = get_option (''.$option_name.''); ?>
788
+
789
+ <select name="googlelanguagetranslator_translatebox" id="googlelanguagetranslator_translatebox" style="width:190px">
790
+ <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show language box</option>
791
+ <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide language box</option>
792
+ </select>
793
+ <?php }
794
+
795
+ public function googlelanguagetranslator_display_cb() {
796
+
797
+ $option_name = 'googlelanguagetranslator_display' ;
798
+ $new_value = 'Vertical';
799
+
800
+ if ( get_option( $option_name ) === false ) {
801
+
802
+ // The option does not exist, so we update it.
803
+ update_option( $option_name, $new_value );
804
+ }
805
+
806
+ $options = get_option (''.$option_name.''); ?>
807
+
808
+ <select name="googlelanguagetranslator_display" id="googlelanguagetranslator_display" style="width:170px;">
809
+ <option value="Vertical" <?php if(get_option('googlelanguagetranslator_display')=='Vertical'){echo "selected";}?>>Vertical</option>
810
+ <option value="Horizontal" <?php if(get_option('googlelanguagetranslator_display')=='Horizontal'){echo "selected";}?>>Horizontal</option>
811
+ </select>
812
+ <?php }
813
+
814
+ public function googlelanguagetranslator_toolbar_cb() {
815
+
816
+ $option_name = 'googlelanguagetranslator_toolbar' ;
817
+ $new_value = 'Yes';
818
+
819
+ if ( get_option( $option_name ) === false ) {
820
+
821
+ // The option does not exist, so we update it.
822
+ update_option( $option_name, $new_value );
823
+ }
824
+
825
+ $options = get_option (''.$option_name.''); ?>
826
+
827
+ <select name="googlelanguagetranslator_toolbar" id="googlelanguagetranslator_toolbar" style="width:170px;">
828
+ <option value="Yes" <?php if(get_option('googlelanguagetranslator_toolbar')=='Yes'){echo "selected";}?>>Yes</option>
829
+ <option value="No" <?php if(get_option('googlelanguagetranslator_toolbar')=='No'){echo "selected";}?>>No</option>
830
+ </select>
831
+ <?php }
832
+
833
+ public function googlelanguagetranslator_showbranding_cb() {
834
+
835
+ $option_name = 'googlelanguagetranslator_showbranding' ;
836
+ $new_value = 'Yes';
837
+
838
+ if ( get_option( $option_name ) === false ) {
839
+
840
+ // The option does not exist, so we update it.
841
+ update_option( $option_name, $new_value );
842
+ }
843
+
844
+ $options = get_option (''.$option_name.''); ?>
845
+
846
+ <select name="googlelanguagetranslator_showbranding" id="googlelanguagetranslator_showbranding" style="width:170px;">
847
+ <option value="Yes" <?php if(get_option('googlelanguagetranslator_showbranding')=='Yes'){echo "selected";}?>>Yes</option>
848
+ <option value="No" <?php if(get_option('googlelanguagetranslator_showbranding')=='No'){echo "selected";}?>>No</option>
849
+ </select>
850
+ <?php }
851
+
852
+ public function googlelanguagetranslator_flags_alignment_cb() {
853
+
854
+ $option_name = 'googlelanguagetranslator_flags_alignment' ;
855
+ $new_value = 'flags_left';
856
+
857
+ if ( get_option( $option_name ) === false ) {
858
+
859
+ // The option does not exist, so we update it.
860
+ update_option( $option_name, 'flags_left' );
861
+ }
862
+
863
+ $options = get_option (''.$option_name.''); ?>
864
+
865
+ <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_left" value="flags_left" <?php if($options=='flags_left'){echo "checked";}?>/> Align Left<br/>
866
+ <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_right" value="flags_right" <?php if($options=='flags_right'){echo "checked";}?>/> Align Right
867
+ <?php }
868
+
869
+ public function googlelanguagetranslator_analytics_cb() {
870
+
871
+ $option_name = 'googlelanguagetranslator_analytics' ;
872
+ $new_value = 0;
873
+
874
+ if ( get_option( $option_name ) === false ) {
875
+
876
+ // The option does not exist, so we update it.
877
+ update_option( $option_name, $new_value );
878
+ }
879
+
880
+ $options = get_option (''.$option_name.'');
881
+
882
+ $html = '<input type="checkbox" name="googlelanguagetranslator_analytics" id="googlelanguagetranslator_analytics" value="1" '.checked(1,$options,false).'/> &nbsp; Activate Google Analytics tracking?';
883
+ echo $html;
884
+ }
885
+
886
+ public function googlelanguagetranslator_analytics_id_cb() {
887
+
888
+ $option_name = 'googlelanguagetranslator_analytics_id' ;
889
+ $new_value = '';
890
+
891
+ if ( get_option( $option_name ) === false ) {
892
+
893
+ // The option does not exist, so we update it.
894
+ update_option( $option_name, $new_value );
895
+ }
896
+
897
+ $options = get_option (''.$option_name.'');
898
+
899
+ $html = '<input type="text" name="googlelanguagetranslator_analytics_id" id="googlelanguagetranslator_analytics_id" value="'.$options.'" />';
900
+ echo $html;
901
+ }
902
+
903
+ public function googlelanguagetranslator_flag_size_cb() {
904
+
905
+ $option_name = 'googlelanguagetranslator_flag_size' ;
906
+ $new_value = '18';
907
+
908
+ if ( get_option( $option_name ) === false ) {
909
+
910
+ // The option does not exist, so we update it.
911
+ update_option( $option_name, $new_value );
912
+ }
913
+
914
+ $options = get_option (''.$option_name.''); ?>
915
+
916
+ <select name="googlelanguagetranslator_flag_size" id="googlelanguagetranslator_flag_size" style="width:110px;">
917
+ <option value="16" <?php if($options=='16'){echo "selected";}?>>16px</option>
918
+ <option value="18" <?php if($options=='18'){echo "selected";}?>>18px</option>
919
+ <option value="20" <?php if($options=='20'){echo "selected";}?>>20px</option>
920
+ <option value="22" <?php if($options=='22'){echo "selected";}?>>22px</option>
921
+ <option value="24" <?php if($options=='24'){echo "selected";}?>>24px</option>
922
+ </select>
923
+ <?php }
924
+
925
+ public function googlelanguagetranslator_flags_order_cb() {
926
+ $option_name = 'googlelanguagetranslator_flags_order';
927
+ $new_value = '';
928
+
929
+ if ( get_option ( $option_name ) === false ) {
930
+
931
+ // The option does not exist, so we update it.
932
+ update_option( $option_name, $new_value );
933
+ }
934
+
935
+ $options = get_option ( ''.$option_name.'' ); ?>
936
+
937
+ <input type="hidden" id="order" name="googlelanguagetranslator_flags_order" value="<?php print_r(get_option('googlelanguagetranslator_flags_order')); ?>" />
938
+ <?php
939
+ }
940
+
941
+ public function googlelanguagetranslator_english_flag_choice_cb() {
942
+ $option_name = 'googlelanguagetranslator_english_flag_choice';
943
+ $new_value = 'us_flag';
944
+
945
+ if ( get_option ( $option_name ) === false ) {
946
+
947
+ // The option does not exist, so we update it.
948
+ update_option( $option_name, $new_value );
949
+ }
950
+
951
+ $options = get_option ( ''.$option_name.'' ); ?>
952
+
953
+ <select name="googlelanguagetranslator_english_flag_choice" id="googlelanguagetranslator_english_flag_choice">
954
+ <option value="us_flag" <?php if($options=='us_flag'){echo "selected";}?>>U.S. Flag</option>
955
+ <option value="uk_flag" <?php if ($options=='uk_flag'){echo "selected";}?>>U.K Flag</option>
956
+ <option value="canadian_flag" <?php if ($options=='canadian_flag'){echo "selected";}?>>Canadian Flag</option>
957
+ </select>
958
+ <?php
959
+ }
960
+
961
+ public function googlelanguagetranslator_spanish_flag_choice_cb() {
962
+ $option_name = 'googlelanguagetranslator_spanish_flag_choice';
963
+ $new_value = 'spanish_flag';
964
+
965
+ if ( get_option ( $option_name ) === false ) {
966
+
967
+ // The option does not exist, so we update it.
968
+ update_option( $option_name, $new_value );
969
+ }
970
+
971
+ $options = get_option ( ''.$option_name.'' ); ?>
972
+
973
+ <select name="googlelanguagetranslator_spanish_flag_choice" id="googlelanguagetranslator_spanish_flag_choice">
974
+ <option value="spanish_flag" <?php if($options=='spanish_flag'){echo "selected";}?>>Spanish Flag</option>
975
+ <option value="mexican_flag" <?php if ($options=='mexican_flag'){echo "selected";}?>>Mexican Flag</option>
976
+ </select>
977
+ <?php
978
+ }
979
+
980
+ public function googlelanguagetranslator_portuguese_flag_choice_cb() {
981
+ $option_name = 'googlelanguagetranslator_portuguese_flag_choice';
982
+ $new_value = 'portuguese_flag';
983
+
984
+ if ( get_option ( $option_name ) === false ) {
985
+
986
+ // The option does not exist, so we update it.
987
+ update_option( $option_name, $new_value );
988
+ }
989
+
990
+ $options = get_option ( ''.$option_name.'' ); ?>
991
+
992
+ <select name="googlelanguagetranslator_portuguese_flag_choice" id="googlelanguagetranslator_spanish_flag_choice">
993
+ <option value="portuguese_flag" <?php if($options=='portuguese_flag'){echo "selected";}?>>Portuguese Flag</option>
994
+ <option value="brazilian_flag" <?php if ($options=='brazilian_flag'){echo "selected";}?>>Brazilian Flag</option>
995
+ </select>
996
+ <?php
997
+ }
998
+
999
+ public function googlelanguagetranslator_css_cb() {
1000
+
1001
+ $option_name = 'googlelanguagetranslator_css' ;
1002
+ $new_value = '';
1003
+
1004
+ if ( get_option( $option_name ) === false ) {
1005
+
1006
+ // The option does not exist, so we update it.
1007
+ update_option( $option_name, $new_value );
1008
+ }
1009
+
1010
+ $options = get_option (''.$option_name.'');
1011
+
1012
+ $html = '<textarea style="width:100%; height:200px" name="googlelanguagetranslator_css" id="googlelanguagetranslator_css">'.$options.'</textarea>';
1013
+ echo $html;
1014
+ }
1015
+
1016
+ public function googlelanguagetranslator_multilanguage_cb() {
1017
+
1018
+ $option_name = 'googlelanguagetranslator_multilanguage' ;
1019
+ $new_value = 0;
1020
+
1021
+ if ( get_option( $option_name ) === false ) {
1022
+
1023
+ // The option does not exist, so we update it.
1024
+ update_option( $option_name, $new_value );
1025
+ }
1026
+
1027
+ $options = get_option (''.$option_name.'');
1028
+
1029
+ $html = '<input type="checkbox" name="googlelanguagetranslator_multilanguage" id="googlelanguagetranslator_multilanguage" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on multilanguage mode?';
1030
+ echo $html;
1031
+ }
1032
+
1033
+ public function googlelanguagetranslator_exclude_translation_cb() {
1034
+
1035
+ $option_name = 'googlelanguagetranslator_exclude_translation';
1036
+ $new_value = '';
1037
+
1038
+ if (get_option($option_name) === false ) {
1039
+ // The option does not exist, so we update it.
1040
+ update_option( $option_name, $new_value );
1041
+ }
1042
+
1043
+ $options = get_option (''.$option_name.'');
1044
+
1045
+ $html = '<input type="text" name="'.$option_name.'" id="'.$option_name.'" value="'.$options.'" />';
1046
+
1047
+ echo $html;
1048
+ }
1049
+
1050
+ public function page_layout_cb() {
1051
+ include( plugin_dir_path( __FILE__ ) . '/css/style.php'); ?>
1052
+ <?php add_thickbox(); ?>
1053
+ <div class="wrap">
1054
+ <div id="icon-options-general" class="icon32"></div>
1055
+ <h2><span class="notranslate">Google Language Translator</span></h2>
1056
+ <form action="<?php echo admin_url( '/options.php'); ?>" method="post">
1057
+ <div class="metabox-holder has-right-sidebar" style="float:left; width:65%">
1058
+ <div class="postbox" style="width: 100%">
1059
+ <h3 class="notranslate">Settings</h3>
1060
+
1061
+ <?php settings_fields('google_language_translator'); ?>
1062
+ <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1063
+ <tr>
1064
+ <td style="width:60%" class="notranslate">Plugin Status:</td>
1065
+ <td class="notranslate"><?php $this->googlelanguagetranslator_active_cb(); ?></td>
1066
+ </tr>
1067
+
1068
+ <tr class="notranslate">
1069
+ <td>Choose the original language of your website</td>
1070
+ <td><?php $this->googlelanguagetranslator_language_cb(); ?></td>
1071
+ </tr>
1072
+
1073
+ <tr class="notranslate">
1074
+ <td>What translation languages will display in the language box?<br/>("All Languages" option <strong><u>must</u></strong> be chosen to show flags.)</td>
1075
+ <td><?php $this->googlelanguagetranslator_language_option_cb(); ?></td>
1076
+ </tr>
1077
+
1078
+ <tr class="notranslate languages">
1079
+ <td colspan="2"><?php $this->language_display_settings_cb(); ?></td>
1080
+ </tr>
1081
+
1082
+ <tr class="notranslate">
1083
+ <td class="choose_flags_intro">Show flag images?<br/>(Display up to 91 flags above the translator)</td>
1084
+ <td class="choose_flags_intro"><?php $this->googlelanguagetranslator_flags_cb(); ?></td>
1085
+ </tr>
1086
+
1087
+ <tr class="notranslate choose_flags">
1088
+ <td class="choose_flags">Choose the flags you want to display:</td>
1089
+ <td></td>
1090
+ </tr>
1091
+
1092
+ <tr class="notranslate">
1093
+ <td colspan="2" class="choose_flags"><?php $this->flag_display_settings_cb(); ?></td>
1094
+ </tr>
1095
+
1096
+ <tr class="notranslate">
1097
+ <td>Show floating translation widget?<br/>
1098
+ <span>("All Languages" option <strong><u>must</u></strong> be chosen to show widget.)</span>
1099
+ </td>
1100
+ <td><?php $this->googlelanguagetranslator_floating_widget_cb(); ?></td>
1101
+ </tr>
1102
+
1103
+ <tr class="notranslate">
1104
+ <td>Show translate box?</td>
1105
+ <td><?php $this->googlelanguagetranslator_translatebox_cb(); ?></td>
1106
+ </tr>
1107
+
1108
+ <tr class="notranslate">
1109
+ <td>Layout option:</td>
1110
+ <td><?php $this->googlelanguagetranslator_display_cb(); ?></td>
1111
+ </tr>
1112
+
1113
+ <tr class="notranslate">
1114
+ <td>Show Google Toolbar?</td>
1115
+ <td><?php $this->googlelanguagetranslator_toolbar_cb(); ?></td>
1116
+ </tr>
1117
+
1118
+ <tr class="notranslate">
1119
+ <td>Show Google Branding? &nbsp;<a href="https://developers.google.com/translate/v2/attribution" target="_blank">Learn more</a></td>
1120
+ <td><?php $this->googlelanguagetranslator_showbranding_cb(); ?></td>
1121
+ </tr>
1122
+
1123
+ <tr class="alignment notranslate">
1124
+ <td class="flagdisplay">Align the translator left or right?</td>
1125
+ <td class="flagdisplay"><?php $this->googlelanguagetranslator_flags_alignment_cb(); ?></td>
1126
+ </tr>
1127
+
1128
+
1129
+
1130
+ <tr class="multilanguage notranslate">
1131
+ <td>Multilanguage Page option? &nbsp;<a href="#TB_inline?width=200&height=150&inlineId=multilanguage-page-description" title="What is the Multi-Language Page Option?" class="thickbox">Learn more</a><div id="multilanguage-page-description" style="display:none"><p>If you activate this setting, Google will translate all text into a single language when requested by your user, even if text is written in multiple languages. In most cases, this setting is not recommended, although for certain websites it might be necessary.</p></div></td>
1132
+ <td><?php $this->googlelanguagetranslator_multilanguage_cb(); ?></td>
1133
+ </tr>
1134
+
1135
+ <tr class="notranslate">
1136
+ <td>Google Analytics:</td>
1137
+ <td><?php $this->googlelanguagetranslator_analytics_cb(); ?></td>
1138
+ </tr>
1139
+
1140
+ <tr class="analytics notranslate">
1141
+ <td>Google Analytics ID (Ex. 'UA-11117410-2')</td>
1142
+ <td><?php $this->googlelanguagetranslator_analytics_id_cb(); ?></td>
1143
+ </tr>
1144
+
1145
+ <tr class="notranslate">
1146
+ <td>Full widget usage in pages/posts/sidebar:</td>
1147
+ <td><code>[google-translator]</code></td>
1148
+ </tr>
1149
+ </table>
1150
+
1151
+ <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1152
+ <tr class="notranslate">
1153
+ <td style="width:40%">Full widget usage in header/footer or page template:</td>
1154
+ <td style="width:60%"><code>&lt;?php echo do_shortcode('[google-translator]'); ?&gt;</code></td>
1155
+ </tr>
1156
+
1157
+ <tr class="notranslate">
1158
+ <td>Single language usage in<br/>nav menu/pages/posts</td>
1159
+ <td><code>[glt language="Spanish" label="Español"]</code></td>
1160
+ </tr>
1161
+
1162
+ <tr class="notranslate">
1163
+ <td colspan="2">
1164
+ <a href="#TB_inline?width=200&height=450&inlineId=single-language-shortcode-description" title="How to place a single language in your Wordpress menu" class="thickbox">How to place a single language in your Wordpress menu</a>
1165
+ <div id="single-language-shortcode-description" style="display:none">
1166
+ <p>For menu usage, you need to create a new menu, or use an existing menu, by navigating to "Appearance > Menus".</p>
1167
+ <p>First you will need to enable "descriptions" for your menu items, which can be found in a tab labeled "Screen Options" in the upper-right area of the page.</p>
1168
+ <p>Once descriptions are enabled, follow these steps:<br/>
1169
+ <ol>
1170
+ <li>Create a new menu item using "Link" as the menu item type.</li>
1171
+ <li>Use <code style="border:none">#</code> for the URL</li>
1172
+ <li>Enter a navigation label of your choice. This label does not appear on your website - it is meant only to help you identify the menu item.</li>
1173
+ <li>Place the following shortcode into the "description" field, and modify it to display the language and navigation label of your choice:</li>
1174
+ </ol>
1175
+ <p><code>[glt language="Spanish" label="Español"]</code></p>
1176
+ </div>
1177
+ </td>
1178
+ </tr>
1179
+
1180
+ <tr class="notranslate">
1181
+ <td>
1182
+ <?php
1183
+ if (isset($_POST['submit'])) {
1184
+ if (empty($_POST['submit']) && !check_admin_referer( 'glt-save-settings', 'glt-save-settings-nonce' )) {
1185
+ wp_die();
1186
+ } else { }
1187
+ }
1188
+ wp_nonce_field('glt-save-settings, glt-save-settings-nonce', false);
1189
+ submit_button();
1190
+ ?>
1191
+ </td>
1192
+ <td></td>
1193
+ </tr>
1194
+ </table>
1195
+ </div> <!-- .postbox -->
1196
+ </div> <!-- .metbox-holder -->
1197
+
1198
+ <div class="metabox-holder" style="float:right; clear:right; width:33%">
1199
+ <div class="postbox">
1200
+ <h3 class="notranslate">Preview</h3>
1201
+ <table style="width:100%">
1202
+ <tr>
1203
+ <td style="box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; padding:15px 15px; margin:0px"><span class="notranslate"> Drag &amp; drop flags to change their position.<br/><br/>(Note: flag order resets when flags are added/removed)</span><br/><br/><?php echo do_shortcode('[google-translator]'); ?><p class="hello"><span class="notranslate">Translated text:</span> &nbsp; <span>Hello</span></p></td>
1204
+ </tr>
1205
+
1206
+ <tr>
1207
+ <td><?php if (isset ($_POST['googlelanguagetranslator_flags_order']) ) { echo $_POST['googlelanguagetranslator_flags_order']; } ?></td>
1208
+ </tr>
1209
+
1210
+
1211
+ </table>
1212
+ </div> <!-- .postbox -->
1213
+ </div> <!-- .metabox-holder -->
1214
+
1215
+ <div id="glt_advanced_settings" class="metabox-holder notranslate" style="float: right; width: 33%;">
1216
+ <div class="postbox">
1217
+ <h3>Advanced Settings</h3>
1218
+ <div class="inside">
1219
+ <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1220
+ <tr class="notranslate">
1221
+ <td class="advanced">Select flag size:</td>
1222
+ <td class="advanced"><?php $this->googlelanguagetranslator_flag_size_cb(); ?></td>
1223
+ </tr>
1224
+
1225
+ <tr class="notranslate">
1226
+ <td class="advanced">Flag for English:</td>
1227
+ <td class="advanced"><?php $this->googlelanguagetranslator_english_flag_choice_cb(); ?></td>
1228
+ </tr>
1229
+
1230
+ <tr class="notranslate">
1231
+ <td class="advanced">Flag for Spanish:</td>
1232
+ <td class="advanced"><?php $this->googlelanguagetranslator_spanish_flag_choice_cb(); ?></td>
1233
+ </tr>
1234
+
1235
+ <tr class="notranslate">
1236
+ <td class="advanced">Flag for Portuguese:</td>
1237
+ <td class="advanced"><?php $this->googlelanguagetranslator_portuguese_flag_choice_cb(); ?></td>
1238
+ </tr>
1239
+ </table>
1240
+ </div> <!-- .inside -->
1241
+ </div> <!-- .postbox -->
1242
+ </div> <!-- #glt_advanced_settings -->
1243
+
1244
+
1245
+ <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1246
+ <div class="postbox">
1247
+ <h3>Add CSS Styles</h3>
1248
+ <div class="inside">
1249
+ <p>You can apply any necessary CSS styles below:</p>
1250
+ <?php $this->googlelanguagetranslator_css_cb(); ?>
1251
+ </div>
1252
+ </div>
1253
+ </div>
1254
+ <?php $this->googlelanguagetranslator_flags_order_cb(); ?>
1255
+ </form>
1256
+
1257
+ <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1258
+ <div class="postbox">
1259
+ <h3>GLT Premium 5.0.16 is Here! $30</h3>
1260
+ <div class="inside"><a class="wp-studio-logo" href="http://www.wp-studio.net/" target="_blank"><img style="background:#444; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; width:177px;" src="<?php echo plugins_url('google-language-translator/images/logo.png'); ?>"></a><br />
1261
+ <ul id="features" style="margin-left:15px">
1262
+ <li style="list-style:square outside"><span style="color:red; font-weight:bold">New!</span> Edit translations! (Beta)</li>
1263
+ <li style="list-style:square outside">6 Floating Widget positions</li>
1264
+ <li style="list-style:square outside">91 Languages with flags</li>
1265
+ <li style="list-style:square outside">Exclude specific areas from translation</li>
1266
+ <li style="list-style:square outside">jQuery-powered language switcher<br/>(No Adobe Flash required)</li>
1267
+ <li style="list-style:square outside">Add single languages to your menus/pages/posts</li>
1268
+ <li style="list-style:square outside">Show/hide images or text for each language</li>
1269
+ <li style="list-style:square outside">Language switcher loads inline with page content</li>
1270
+ <li style="list-style:square outside">Custom flag choices for English, Spanish and Portuguese</li>
1271
+ <li style="list-style:square outside">User-friendly URLs, hide or show <code>lang</code> attribute</li>
1272
+ <li style="list-style:square outside">Drag/drop flags to re-arrange their order</li>
1273
+ <li style="list-style:square outside">Full access to our support forum</li>
1274
+ <li style="list-style:square outside">FREE access to all future updates</li>
1275
+ </ul>
1276
+ <h4>Do you have a WordPress issue that needs a fix? Fix any single issue for only $30</h4>
1277
+ <a class="wp-helpdesk-logo" title="WP Helpdesk" href="http://wp-helpdesk.com/" target="_blank"><img style="border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px;" src="http://wp-helpdesk.com/wp-content/uploads/2015/11/wp-helpdesk-dark.jpg" alt="WP Helpdesk Logo" /></a>
1278
+ </div>
1279
+ </div>
1280
+ </div>
1281
+
1282
+ <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1283
+ <div class="postbox">
1284
+ <h3>Please Consider A Donation</h3>
1285
+ <div class="inside">If you like this plugin and find it useful, help keep this plugin actively developed by clicking the donate button <br /><br />
1286
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
1287
+ <input type="hidden" name="cmd" value="_donations">
1288
+ <input type="hidden" name="business" value="robertmyrick@hotmail.com">
1289
+ <input type="hidden" name="lc" value="US">
1290
+ <input type="hidden" name="item_name" value="Support Studio 88 Design and help us bring you more Wordpress goodies! Any donation is kindly appreciated. Thank you!">
1291
+ <input type="hidden" name="no_note" value="0">
1292
+ <input type="hidden" name="currency_code" value="USD">
1293
+ <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest">
1294
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
1295
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
1296
+ </form>
1297
+ <br />
1298
+ <br />
1299
+ </div>
1300
+ </div>
1301
+ </div>
1302
+ </div> <!-- .wrap -->
1303
+ <?php
1304
+ }
1305
+ }
1306
  $google_language_translator = new google_language_translator();
images/flags.png CHANGED
Binary file
images/flags16.png CHANGED
Binary file
images/flags18.png CHANGED
Binary file
images/flags20.png CHANGED
Binary file
images/flags22.png CHANGED
Binary file
readme.txt CHANGED
@@ -1,282 +1,286 @@
1
- === Google Language Translator ===
2
- Contributors: Rob Myrick
3
- Donate link: http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=47LFA33AC89S6
4
- Plugin link: http://www.wp-studio.net/how-it-works
5
- Tags: language translator, google translator, language translate, google, google language translator, translation, translate, multi language
6
- Requires at least: 2.9
7
- Tested up to: 4.3.1
8
- stable tag: 5.0.04
9
-
10
- Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
-
12
- == Description ==
13
-
14
- Settings include: inline or vertical layout, show/hide specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
15
-
16
- == Installation ==
17
-
18
- 1. Download the zip folder named google-language-translator.zip
19
- 2. Unzip the folder and put it in the plugins directory of your wordpress installation. (wp-content/plugins).
20
- 3. Activate the plugin through the plugin window in the admin panel.
21
- 4. Go to Settings > Google Language Translator, enable the plugin, and then choose your settings.
22
- 5. Copy the shortcode and paste it into a page, post or widget.
23
- 6. Do not use the shortcode twice on a single page - it will not work.
24
-
25
- == Frequently Asked Questions ==
26
-
27
- Q: What should I do if the translate widget does not show on my website?
28
-
29
- 1. Make sure that the plugin is installed and activated.
30
- 2. Verify that a check mark is placed in the activation setting located at "Settings > Google Language Translator".
31
- 3. Verify that the native Wordpress function, wp_footer(), is included in your theme's footer file.
32
- 4. Verify that "Show Language Box?" setting is enabled at "Settings > Google Language Translator".
33
- 5. Use your browser's web tools to ensure that CSS styles are not hiding the translation widget.
34
- 6. Contact support at http://www.wp-studio.net/submit-ticket.
35
-
36
- Q: What should I do if there are no languages being displayed in the language box?
37
-
38
- 1. Make sure that the plugin is installed and activated.
39
- 2. Verify that a check mark is placed in the activation setting located at "Settings > Google Language Translator".
40
- 3. Verify that Adobe Flash is installed in your web browser. Google uses Flash in order to display their language box.
41
- 4. Contact support at http://www.wp-studio.net/submit-ticket.
42
-
43
- Q: Can I exclude certain areas of my website from being translated?
44
-
45
- A: Yes! Add the "notranslate" class to the HTML element containing your text. For example, the following text will be excluded from translation: <span class="notranslate">Hello World!</span>
46
-
47
- == Changelog ==
48
-
49
- 5.0.04
50
- - Corrected the text on the settings page to reflect 91 total flags, instead of 81 flags.
51
-
52
- 5.0.03
53
- - Added 10 new languages and associated flags: Chichewa, Kazakh, Malagasy, Malayalam, Myanmar(Burmese), Sesotho, Sinhala, Sundanese, Tajik, and Uzbek.
54
-
55
- 5.0.02
56
- - Updated the Tamil flag to use the Indian flag, instead of Tamil Tigers flag.
57
-
58
- 5.0.01
59
- - Updated style.css to reflect the syntax error connecting to the Chinese flag.
60
-
61
- 5.0.0
62
- - Wordpress security updates added to the settings page [wp_nonce_field()].
63
- - Removed 3 outside Javascript files - these files are now called upon directly from Wordpress CMS.
64
- - Unpacked flags.js p,a,c,k,e,r code. Unknowingly, this method of coding violated Wordpress plugin policy.
65
- - Updated pricing display for GLT Premium. It was displaying $15 previously, but the price had increased since the last update.
66
-
67
- 4.0.9
68
- - Replaced: incorrect Catalonian flag image, with the correct image. I apologize for any inconvenience.
69
- - Fixed: Floating Widget issue - previously it loaded 2 times when shortcode was added, which caused it not to work.
70
-
71
- 4.0.8
72
- - Fixed the small syntax issue related to the Google Analytics tracking number - it was another cause of the language box not displaying.
73
-
74
- 4.0.7
75
- - Fixed a CSS error in the settings panel display.
76
- - Fixed the coding issue when "Specific Languages" option is chosen - the shortcode was not displaying the language dropdown.
77
-
78
- 4.0.6
79
-
80
- - Removed: "onclick" events from diplaying directly inside HTML. Converted those events to jQuery.
81
- - Fixed the shortcode that allows adding single languages to Wordpress menus. (New example is shown on settings page.)
82
- - Consolidated all flag images into image sprites!
83
- - Re-designed 10 flag images to match the quality of the other flags.
84
- - Fixed the incorrect "alt" tags associated with flag images. The "alt" tag now displays the language name.
85
- - Modified text on the settings page - also added some lightbox pop-ups to help explain settings.
86
- - New updates have also been provided for our Premium version (currently version 4.0.1) located at http://www.wp-studio.net/
87
-
88
- 4.0.5
89
-
90
- - Fixed: Display bug when using single language shortcode.
91
- - Added: New link on the Plugins menu page, which links directly to Google Language Translator settings.
92
-
93
-
94
- 4.0.4
95
-
96
- - Added NEW shortcode! Allows placement of single languages into the navigation menu, pages, and posts. See settings panel for usage details.
97
- - Re-factored code in googlelanguagetranslator.php which reduced code to around 950 lines.
98
- - Removed the "de-activation" hook, which previously deleted options when plugin de-activated. Added "uninstall" hook instead, so that settings will be preserved only when user deletes the plugin completely.
99
- - Updated CSS styles for the flags area to prevent themes from overriding layouts.
100
-
101
- 4.0.3
102
-
103
- - Adjusted CSS styles for the flag display.
104
-
105
- 4.0.2
106
-
107
- - Eliminated all (or most) HTML validation errors. Big improvement!
108
- - Re-factored more code to increase efficiency.
109
- - Added de-activation hook to reset all plugin settings when plugin is de-activated. (CSS Overrides and Google Analytics ID setting will remain in place and won't be deleted.)
110
- - Fixed the issue with flag language checkboxes. Users can remove English flag if so desired. Previously, English flag was alway required to stay checked, which was not most user-friendly.
111
-
112
- 4.0.1
113
-
114
- - Fixed PHP errors that were neglected in upgrade to 4.0.
115
- - Added conditionals to prevent scripts from loading when the floating widget is turned off.
116
-
117
- 4.0
118
-
119
- - Added 2 new features: 1) Drag/drop flags to re-arrange their order, and 2) Custom flag sizes (16px to 24px).
120
- - Re-factored code in google-language-translator.php. Languages are now loaded dynamically and are not hard-coded.
121
- - GLT Premium is now released: Updates include multiple flags for English, Spanish, and Portuguese languages; customized URLs with 'lang' attribute; drag/drop flags to re-arrnage their order
122
-
123
- 3.0.9
124
-
125
- - Added a title field to the Google Language Translator widget.
126
- - Removed "unexpected text characters" error upon activation (due to error in activation hook).
127
-
128
- 3.0.8
129
-
130
- - Added 9 new languages into the plugin (Hausa, Igbo, Maori, Mongolian, Nepali, Punjabi, Somali, Yoruba, Zulu).
131
- - Corrected an "undefined variable" error that was being generated in Vertical and Horizontal layouts.
132
- - Re-structured coding once again into an Object-Oriented approach.
133
- - Moved all functions of the base class into 'googlelanguagetranslator.php' and the widget into 'widget.php'.
134
- - Moved all javascript files into it's own JS folder.
135
- - Fixed an display issue with "Edit Translations" - they were being hidden when "No branding" option was chosen.
136
- - Corrected various "comma" errors in the string that outputs the script for loading the translator.
137
- - Changed Changelog in readme.txt to show most recent changes first, instead of last.
138
-
139
- 3.0.7
140
-
141
- - Removed an unnecessary CSS file, left over from development. Sorry for any inconvenience if you received display errors.
142
-
143
- 3.0.6
144
-
145
- - Corrected a small display error in displaying the floating widget correctly.
146
-
147
- 3.0.5
148
-
149
- - Added new Floating Widget (see settings page). The Floating Widget is simply another way for allowing website visitors to translate languages. The functionality is built-in with the existing flag preferences, and can be turned on or off at the administrator's preference. The floating widget can also function in full with both the language box and/or flags showing OR hiding, so the administrator has full control of how it displays. The floating widget is placed at bottom right of the website in the free version, but can be placed in other locations by changing CSS styles associated with the box. The premium version will allow more options as to changing the Floating Widget location.
150
- - Fixed the issue with Dashboard styles loading on the wrong pages. This was causing some annoying display issues on the Wordpress Dashboard.
151
-
152
- 3.0.4
153
-
154
- - Re-factored/re-arranged more code in google languagetransltor.php by placing them into separate files.
155
- - Fixed the issue of Custom CSS box not displaying it's styles to the website. This was only missed in this last update, due to re-arrangement of the files. Sorry for any inconvenience.
156
- - Removed style2.php file, which is unnecessary and was being used in testing.
157
-
158
- 3.0.3
159
-
160
- - Re-factored/re-arranged some of the code in googlelanguagetranslator.php by placing them into separate files.
161
- - Fixed a minor coding issue in glt_widget.php - this was generating an error in Wordpress when debugging.
162
- - Moved all CSS code into a single file. The result is nice, clean inline CSS code that is now called only once.
163
- - Fixed some additional CSS display issues.
164
-
165
- 3.0.2
166
-
167
- - Adjusted additional minor invalid HTML issues on the settings page, and also in the front-end plugin display.
168
-
169
- 3.0.1
170
-
171
- - Changed the url request to Google to allow both unsecured and secured page translations. Previously, some users experienced errors when trying to use the translator on "https://" (secured) pages.
172
- - Adjusted some minor spacing issues in the settings page HTML (caused some annoying red HTML errors when using "View Source" in right-click menu).
173
- - Removed old CSS styles that were added in the previous 3.0 update - the styles were added when Google servers were being updated, and were producing major translation dislay issues until their update was complete. Now the styles I added are no longer needed.
174
-
175
- 3.0
176
-
177
- - Correct a small CSS error that affected the showing/hiding of the Google toolbar.
178
-
179
- 2.9
180
-
181
- ***IMPORTANT: Google's most recent server update is producing display issues for website translation tool. There are major display issues with the translation toolbar and also the translations editing interface. Version 2.9 temporarily hides the edit translation functionality until Google decides to fix this issue, although you can still edit translations directly through your Google account at translate.google.com. Please direct any support requests through Wordpress.org and we will be happy to assist you.
182
-
183
- - Fixed Google Translation toolbar display issue
184
- - Fixed the Edit Translation interface by hiding it temporarily until Google fixes this
185
- - Removed some unneeded styles from the style sheet.
186
- - Fixed some CSS issues for the Google Branding display, which was affected by Google's most recent update
187
-
188
- 2.8
189
-
190
- - Added an option to allow users to manage their own translations directly through their Google Translate account (free). When activated, users can hover over the text of their website, and edit the translations from the webpage directly. Google will remember these translations, and then serve them to users once the edits are made. Users must install the Google Translate Customization meta tag provided through Google Translate here: translate.google.com/manager/website/settings. To obtain this meta tag, users need to configure the Google Translate tool directly from this website (although they will not use this because the plugin provides it), then the user can obtain the meta tag on the "Get Code" screen, which is displayed after configuring the Google Translate tool on this webpage.
191
- - Added an option to allow users to turn on/off Google's multilanguagePage option, that when activated, the original website content will be a forced translation, instead of original content (but only after a translation is made.)
192
- - Added more flexible styles to the settings page, so that left and right panels display nicely to the user.
193
-
194
- 2.7
195
-
196
- - Added Google Analytics tracking capability to the plugin.
197
-
198
- - Added a "CSS Styles" box in the settings panel.
199
-
200
- - Changed the Catalonian flag to its correct flag image.
201
-
202
- - Fixed coding issues that previously updated options incorrectly, which is why many users experienced display issues. All options are now initialized upon plugin activation, which should fix this issue permanently.
203
-
204
- - Fixed a glitch in our usage of the translate API. Previously, when the user clicked the default language, it would toggle back and forth between the default language and "Afrikaans" language. Now, users will see the correct language displayed at all times, no matter how many times it is clicked.
205
-
206
- 2.6
207
-
208
- - Added defaults to all options to ensure there are no more issues with the translator displaying upon installation. Again, sorry for any inconvenience.
209
-
210
- 2.5
211
-
212
- - Eliminated an internal Wordpress error being generated from a coding mistake.
213
-
214
- - Added a default option for the Translator alingment. Previously, this was causing the plugin to disapppear.
215
-
216
- 2.4
217
-
218
- - Found a couple of small display errors in the settings page after uploading version 2.3. Sorry for any inconvenience!
219
-
220
- 2.3
221
-
222
- - Added a "Preview" area on the settings page that allows you to see your settings in action.
223
-
224
- - Added custom flag support for all languages (custom flags available ONLY when selecting the "ALL Languages" setting.
225
-
226
- - Added an option that allows left/right alignment of the translation tool.
227
-
228
- - Added the "Google Language Translator" widget.
229
-
230
- - Updated googlelanguagetranslator.php to properly register setting in the admin settings panel.
231
-
232
- 2.2
233
-
234
- - Added language "Portuguese" and "German" to the Original Language drop-down option on the settings page.
235
-
236
- - Changed flag image for the English language (changed United States flag to the United Kingdom flag).
237
-
238
- - Added link in the settings panel that points to Google's Attribution Policy.
239
-
240
- 2.1
241
-
242
- - Added language "Dutch" to the Original Language drop-down option on the settings page.
243
-
244
- - Added a new CSS class that more accurately hides the "Powered by" text when hiding Google's branding. In previous version, the "Powered by" text was actually disguised by setting it's color to "transparent", but now we have set it's font-size to 0px instead.
245
-
246
- 2.0 Corrected some immediate errors in the 1.9 update.
247
-
248
- 1.9
249
-
250
- - Added 7 flag image choices that, when clicked by website visitors, will change the language displayed, both on the website, AND in the drop-down box (flag language choices are limited to those provided in this plugin).
251
-
252
- - Added 6 additional languages to the translator, as provided in Google's most recent updates ( new languages include Bosnian, Cebuano, Khmer, Marathi, Hmong, Javanese ).
253
-
254
- - Corrected a minor technical issue where the Czech option (on the backend) was incorrectly displaying the Croatian language on the front end.
255
-
256
- - Added jQuery functionality to the settings panel to improve the user experience.
257
-
258
- - Added an option for users to display/hide the flag images.
259
-
260
- - Added an option for users to display/hide the translate box when flags are displayed.
261
-
262
- - Removed the settings.css file - I found a better way of displaying the options without CSS.
263
-
264
- 1.8 Modified google-language-translator.php to display the correct output to the browser when horizontal layout is selected. Previously, it was not displaying at all.
265
-
266
- 1.7 Modified google-language-translator.php so that jQuery and CSS styles were enqueued properly onto the settings page only. Previously, jQuery functionality and CSS styles were being added to all pages of the Wordpresss Dashboard, which was causing functionality and display issues for some users.
267
-
268
- 1.6 Added "Specific Language" support to the plugin settings, which allows the user to choose specific languages that are displayed to website visitors.
269
-
270
- 1.5 Added "Original Language" support to the plugin settings, which allows the user to choose the original language of their website, which ultimately removes the original language as a choice in the language drop-down presented to website visitors.
271
-
272
- 1.4 Corrected display problems associated with CSS styles not being placed correctly in wp_head.
273
-
274
- 1.3 HTML display problem in the sidebar area now fixed. Previously, inserting the [google-translator] plugin into a text widget caused it to display above the widget, instead of inside of it.
275
-
276
- 1.2 Shortcode support is now available for adding [google-translator] to text widgets. I apologize for any inconvenience this may have caused.
277
-
278
- 1.1 The shortcode supplied on the settings page was updated to display '[google-translator]'.
279
-
280
- == Screenshots ==
281
-
282
- 1. Settings include: inline or vertical layout, hide/show Google toolbar, display specific languages, and show/hide Google branding. Add the shortcode to pages, posts, and widgets.
 
 
 
 
1
+ === Google Language Translator ===
2
+ Contributors: Rob Myrick
3
+ Donate link: http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=47LFA33AC89S6
4
+ Plugin link: http://wp-studio.net/how-it-works
5
+ Tags: language translator, google translator, language translate, google, google language translator, translation, translate, multi language
6
+ Requires at least: 2.9
7
+ Tested up to: 4.3.1
8
+ stable tag: 5.0.05
9
+
10
+ Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
+
12
+ == Description ==
13
+
14
+ Settings include: inline or vertical layout, show/hide specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
15
+
16
+ == Installation ==
17
+
18
+ 1. Download the zip folder named google-language-translator.zip
19
+ 2. Unzip the folder and put it in the plugins directory of your wordpress installation. (wp-content/plugins).
20
+ 3. Activate the plugin through the plugin window in the admin panel.
21
+ 4. Go to Settings > Google Language Translator, enable the plugin, and then choose your settings.
22
+ 5. Copy the shortcode and paste it into a page, post or widget.
23
+ 6. Do not use the shortcode twice on a single page - it will not work.
24
+
25
+ == Frequently Asked Questions ==
26
+
27
+ Q: What should I do if the translate widget does not show on my website?
28
+
29
+ 1. Make sure that the plugin is installed and activated.
30
+ 2. Verify that a check mark is placed in the activation setting located at "Settings > Google Language Translator".
31
+ 3. Verify that the native Wordpress function, wp_footer(), is included in your theme's footer file.
32
+ 4. Verify that "Show Language Box?" setting is enabled at "Settings > Google Language Translator".
33
+ 5. Use your browser's web tools to ensure that CSS styles are not hiding the translation widget.
34
+ 6. Contact support at http://www.wp-studio.net/submit-ticket.
35
+
36
+ Q: What should I do if there are no languages being displayed in the language box?
37
+
38
+ 1. Make sure that the plugin is installed and activated.
39
+ 2. Verify that a check mark is placed in the activation setting located at "Settings > Google Language Translator".
40
+ 3. Verify that Adobe Flash is installed in your web browser. Google uses Flash in order to display their language box.
41
+ 4. Contact support at http://www.wp-studio.net/submit-ticket.
42
+
43
+ Q: Can I exclude certain areas of my website from being translated?
44
+
45
+ A: Yes! Add the "notranslate" class to the HTML element containing your text. For example, the following text will be excluded from translation: <span class="notranslate">Hello World!</span>
46
+
47
+ == Changelog ==
48
+
49
+ 5.0.05
50
+ - Added 3 new options to the settings page: English, Spanish, and Portuguese flag image variations.
51
+ - Fixed an error with the Floating Widget: order of flags was not being honored in certain cases.
52
+
53
+ 5.0.04
54
+ - Corrected the text on the settings page to reflect 91 total flags, instead of 81 flags.
55
+
56
+ 5.0.03
57
+ - Added 10 new languages and associated flags: Chichewa, Kazakh, Malagasy, Malayalam, Myanmar(Burmese), Sesotho, Sinhala, Sundanese, Tajik, and Uzbek.
58
+
59
+ 5.0.02
60
+ - Updated the Tamil flag to use the Indian flag, instead of Tamil Tigers flag.
61
+
62
+ 5.0.01
63
+ - Updated style.css to reflect the syntax error connecting to the Chinese flag.
64
+
65
+ 5.0.0
66
+ - Wordpress security updates added to the settings page [wp_nonce_field()].
67
+ - Removed 3 outside Javascript files - these files are now called upon directly from Wordpress CMS.
68
+ - Unpacked flags.js p,a,c,k,e,r code. Unknowingly, this method of coding violated Wordpress plugin policy.
69
+ - Updated pricing display for GLT Premium. It was displaying $15 previously, but the price had increased since the last update.
70
+
71
+ 4.0.9
72
+ - Replaced: incorrect Catalonian flag image, with the correct image. I apologize for any inconvenience.
73
+ - Fixed: Floating Widget issue - previously it loaded 2 times when shortcode was added, which caused it not to work.
74
+
75
+ 4.0.8
76
+ - Fixed the small syntax issue related to the Google Analytics tracking number - it was another cause of the language box not displaying.
77
+
78
+ 4.0.7
79
+ - Fixed a CSS error in the settings panel display.
80
+ - Fixed the coding issue when "Specific Languages" option is chosen - the shortcode was not displaying the language dropdown.
81
+
82
+ 4.0.6
83
+
84
+ - Removed: "onclick" events from diplaying directly inside HTML. Converted those events to jQuery.
85
+ - Fixed the shortcode that allows adding single languages to Wordpress menus. (New example is shown on settings page.)
86
+ - Consolidated all flag images into image sprites!
87
+ - Re-designed 10 flag images to match the quality of the other flags.
88
+ - Fixed the incorrect "alt" tags associated with flag images. The "alt" tag now displays the language name.
89
+ - Modified text on the settings page - also added some lightbox pop-ups to help explain settings.
90
+ - New updates have also been provided for our Premium version (currently version 4.0.1) located at http://www.wp-studio.net/
91
+
92
+ 4.0.5
93
+
94
+ - Fixed: Display bug when using single language shortcode.
95
+ - Added: New link on the Plugins menu page, which links directly to Google Language Translator settings.
96
+
97
+
98
+ 4.0.4
99
+
100
+ - Added NEW shortcode! Allows placement of single languages into the navigation menu, pages, and posts. See settings panel for usage details.
101
+ - Re-factored code in googlelanguagetranslator.php which reduced code to around 950 lines.
102
+ - Removed the "de-activation" hook, which previously deleted options when plugin de-activated. Added "uninstall" hook instead, so that settings will be preserved only when user deletes the plugin completely.
103
+ - Updated CSS styles for the flags area to prevent themes from overriding layouts.
104
+
105
+ 4.0.3
106
+
107
+ - Adjusted CSS styles for the flag display.
108
+
109
+ 4.0.2
110
+
111
+ - Eliminated all (or most) HTML validation errors. Big improvement!
112
+ - Re-factored more code to increase efficiency.
113
+ - Added de-activation hook to reset all plugin settings when plugin is de-activated. (CSS Overrides and Google Analytics ID setting will remain in place and won't be deleted.)
114
+ - Fixed the issue with flag language checkboxes. Users can remove English flag if so desired. Previously, English flag was alway required to stay checked, which was not most user-friendly.
115
+
116
+ 4.0.1
117
+
118
+ - Fixed PHP errors that were neglected in upgrade to 4.0.
119
+ - Added conditionals to prevent scripts from loading when the floating widget is turned off.
120
+
121
+ 4.0
122
+
123
+ - Added 2 new features: 1) Drag/drop flags to re-arrange their order, and 2) Custom flag sizes (16px to 24px).
124
+ - Re-factored code in google-language-translator.php. Languages are now loaded dynamically and are not hard-coded.
125
+ - GLT Premium is now released: Updates include multiple flags for English, Spanish, and Portuguese languages; customized URLs with 'lang' attribute; drag/drop flags to re-arrnage their order
126
+
127
+ 3.0.9
128
+
129
+ - Added a title field to the Google Language Translator widget.
130
+ - Removed "unexpected text characters" error upon activation (due to error in activation hook).
131
+
132
+ 3.0.8
133
+
134
+ - Added 9 new languages into the plugin (Hausa, Igbo, Maori, Mongolian, Nepali, Punjabi, Somali, Yoruba, Zulu).
135
+ - Corrected an "undefined variable" error that was being generated in Vertical and Horizontal layouts.
136
+ - Re-structured coding once again into an Object-Oriented approach.
137
+ - Moved all functions of the base class into 'googlelanguagetranslator.php' and the widget into 'widget.php'.
138
+ - Moved all javascript files into it's own JS folder.
139
+ - Fixed an display issue with "Edit Translations" - they were being hidden when "No branding" option was chosen.
140
+ - Corrected various "comma" errors in the string that outputs the script for loading the translator.
141
+ - Changed Changelog in readme.txt to show most recent changes first, instead of last.
142
+
143
+ 3.0.7
144
+
145
+ - Removed an unnecessary CSS file, left over from development. Sorry for any inconvenience if you received display errors.
146
+
147
+ 3.0.6
148
+
149
+ - Corrected a small display error in displaying the floating widget correctly.
150
+
151
+ 3.0.5
152
+
153
+ - Added new Floating Widget (see settings page). The Floating Widget is simply another way for allowing website visitors to translate languages. The functionality is built-in with the existing flag preferences, and can be turned on or off at the administrator's preference. The floating widget can also function in full with both the language box and/or flags showing OR hiding, so the administrator has full control of how it displays. The floating widget is placed at bottom right of the website in the free version, but can be placed in other locations by changing CSS styles associated with the box. The premium version will allow more options as to changing the Floating Widget location.
154
+ - Fixed the issue with Dashboard styles loading on the wrong pages. This was causing some annoying display issues on the Wordpress Dashboard.
155
+
156
+ 3.0.4
157
+
158
+ - Re-factored/re-arranged more code in google languagetransltor.php by placing them into separate files.
159
+ - Fixed the issue of Custom CSS box not displaying it's styles to the website. This was only missed in this last update, due to re-arrangement of the files. Sorry for any inconvenience.
160
+ - Removed style2.php file, which is unnecessary and was being used in testing.
161
+
162
+ 3.0.3
163
+
164
+ - Re-factored/re-arranged some of the code in googlelanguagetranslator.php by placing them into separate files.
165
+ - Fixed a minor coding issue in glt_widget.php - this was generating an error in Wordpress when debugging.
166
+ - Moved all CSS code into a single file. The result is nice, clean inline CSS code that is now called only once.
167
+ - Fixed some additional CSS display issues.
168
+
169
+ 3.0.2
170
+
171
+ - Adjusted additional minor invalid HTML issues on the settings page, and also in the front-end plugin display.
172
+
173
+ 3.0.1
174
+
175
+ - Changed the url request to Google to allow both unsecured and secured page translations. Previously, some users experienced errors when trying to use the translator on "https://" (secured) pages.
176
+ - Adjusted some minor spacing issues in the settings page HTML (caused some annoying red HTML errors when using "View Source" in right-click menu).
177
+ - Removed old CSS styles that were added in the previous 3.0 update - the styles were added when Google servers were being updated, and were producing major translation dislay issues until their update was complete. Now the styles I added are no longer needed.
178
+
179
+ 3.0
180
+
181
+ - Correct a small CSS error that affected the showing/hiding of the Google toolbar.
182
+
183
+ 2.9
184
+
185
+ ***IMPORTANT: Google's most recent server update is producing display issues for website translation tool. There are major display issues with the translation toolbar and also the translations editing interface. Version 2.9 temporarily hides the edit translation functionality until Google decides to fix this issue, although you can still edit translations directly through your Google account at translate.google.com. Please direct any support requests through Wordpress.org and we will be happy to assist you.
186
+
187
+ - Fixed Google Translation toolbar display issue
188
+ - Fixed the Edit Translation interface by hiding it temporarily until Google fixes this
189
+ - Removed some unneeded styles from the style sheet.
190
+ - Fixed some CSS issues for the Google Branding display, which was affected by Google's most recent update
191
+
192
+ 2.8
193
+
194
+ - Added an option to allow users to manage their own translations directly through their Google Translate account (free). When activated, users can hover over the text of their website, and edit the translations from the webpage directly. Google will remember these translations, and then serve them to users once the edits are made. Users must install the Google Translate Customization meta tag provided through Google Translate here: translate.google.com/manager/website/settings. To obtain this meta tag, users need to configure the Google Translate tool directly from this website (although they will not use this because the plugin provides it), then the user can obtain the meta tag on the "Get Code" screen, which is displayed after configuring the Google Translate tool on this webpage.
195
+ - Added an option to allow users to turn on/off Google's multilanguagePage option, that when activated, the original website content will be a forced translation, instead of original content (but only after a translation is made.)
196
+ - Added more flexible styles to the settings page, so that left and right panels display nicely to the user.
197
+
198
+ 2.7
199
+
200
+ - Added Google Analytics tracking capability to the plugin.
201
+
202
+ - Added a "CSS Styles" box in the settings panel.
203
+
204
+ - Changed the Catalonian flag to its correct flag image.
205
+
206
+ - Fixed coding issues that previously updated options incorrectly, which is why many users experienced display issues. All options are now initialized upon plugin activation, which should fix this issue permanently.
207
+
208
+ - Fixed a glitch in our usage of the translate API. Previously, when the user clicked the default language, it would toggle back and forth between the default language and "Afrikaans" language. Now, users will see the correct language displayed at all times, no matter how many times it is clicked.
209
+
210
+ 2.6
211
+
212
+ - Added defaults to all options to ensure there are no more issues with the translator displaying upon installation. Again, sorry for any inconvenience.
213
+
214
+ 2.5
215
+
216
+ - Eliminated an internal Wordpress error being generated from a coding mistake.
217
+
218
+ - Added a default option for the Translator alingment. Previously, this was causing the plugin to disapppear.
219
+
220
+ 2.4
221
+
222
+ - Found a couple of small display errors in the settings page after uploading version 2.3. Sorry for any inconvenience!
223
+
224
+ 2.3
225
+
226
+ - Added a "Preview" area on the settings page that allows you to see your settings in action.
227
+
228
+ - Added custom flag support for all languages (custom flags available ONLY when selecting the "ALL Languages" setting.
229
+
230
+ - Added an option that allows left/right alignment of the translation tool.
231
+
232
+ - Added the "Google Language Translator" widget.
233
+
234
+ - Updated googlelanguagetranslator.php to properly register setting in the admin settings panel.
235
+
236
+ 2.2
237
+
238
+ - Added language "Portuguese" and "German" to the Original Language drop-down option on the settings page.
239
+
240
+ - Changed flag image for the English language (changed United States flag to the United Kingdom flag).
241
+
242
+ - Added link in the settings panel that points to Google's Attribution Policy.
243
+
244
+ 2.1
245
+
246
+ - Added language "Dutch" to the Original Language drop-down option on the settings page.
247
+
248
+ - Added a new CSS class that more accurately hides the "Powered by" text when hiding Google's branding. In previous version, the "Powered by" text was actually disguised by setting it's color to "transparent", but now we have set it's font-size to 0px instead.
249
+
250
+ 2.0 Corrected some immediate errors in the 1.9 update.
251
+
252
+ 1.9
253
+
254
+ - Added 7 flag image choices that, when clicked by website visitors, will change the language displayed, both on the website, AND in the drop-down box (flag language choices are limited to those provided in this plugin).
255
+
256
+ - Added 6 additional languages to the translator, as provided in Google's most recent updates ( new languages include Bosnian, Cebuano, Khmer, Marathi, Hmong, Javanese ).
257
+
258
+ - Corrected a minor technical issue where the Czech option (on the backend) was incorrectly displaying the Croatian language on the front end.
259
+
260
+ - Added jQuery functionality to the settings panel to improve the user experience.
261
+
262
+ - Added an option for users to display/hide the flag images.
263
+
264
+ - Added an option for users to display/hide the translate box when flags are displayed.
265
+
266
+ - Removed the settings.css file - I found a better way of displaying the options without CSS.
267
+
268
+ 1.8 Modified google-language-translator.php to display the correct output to the browser when horizontal layout is selected. Previously, it was not displaying at all.
269
+
270
+ 1.7 Modified google-language-translator.php so that jQuery and CSS styles were enqueued properly onto the settings page only. Previously, jQuery functionality and CSS styles were being added to all pages of the Wordpresss Dashboard, which was causing functionality and display issues for some users.
271
+
272
+ 1.6 Added "Specific Language" support to the plugin settings, which allows the user to choose specific languages that are displayed to website visitors.
273
+
274
+ 1.5 Added "Original Language" support to the plugin settings, which allows the user to choose the original language of their website, which ultimately removes the original language as a choice in the language drop-down presented to website visitors.
275
+
276
+ 1.4 Corrected display problems associated with CSS styles not being placed correctly in wp_head.
277
+
278
+ 1.3 HTML display problem in the sidebar area now fixed. Previously, inserting the [google-translator] plugin into a text widget caused it to display above the widget, instead of inside of it.
279
+
280
+ 1.2 Shortcode support is now available for adding [google-translator] to text widgets. I apologize for any inconvenience this may have caused.
281
+
282
+ 1.1 The shortcode supplied on the settings page was updated to display '[google-translator]'.
283
+
284
+ == Screenshots ==
285
+
286
+ 1. Settings include: inline or vertical layout, hide/show Google toolbar, display specific languages, and show/hide Google branding. Add the shortcode to pages, posts, and widgets.