PHP Classes

PHP Translation Text From Files: Translate application texts with translation files

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 226 All time: 8,200 This week: 71Up
Version License PHP version Categories
translation-files 1.0.0BSD License5Localization, PHP 5, Files and Folders


This class can translate application texts with translation files.

It can load translations of texts for a given language from a file in the translations directory for a given language.

The class returns the translated text or the original text if the translation is missing in the file.

Picture of Name Removed
  Performance   Level  
Name: Name Removed <contact>
Classes: 4 packages by
Country: ???
Age: ???
All time rank: 2025
Week rank: 284 Up



// Translation From Files Class
// Developed by Takis Maletsas
// @2016

$translate = new Translator;


//Change translations directory

$translate->translate('Hello world!'); //&#915;&#949;&#953;&#940; &#963;&#959;&#965; &#954;&#972;&#963;&#956;&#949;!
echo "<br/>";
$translate->translate('It is Takis'); //&#917;&#943;&#957;&#945;&#953; &#959; &#932;&#940;&#954;&#951;&#962;
echo "<br/>";

$translate->translate('Hello world!'); //Hello world!
echo "<br/>";
$translate->translate('It is Takis'); //It is Takis

  Files folder image Files  
File Role Description
Files folder imagetranslations (1 file)
Plain text file translator.class.php Class Class
Accessible without login Plain text file example.php Example Example

  Files folder image Files  /  translations  
File Role Description
  Accessible without login Plain text file el.lang Data Example translation to Greek

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,200
This week:71Up