
|
 |
Using and creating language files
Posted on: March 24, 2000, 11:39 p.m.
Home Free supports an unlimited number of different languages using just one instance of the cgi program running and one backend database. All text has been removed from the perl program itself to one library file for easy translation into another language.
Currently English is the only language supported by Solution Scripts and the only language file contained in the download. Others have been nice enough to let Solution Scripts redistribute their translated language files. Current languages available are:
The language files themselves can be downloaded in one large package in the download area of the mebers area.
Language files themselves should be named for the language the represent and followed with a .lang so English is english.lang and Spanish would be spanish.lang and so on.
To use these language files simply place them into the same directory as the rest of your Home Free cgi files. Then to direct a person to the correct language signup or manager form, simply add the language name to the end of the url like you would another folder. For example to view the spanish version of the signup form (new.cgi) you would like or send your members to:
http://www.domain.com/cgi-bin/new.cgi/spanish
Home Free will know to use the spanish language file and all the output will be in spanish. The same setup goes for manager.cgi as well as search.cgi, simply add /language at the end of the url. The user will be shown the specified language throughout the session. (English is the default so nothing needs to be added)
Translating a lang file to a new language
Creating a new language for Home Free to use is rather simple. First make a copy of the english.lang file and name it with the language you will be translating to.
For example: english.lang -> german.lang
if you are translating it into German.
Now open up the new language file and begin translating
The lang files are in the format of:
$um1 = 'File Manager';
$um2 = 'Are you sure you want to delete this directory';
$um3 = 'Are you sure you want to delete these files';
$um4 = 'Account Name:';
$um5 = 'Current Directory:';
$um6 = 'Select a directory:';
$um7 = 'Jump to selected dir.';
Where the areas in red are what need to be translated. Be sure to keep the all translation within the single quotes.
So if the above was translated into German you would have:
$um1 = 'Datei- Manager';
$um2 = 'Sind Sie sicher, dass Sie dieses Verzeichnis löschen wollen';
$um3 = 'Sind Sie sicher, dass Sie diese Datei löschen wollen';
$um4 = 'Accountname:';
$um5 = 'Aktuelles Verzeichnis:';
$um6 = 'Wählen Sie ein Verzeichnis:';
$um7 = 'Zum ausgewählten Verzeichnis springen';
Once the translation is complete, upload the new lang file to your Home Free cgi directory and test via methods shown above for using multiple language files.
Changing Default Language
The default language comes hard coded as english. If you wish to switch this, simple open acc_auth.pl and change "english" in the following lines to the language you desire:
$thelang = $pathinfo if $pathinfo;
$thelang = "english" unless $pathinfo;
if (-e "$thelang.lang") {
require "$thelang.lang";
}
else {
require "english.lang" || print "$!";
}
Upload the edited acc_auth.pl and the default language will be changed.
Please note: The admin section of Home Free does not use language files and is hard coded in english. End users will never need to see the admin section.
|
|