Language Packs

Languages

YaBB is built in English first (although you do NOT have to offer English once your forum is installed). At the moment, the YaBB installer is English only.

/yabb2/Languages/English contains the default *.lng files plus the .txt files, for such things as your registration agreement. naughty words, and the honeypot.. There are more .lng files than there are Templates because some .lng files are used to populate menus and options rather than whole containers. Generally, though, there will be a .lng file for each template.

There is one special file — unique to each added language — main.lng. This is the file that tells YaBB how to encode/decode the character set, the ISO Language code. As YaBB is written in English, and English contains the full ISO-8859-1 or UTF-8 codesets (based on ANSI) – YaBB 2.6+ can be either UTF-8 or ISO-8859-1 in English only. Other Languages will require a new unique main.lng as either ISO-8859 or UTF-8 to function correctly

How do you create a New Language Pack?

Select a Language Choice name in ASCII or Latinate text for the the folder – Such as ‘Deutsch’ for German. Now, copy all the .lng files from the ./Languages/English folder to your new Language folder.

Now you will need to modify Main.lng first. You are going to change the $abbr_lng to the correct value. It’s a 2 part value, language-country; e.g ‘en-US’, ‘fr-fr’, , you will use this twice, also as the ‘W3c_lngcode’

http://www.w3schools.com/tags/ref_country_codes.asp

Then you will need to chose the correct character encoding. IF it is a NEW YaBB forum, choose UTF-8. If it is an existing Forum that you are adding another language to, consult with YaBBfroum.com’s support community.

The language file is actually a series of Perl assignments:

The single ‘lines’ that begin with the @symbol are lists; The values must be enclosed with single quotes and the line must end with a semi-colon – you can put a comment afterward by adding a # comment.

@days = (‘Sunday’, ‘Monday’, ‘Tuesday’, Wednesday’,’Thursday’,’Friday’,’Saturday’); # days of the week

The sections that begin with a % are Perl hashes, a special type of list. The %value is the name of the hash followed by the ‘=’ and a open paren. ‘(‘ to begin the hash, each line then contains a single assignment, followed by a comma. The hash is closed by the close paren. ‘)’. and a semi-colon to complete the assignment.

%maintxt = (
‘w3c_lngcode’ => ‘en-us’,
‘error_description’ => ‘System Information’,

);

You literally only need to translate the second element in each assignment, to do the translation. You will find MANY terms are used in multiple files. Also note this is pure HTML display, so you can use use special characters or formatting e.g.

‘470a’ => ‘<i>Ex Member</i>’, — that will italicize the words Ex-Member (now you know how to change that to ‘dirtbag’, LOL)

&#167 returns the Copyright symbol

http://www.utexas.edu/learn/html/spchar.html

There are three ‘tricky things’/assignments — qq, $variable, and qw. qq and &variable often come together

qq is a special kind of Perl assignment – The expression will be evaluated before insertion –

http://www.misc-perl-info.com/perl-qq.html

qq~<img src=”$imagesdir/back_to_top.png” alt=”Top” title=”to Top” />~,

If you find a $variable in a qq – it means Perl will turn the text into that variable – such as $mbname returns the forum_name (myboardname). In the example above, $imagesdir is going to return the value of the local images folder as found in Paths.pm

Don’t edit the $variables or filenames you may find in. lng files

qw is a Perl assignment that creates a list (quoted words) – to be honest I have not run across this in Language files yet, but it would work in certain circumstances.

http://www.misc-perl-info.com/perl-qw.html

This is a Draft-in-work