Erstelle eine mehrsprachige Webseite mit "translate php class"

Wähle die gewünschte Sprache

Übersetzter Beispieltext

"Translate" ist ein einfach zu integrierende PHP Klasse. 3 Zeilen Quellcode sind ausreichend um deine Webseite für die Mehrsprachigkeit fit zu machen:

		require_once ('Translate/Translate_class.php');
		$translate = new translate();
		$translate->setBrowserLanguage();

Fähigkeiten

Die folgenden öffentlichen Funktionen der sind nicht übersetzt, da diese aus der Klassenfunktion "showAllPublicfunctions();" stammen...

Public functions of php class 'translate'

setBrowserLanguage()
This function determines the browser language and tries to load the corresponding language file. If the file does not exist the php class uses the fallback language (defined in the Translate_class.php). There is no return value.
setLanguage()
Instead of determin the browser language the webmaster can define the used language manually. Not matter of the language of the user this language file is used. If the file does not exist the php class uses the fallback language. There is no return value.
getLanguageByIP()
Translate can try to resolve the IP address of the user and to determine the country of origin. Please be aware that this function needs some time because it reads an array with more than 11.000 lines. The input variable can be 2, 3 or 4:
  > 2 return a two letter country code like 'us'.
  > 3 return three letters like 'usa'
  > 4 return the complete name like 'UNITED STATES OF AMERICA'.
getCurrentLanguage()
This function returns a string with the currently used language. For example: 'en' or 'de'.
getLanguageFilesInDirectory()
This function returns an array with all found language files in the folder of the Translate_class.php. For example: array('lang_en.php', 'lang_de.php').
getAllLanguages()
This function returns an array with all found languages in the folder of the Translate_class.php. For example: array('en', 'de').
_($keyword, $replaceArray = '')
This is the central function to return a string with the text piece corresponding to the keyword. In addition it is possible to replace placeholders in the text with another text piece. Imagine the keyword for 'welcome' is 'Hello #surname# #name#'. In this case the usage could be: echo $translate->_('welcome', array('#surname#=>'Christoph', '#name#=>'Dyllick-Brenzinger').
showAllTextsAndKeywords()
This is one of the three supporting function and shows a table with all keywords and text pieces of the currently selected language.
showAllTexts()
This is the second of three supporting functions and shows only the text pieces without the keywords.
showAllPublicFunctions()
Shows all public functions of this php class. (If you read this you are currently using this function...)
compareLanguageFileWithFallback()
This is the last supporting function which compaires the de...