i18n – ChangeLog
Version History
Current Version: 2.1b2 (2004-06-04)
- Changed some code so the classes don’t throw an error with PHP5 RC2.
- PHPdoc comments are back in.
- UTF-8 is used all the time now. This could cause some problems with different translation modes:
- SQLite needs to be compiled with UTF-8 support to work correctly
- MySQL requires at least version 4.1.1a and some editing of your My.ini file.
- Replaced most string functions with the equal “mb” functions, so you need to enable “mbstring” in your php.ini file.
- Support for MSSQL has been dropped. Maybe will come back at a later point.
- Support for XML files has been added (using simpleXML). Classes aren’t finished though (I18NtranslatorXMLExtended not implemented).
2.1b (2004-04-10)
- Completely rewritten code for PHP5 RC1. the API has changed! (see example script)
- Stripped out unnessecary functions and features like translateencode or shared memory functions to make classes smaller. some of that may return at a later point again
- PHPdoc comments will be included at a later point again.
2.003 (2003-08-20)
- Added a new backend translator class for MS SQL Server.
- Added new public methods to the translator class:
addTranslation()
, updateTranslation()
, deleteTranslation()
, deleteTranslationString()
, changeTranslator()
and getTranslations()
.
- It’s now possible to turn of the usage of cookies in the I18NUser class.
- Added support for variables in translation strings. Doesn’t work with every translation mode though. See example script for usage.
2.002 (2003-08-02)
- Corrected some minor bugs.
- Completely changed the error handling: Non-fatal errors (like translation
errors for example) are now catched via the try/throw/catch construct
and are displayed at the end of the generated html page.
2.001 (2003-07-09)
- Corrected some minor bugs.
- Corrected Gettext bugs as good as possible. (Gettext still sucks :-) )
- Added new backend translator class for SQLite.
- Added PHPDoc comments again, but documentation won’t be available
until a parser for PHP 5 comes out.
2.000 (2003-07-05)
- First PHP 5 release; won’t work under PHP 4!
- Improved Structure of the classes.
- New easy way of adding own translation backend classes though implementing
interfaces.
- Added caching for translation strings to the “Text” and “MySQL” modus to improve speed.
Last PHP 4.3.x Version: 1.061 (2003-06-23)
- Some speed improvements when using the
filterSpecialWords()
function.
Also enhanced the wordFilter()
function.
- Some code cleanup.
1.060 (2003-06-13)
- Finally managed to rewrite the FormatDate class so the formating options can be set in the l10n.ini file.
- Corrected a Bug concerning the changeLocale method.
- Some minor code corrections.
1.057 (2003-05-10)
- If the shmop extention is installed, shared memory can be used to store
and read the settings from all the ini files. This way they
don’t have to be read with every pagecall. If you change something
in one of those files you can set the
$flush_sm
variable
in the I18N class to TRUE to reset the shared memory variables. The PHP
functions for using shared memory are a bit of a pain to work with, but
I try to use it more often in future releases. Maybe for caching even
the translation strings since they are the same for every user anyway…
The shared memory function is not enabled by default.
For that you have to set the $use_shared_mem
variable in
the I18N class to TRUE.
- Renamed a couple of variables and functions so it comes closer to the
PEAR coding standards.
- Removed all user settings from the i18n_settings.ini file,
since they normally don’t have to be changed. If you need to change
them, please edit the I18NUser class directly.
- Redesigned the
getLastUpdateDate()
method, to reduce DB
queries and file access.
1.056 (2003-05-02)
- Added an option to the i18n_settings.ini file which allows
to turn of alias language checking. if you don’t use it, it speeds
thinks up a little.
- Also shifted a bit of code to an abstract base class “i18n” and
tweaked the
getLastUpdate()
method a little bit.
- Renamed the User class so it doesn’t interfere with other
classes that are commonly named “User”.
1.055 (2003-04-30)
- Changed a bit of the logic of the settings files. There is no currency.ini file
any more, but therefore there is a l10n.ini file in each language
folder which holds all the regional settings.
- Also added a
changeLocale()
method to the classes FormatDate,
FormatNumber, FormatString and Measure.
- Further added an option to the i18n_settings.ini file which
allows to turn of locale checking every time a Translator object is created.
1.054 (2003-04-20)
- Added a lastupdate column to the database layout. If you want to cache
your pages you can use this information to check if any translations
are newer than your cached page.
1.053 (2003-04-15)
- Optimized the mysql modus. now a new column “namespace” is
used to speed up things a little bit. if you use that modus you have
to add that column to the translation table. see the documentation how
that namespace thing works.
- Also the way the i18n_settings.ini is read has been changed.
Instead of reading it everytime an object is created, it will only
be read once per page and stored in a global variable.
1.052 (2003-04-14)
- Corrected some bugs in the language and translator class
1.051 (2003-03-24)
- Added some arabic example strings and added a FormatNumbers class for
formating numbers, percent values and currencies…
1.050 (2003-02-24)
- Added experimental support for UTF encoded translation files, which means
that you can use char-sets other than ASCII now. The string functions
are not really tested with UTF, but should work too. As an example language
I added Russian. Translated everything with babelfish again, so don’t
get mad at me if the spelling or grammar is all wrong :-). I also don’t
know the correct way of writing Russian date and time strings, so if
you are from Russia, please e-mail me how to correct it.
- Corrected some small MySQL bugs…
1.045 (2003-02-22)
- It is now possible to include more than one translation file if you use
modus “inc” or “gettext”. To include more that
one file write
$object = new Translator('language','file1,file2,...');
when
creating a new translation object. Due the limitations of gettext you
have to add the name of the language file where a translation-string
can be found as a second value when you use the _()
function.
But with the exeption, if the string is in the first file of the language
file list, you don’t have to include the filename.
Example: So let’s say your first string string1 can
be found in file1.po and string2 can be found in file2.po.
First create a new object: $object = new Translator('language','file1,file2');
Then
translate the first string with _('string1')
and the second
string with _('string2','file2')
Since string1 is
located in file1.po – which is the first file in the
filelist given as a value to the Translator class when creating the object – you
don’t have to add the filename every time you want to translate string1,
but since string2 is located in another file you have to add
the filename as a second argument to the translate function.
For more information on that complicated topic,
take a look at the user comments at http://www.php.net/manual/en/ref.gettext.php.
- Added a
MiddleDate()
function, but only added german format
so far.
- All settings from the user class are now located in the i18n_settings.ini file.
- Added a simple script to convert translation files to the mysql translation
table.
1.044 (2003-02-18)
- Corrected small bug when detecting the user language. Until now the
getLang()
function
returned the raw locale instead of the language. I corrected this. So
now there is a getCountry()
, getLang()
and
a getLocale()
function.
- Also rewrote some parts of the code which resulted in a huge gain of
speed. The example script now only takes about half of the time to generate,
then it did with Version 1.043!
1.043 (2003-02-17)
- Rearranged some functions which results in a small gain in speed.
- Also renamed the project to i18n, deleted most of the functions in the
FormatString class and completely deleted the FormatLongString class
which didn’t have anything to do with i18n.
1.042b (2003-02-13)
- Corrected a bug concerning language preferences saved in cookies or session.
Sadly the performance dropped a little bit because of that.
1.042 (2003-02-11)
- Some small new features: There is a
countLanguages()
and countStrings()
function
in the ChooseLanguage class now. And I’ve implemented the possibility
to use alias languages. Let’s say you have a language directory “en” with
translation files in it and now you want another language directory “en_uk”.
Instead of translating everything again or copying the translation files
from one directory to the other all the time you just place a file called “redirect” into
the “en_uk” dir which contains the name of the original language
folder (in this case “en”).
1.040 (2003-02-06)
- Added support for storing the translations in a MySQL database. I didn’t
do a performance test with the mysql modus, but it seems way slower than
the other two options (gettext, inc files), even though translation requests
are partly cached.
- Also took care of a few minor bugs in the FormatDate class.
1.031b (2003-01-18)
- Added option in the flp_settings.ini file to turn on/off error
reporting if a string couldn’t be translated.
1.031 (2003-01-06)
- Corrected some bugs concerning the gettext modus in the Translator class.
- Also added a sample script.
ToDo
- Someday try to add translation strings to to shared memory,
if I ever get a linux pc to play with (I'm not really
familiar with linux).
- Some more options for currencies.
Author: Flaimo
Date: 2004-05-29
URLs:
Project homepage
Example script (PHP 4 version)