Browse Source

added support to name the languages

added remaining flags i have from the famfamfam set and renamed them to country names
Matthew Vale 9 years ago
parent
commit
dc96bfaf8e
100 changed files with 30 additions and 10 deletions
  1. 18 0
      core/app_languages.php
  2. 12 10
      resources/classes/text.php
  3. BIN
      themes/flags/Afghanistan.png
  4. BIN
      themes/flags/Aland Islands.png
  5. BIN
      themes/flags/Albania.png
  6. BIN
      themes/flags/Algeria.png
  7. BIN
      themes/flags/American Samoa.png
  8. BIN
      themes/flags/Andorra.png
  9. BIN
      themes/flags/Angola.png
  10. BIN
      themes/flags/Anguilla.png
  11. BIN
      themes/flags/Antigua and Barbuda.png
  12. BIN
      themes/flags/Argentina.png
  13. BIN
      themes/flags/Armenia.png
  14. BIN
      themes/flags/Aruba.png
  15. BIN
      themes/flags/Australia.png
  16. BIN
      themes/flags/Austria.png
  17. BIN
      themes/flags/Azerbaijan.png
  18. BIN
      themes/flags/Bahamas.png
  19. BIN
      themes/flags/Bahrain.png
  20. BIN
      themes/flags/Bangladesh.png
  21. BIN
      themes/flags/Barbados.png
  22. BIN
      themes/flags/Belarus.png
  23. BIN
      themes/flags/Belgium.png
  24. BIN
      themes/flags/Belize.png
  25. BIN
      themes/flags/Benin.png
  26. BIN
      themes/flags/Bermuda.png
  27. BIN
      themes/flags/Bhutan.png
  28. BIN
      themes/flags/Bolivia, Plurinational State of.png
  29. BIN
      themes/flags/Bosnia and Herzegovina.png
  30. BIN
      themes/flags/Botswana.png
  31. BIN
      themes/flags/Bouvet Island.png
  32. BIN
      themes/flags/Brazil.png
  33. BIN
      themes/flags/British Indian Ocean Territory.png
  34. BIN
      themes/flags/Brunei Darussalam.png
  35. BIN
      themes/flags/Bulgaria.png
  36. BIN
      themes/flags/Burkina Faso.png
  37. BIN
      themes/flags/Burundi.png
  38. BIN
      themes/flags/Cabo Verde.png
  39. BIN
      themes/flags/Cambodia.png
  40. BIN
      themes/flags/Cameroon.png
  41. BIN
      themes/flags/Canada.png
  42. BIN
      themes/flags/Cayman Islands.png
  43. BIN
      themes/flags/Central African Republic.png
  44. BIN
      themes/flags/Chad.png
  45. BIN
      themes/flags/Chile.png
  46. BIN
      themes/flags/China.png
  47. BIN
      themes/flags/Christmas Island.png
  48. BIN
      themes/flags/Cocos (Keeling) Islands.png
  49. BIN
      themes/flags/Colombia.png
  50. BIN
      themes/flags/Comoros.png
  51. BIN
      themes/flags/Congo, the Democratic Republic of the.png
  52. BIN
      themes/flags/Congo.png
  53. BIN
      themes/flags/Cook Islands.png
  54. BIN
      themes/flags/Costa Rica.png
  55. BIN
      themes/flags/Cote d'Ivoire.png
  56. BIN
      themes/flags/Croatia.png
  57. BIN
      themes/flags/Cuba.png
  58. BIN
      themes/flags/Cyprus.png
  59. BIN
      themes/flags/Czech Republic.png
  60. BIN
      themes/flags/Denmark.png
  61. BIN
      themes/flags/Djibouti.png
  62. BIN
      themes/flags/Dominica.png
  63. BIN
      themes/flags/Dominican Republic.png
  64. BIN
      themes/flags/Ecuador.png
  65. BIN
      themes/flags/Egypt.png
  66. BIN
      themes/flags/El Salvador.png
  67. BIN
      themes/flags/Equatorial Guinea.png
  68. BIN
      themes/flags/Eritrea.png
  69. BIN
      themes/flags/Estonia.png
  70. BIN
      themes/flags/Ethiopia.png
  71. BIN
      themes/flags/Falkland Islands (Malvinas).png
  72. BIN
      themes/flags/Faroe Islands.png
  73. BIN
      themes/flags/Fiji.png
  74. BIN
      themes/flags/Finland.png
  75. BIN
      themes/flags/France.png
  76. BIN
      themes/flags/French Guiana.png
  77. BIN
      themes/flags/French Polynesia.png
  78. BIN
      themes/flags/French Southern Territories.png
  79. BIN
      themes/flags/Gabon.png
  80. BIN
      themes/flags/Gambia.png
  81. BIN
      themes/flags/Georgia.png
  82. BIN
      themes/flags/Germany.png
  83. BIN
      themes/flags/Ghana.png
  84. BIN
      themes/flags/Gibraltar.png
  85. BIN
      themes/flags/Greece.png
  86. BIN
      themes/flags/Greenland.png
  87. BIN
      themes/flags/Grenada.png
  88. BIN
      themes/flags/Guadeloupe.png
  89. BIN
      themes/flags/Guam.png
  90. BIN
      themes/flags/Guatemala.png
  91. BIN
      themes/flags/Guinea-Bissau.png
  92. BIN
      themes/flags/Guinea.png
  93. BIN
      themes/flags/Guyana.png
  94. BIN
      themes/flags/Haiti.png
  95. BIN
      themes/flags/Heard Island and McDonald Islands.png
  96. BIN
      themes/flags/Holy See.png
  97. BIN
      themes/flags/Honduras.png
  98. BIN
      themes/flags/Hong Kong.png
  99. BIN
      themes/flags/Hungary.png
  100. BIN
      themes/flags/Iceland.png

+ 18 - 0
core/app_languages.php

@@ -0,0 +1,18 @@
+<?php
+
+// Fill in the value in the native language
+// rename the corerct flag in /theme/flags/*.png
+
+$language_name['en-us'] = "English - United States";
+$language_name['es-cl'] = "Español - Chile";
+$language_name['pt-pt'] = "Português - Portugal";
+$language_name['fr-fr'] = "Français - France";
+$language_name['nl-nl'] = "Nederlands - De Nederland";
+$language_name['pt-br'] = "Brasileiro - Português";
+$language_name['pl'] = "Polski - Polska";
+$language_name['sv-se'] = "Svenska - Sverige";
+$language_name['uk'] = "Українська - Україна";
+$language_name['de-at'] = "Deutsch - Österreich";
+$language_name['ar-eg'] = "العربية - مصر";
+
+?>

+ 12 - 10
resources/classes/text.php

@@ -1,19 +1,16 @@
 <?php
 <?php
-
 /**
 /**
  * Get the text for the correct translation
  * Get the text for the correct translation
  *
  *
  * @method array get
  * @method array get
  */
  */
 class text {
 class text {
-
 	/**
 	/**
 	 * Called when the object is created
 	 * Called when the object is created
 	 */
 	 */
 	public function __construct() {
 	public function __construct() {
 		//place holder
 		//place holder
 	}
 	}
-
 	/**
 	/**
 	 * Called when there are no references to a particular object
 	 * Called when there are no references to a particular object
 	 * unset the variables used in the class
 	 * unset the variables used in the class
@@ -23,7 +20,6 @@ class text {
 			unset($this->$key);
 			unset($this->$key);
 		}
 		}
 	}
 	}
-
 	/**
 	/**
 	 * Get a specific item from the cache
 	 * Get a specific item from the cache
 	 * @var string $language_code	examples: en-us, es-cl, fr-fr, pt-pt
 	 * @var string $language_code	examples: en-us, es-cl, fr-fr, pt-pt
@@ -39,7 +35,6 @@ class text {
 			else {
 			else {
 				include getcwd().'/app_languages.php';
 				include getcwd().'/app_languages.php';
 			}
 			}
-
 		//get the available languages
 		//get the available languages
 			krsort($text);
 			krsort($text);
 			foreach ($text as $lang_label => $lang_codes) {
 			foreach ($text as $lang_label => $lang_codes) {
@@ -50,7 +45,6 @@ class text {
 				}
 				}
 			}
 			}
 			$_SESSION['app']['languages'] = array_unique($app_languages);
 			$_SESSION['app']['languages'] = array_unique($app_languages);
-
 		//check the session language
 		//check the session language
 			if(isset($_SESSION['domain'])){
 			if(isset($_SESSION['domain'])){
 				$language_code = $_SESSION['domain']['language']['code'];
 				$language_code = $_SESSION['domain']['language']['code'];
@@ -63,12 +57,20 @@ class text {
 					$text[$key] = $value[$language_code];
 					$text[$key] = $value[$language_code];
 				}
 				}
 			}
 			}
-
+			if ($language_code != 'all') {
+				foreach($language_name as $code => $value) {
+					$text["language-$code"] = $value;
+				}
+			}else{
+				foreach($language_name as $code => $value) {
+					foreach($language_name as $c_code => $value) {
+						$text["language-$code"][$c_code] = $value;
+					}
+				}
+			}
+			
 		//return the array of translations
 		//return the array of translations
 			return $text;
 			return $text;
-
 	}
 	}
-
 }
 }
-
 ?>
 ?>

BIN
themes/flags/Afghanistan.png


BIN
themes/flags/Aland Islands.png


BIN
themes/flags/Albania.png


BIN
themes/flags/Algeria.png


BIN
themes/flags/American Samoa.png


BIN
themes/flags/Andorra.png


BIN
themes/flags/Angola.png


BIN
themes/flags/Anguilla.png


BIN
themes/flags/Antigua and Barbuda.png


BIN
themes/flags/Argentina.png


BIN
themes/flags/Armenia.png


BIN
themes/flags/Aruba.png


BIN
themes/flags/Australia.png


BIN
themes/flags/Austria.png


BIN
themes/flags/Azerbaijan.png


BIN
themes/flags/Bahamas.png


BIN
themes/flags/Bahrain.png


BIN
themes/flags/Bangladesh.png


BIN
themes/flags/Barbados.png


BIN
themes/flags/Belarus.png


BIN
themes/flags/Belgium.png


BIN
themes/flags/Belize.png


BIN
themes/flags/Benin.png


BIN
themes/flags/Bermuda.png


BIN
themes/flags/Bhutan.png


BIN
themes/flags/Bolivia, Plurinational State of.png


BIN
themes/flags/Bosnia and Herzegovina.png


BIN
themes/flags/Botswana.png


BIN
themes/flags/Bouvet Island.png


BIN
themes/flags/Brazil.png


BIN
themes/flags/British Indian Ocean Territory.png


BIN
themes/flags/Brunei Darussalam.png


BIN
themes/flags/Bulgaria.png


BIN
themes/flags/Burkina Faso.png


BIN
themes/flags/Burundi.png


BIN
themes/flags/Cabo Verde.png


BIN
themes/flags/Cambodia.png


BIN
themes/flags/Cameroon.png


BIN
themes/flags/Canada.png


BIN
themes/flags/Cayman Islands.png


BIN
themes/flags/Central African Republic.png


BIN
themes/flags/Chad.png


BIN
themes/flags/Chile.png


BIN
themes/flags/China.png


BIN
themes/flags/Christmas Island.png


BIN
themes/flags/Cocos (Keeling) Islands.png


BIN
themes/flags/Colombia.png


BIN
themes/flags/Comoros.png


BIN
themes/flags/Congo, the Democratic Republic of the.png


BIN
themes/flags/Congo.png


BIN
themes/flags/Cook Islands.png


BIN
themes/flags/Costa Rica.png


BIN
themes/flags/Cote d'Ivoire.png


BIN
themes/flags/Croatia.png


BIN
themes/flags/Cuba.png


BIN
themes/flags/Cyprus.png


BIN
themes/flags/Czech Republic.png


BIN
themes/flags/Denmark.png


BIN
themes/flags/Djibouti.png


BIN
themes/flags/Dominica.png


BIN
themes/flags/Dominican Republic.png


BIN
themes/flags/Ecuador.png


BIN
themes/flags/Egypt.png


BIN
themes/flags/El Salvador.png


BIN
themes/flags/Equatorial Guinea.png


BIN
themes/flags/Eritrea.png


BIN
themes/flags/Estonia.png


BIN
themes/flags/Ethiopia.png


BIN
themes/flags/Falkland Islands (Malvinas).png


BIN
themes/flags/Faroe Islands.png


BIN
themes/flags/Fiji.png


BIN
themes/flags/Finland.png


BIN
themes/flags/France.png


BIN
themes/flags/French Guiana.png


BIN
themes/flags/French Polynesia.png


BIN
themes/flags/French Southern Territories.png


BIN
themes/flags/Gabon.png


BIN
themes/flags/Gambia.png


BIN
themes/flags/Georgia.png


BIN
themes/flags/Germany.png


BIN
themes/flags/Ghana.png


BIN
themes/flags/Gibraltar.png


BIN
themes/flags/Greece.png


BIN
themes/flags/Greenland.png


BIN
themes/flags/Grenada.png


BIN
themes/flags/Guadeloupe.png


BIN
themes/flags/Guam.png


BIN
themes/flags/Guatemala.png


BIN
themes/flags/Guinea-Bissau.png


BIN
themes/flags/Guinea.png


BIN
themes/flags/Guyana.png


BIN
themes/flags/Haiti.png


BIN
themes/flags/Heard Island and McDonald Islands.png


BIN
themes/flags/Holy See.png


BIN
themes/flags/Honduras.png


BIN
themes/flags/Hong Kong.png


BIN
themes/flags/Hungary.png


BIN
themes/flags/Iceland.png


Some files were not shown because too many files changed in this diff