class.upload.php translations

Since version 0.25, the class error messages can now be translated. If your language is not listed below, send me your own translation!

How to use the translation files?

Instantiate the class with a second argument being the language code. For instance, for the French language, you need to have the file class.upload.fr_FR.php in a directory lang/, below the main upload class. Then, instantiate the class as following:

$handle = new upload($_FILES['image_field'], 'fr_FR'); $handle = new upload('/home/user/myfile.jpg', 'fr_FR');  

Note that the class is by default in English. If you only needs English language, you don't need any translation files.

How to create translations?

You can use this file as a template to create new language files. In the file, the messages are provided in English; simply change the text in the array (don't change any keys!). Then, put your name in the file, and replace all the xxxx that can be there. Rename the file with your language code instead of xx_XX, and send it to me.

The file must be edited in UTF-8, but don't save it with the BOM bit. You can use an editor such as Scite to open the file, and then select File > Encoding > UTF-8 Cookie to see the characters properly.

Translations available

Here is a list of the translations available. Although there are also provided in the packages, you can get the latest versions here. Download it, replace the .txt extension with .php, and you're done.

  • Brazilian Portugese translation by Yuri Vecchi Baladelli. Download here
  • Ukrainian translation by Sergiy Galashyn. Download here
    Also by Sergiy Galashyn, a Windows-1251 encoded translation file: Download here
  • Indonesian (Bahasa) translation by Irwan Butar Butar. Download here
  • Chinese translation by Shiwei Cao (曹诗蔚). Download here
    Also by Shiwei Cao, a gb-2312 encoded translation file: Download here
  • Traditional Chinese translation by Yang Chih-Wen. Download here

It is normal that some files appear with some weird characters. It is because the translations are in UTF-8, but without the BOM byte. Simply use the file as is, and set your web page to be in UTF-8.