@Mail Language System
1 Introduction to the @Mail Language System
2 The lang Folder Overview
3 Editing the HTML templates
4 Remaining your custom pages
5 Installing Languages
6 Creating A New Language
7 Related Technical / support information
1 Introduction to the @Mail Language System
The @Mail Language System allows you to add support for multiple languages.
Using one document (.lang file) per language @Mail will build the HTML
files needed.
Using this method of making languages to html templates will drastically
increase performance over storing all language related strings in a
database.
When a new version becomes available, the whole interface doesn't have
to be translated again. Simply append the new information to the existing
.lang file and rebuild the HTML files.
To download the latest english.lang to translate click here. Use this file to translate into a new language.
2 The lang Folder Overview
The lang folder, which is located in the @Mail installation folder,
contains 3 subfolders.
- The html folder, which holds the master HTML templates. @Mail
combines these with the .lang files to build the HTML files that your
users see when they login to @Mail. You must edit these files before
you start translating the .lang files. See 2 Editing
the HTML templates on what to look out for when editing the html.
See 4 Installing languages on how to install
- The lang folder, which holds the separate Language Files.
If you are installing a new language extract the package here in a
new folder with the name of the language you are installing. See 4
Installing languages on how to install these new languages.
- The custom folder, which you can use to put any custom pages
in you want to be copied over after the new languages have been created.
For example a different startpage for different languages. See 3
Retaining your custom pages for more information.
- The preserved file, which is related to the custom folder
mentioned above. See 3 Retaining your custom pages
for more information.
3 Editing the HTML templates
The HTML can be edited here to change the html layout for all the languages.
There are a couple of things that you have to keep in mind while editing:
- The text used in the templates is defined as the $lang{referanceName}
variables where referanceName is any string to recognize the translated
text as defined in the language.lang files. When looking for html
around a specific piece of text, search for the text in english.lang
and read what the variable name is that defines the piece of text.
You will find this variable as $lang{referanceName} in the html templates
and you can edit the html around it.
- Variables used for @Mail can have the form $var{variableName}, $pref{variableName},
$atmail{variableName}. To be safe, please don't edit anything starting
with a $.
- In the code you may find special comments like <!-- Include,
and <!-- if($var{variableName} =1) >, or similar looking tags.
These special tags, which look a bit like html comments, but
are used by @Mail to tell if the information should be printed in
the browser or not. The Include Tag is used to include a whole html
document in the code and is always true.
4 Retaining your custom pages
To make sure your custom pages for specific languages get retained
in their normal state you have to place the files in the custom folder.
Enter the paths to the html files and the paths to their locations in
the language folder in the file lang/preserve as shown below:
# List which files to be preserved
# Custom Filename = Location of file in language template
custom/login.html = html/english/login.html
custom/header.html = html/english/simple/header.html
After the making of the new languages, these custom pages get copied
over to their destinations directly. You can't use $lang variables in
these files any longer, all the text used in the files has to be translated
in advance.
5 Installing Languages
If you are installing a language you downloaded, copy the tgz file
to the /atmail/lang/languages/ folder. Untar the new language. In this
example I have just downloaded the new language files for the language
English. Because I already had a language English, I'm also removing
the previously used language files in the lang/languages/english and
the old menubar icons in the imgs/menubar-english folder first:
shell# cd /path-to-atmail/lang/languages/
shell# rm -rf english
shell# rm -rf ../../imgs/menubar-english
shell# tar xfz lang.english.3.31.tgz
And check if the new english/ folder has been created.
To install the languages you have to use the lang.pl script. You have
to run the lang.pl script from the main @Mail folder, where it is located.
You can install individual languages by making the syntax for example:
shell# perl lang.pl language-name path-to-langfile
shell# perl lang.pl english lang/languages/english/english.lang
shell# perl lang.pl italiano lang/languages/italiano/italiano.lang
shell# perl lang.pl chinese lang/languages/chinese/chinese.lang
etc...
Using the all function, @Mail will automatically install ALL languages
found in your ./lang/languages folder. Languages will be recorded in
the Configuration as their folder name You can run the Make All function
like this:
shell# perl ./lang.pl all
To change the names of the installed languages in the drop down box
on the login page and the other language boxes throughout @Mail edit
the values for the variables used in ./libs/Atmail/Config.pm
6 Creating A New Language
Go to the languages folder and create a new folder for the language
you wish to create. In the example here I am going to create a new language
called Russian, and I'm going to use the English language file to make
the Russian language file out of.
shell# cd /path-to-atmail/lang/languages/
shell# mkdir russian
shell# cp english/english.lang russian/russian.lang
shell# cd russian
You can now edit the file /path-to-atmail/lang/languages/russian/russian.lang.
Replace the original name with your name and translate all the English
language variables to the language you want to translate to. Read the
comments in the top of the file about any consideration you should use
regarding markup or javascript variables.
Download the archive to a windows/Mac computer and extract the folder.
Open the files (*.psd) in Adobe Photoshop, or any other psd editor you
might be using. Edit the layers containing the text, and change these
layers to display the text in the language you are translating to. Save
all the files in one folder as GIF images, with the same name as the.
Upload the images you created to a folder named /path-to-atmail/lang/languages/russian/menubar-russian/
The New Language is now ready to be installed as described in 5
Installing Languages.
7 Contact Support
For additional support, please visit our web site, http://webbasedemail.com
Or send us an eMail : support@CalaCode.com
|