PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 How to localise/translate phpBB 
Description: Information on localisation of phpBB, and how to create a language pack.
Author: psoTFX
Date: Thu Jan 16, 2003 7:12 pm
Type: HowTo
Keywords: localise, localize, language pack, i18n, l10n
Category: Miscellanea
Before you start

phpBB has been localised into a number of languages and packages for these can be found on the download page.

Before starting a translation please review the download page listing first!. If you have updates, fixes, suggestions, etc. please submit them to the noted maintainer. Do not submit these to the bug tracker, they will be closed without any action being taken. If you receive no response from the listed translator after a 2 week period please inform Acyd Burn (by PM).

Getting started

If your language is not listed then please feel free to produce a new package. Creating a localisation is not difficult but is time consuming. I suggest you think carefully before starting as to whether you have enough time to complete the translation (half completed packages are of no use to us).

Before starting your localisation please obtain and install the very latest version of phpBB available. Please do not use an older version, your submission will quite possibly be missing words. Please note we take submissions on a first-come-first-served basis. Do not be surprised to see someone elses package appear if you take several months to write your localisation!

All the files within the languages/lang_english folder need to be translated or modified (there are two exceptions here). Specifically these are:

  • lang_main.php
  • lang_admin.php
  • lang_bbcode.php
  • lang_faq.php
  • email/admin_activate.tpl
  • email/admin_send_email.tpl
  • email/admin_welcome_activated.tpl
  • email/admin_welcome_inactive.tpl
  • email/coppa_welcome_inactive.tpl
  • email/group_added.tpl
  • email/group_approved.tpl
  • email/group_request.tpl
  • email/index.htm
  • email/privmsg_notify.tpl
  • email/profile_send_email.tpl
  • email/topic_notify.tpl
  • email/user_activate.tpl
  • email/user_activate_passwd.tpl
  • email/user_welcome.tpl
  • email/user_welcome_inactive.tpl


There are two additional files:

  • search_stopwords.txt
  • search_synonyms.txt


It is not essential that these be translated but it is useful and you are encouraged to do so. If you do not localise these please remove them from your package.

The first of these two files, search_stopwords.txt contains a list of words which serve only to fill out text, e.g. the, a, over, there, here, etc. Most languages have similar "common" words and if possible you should create your own list of such words (don't simply translate the English text since some words may not be applicable to your language).

The second file, search_synonyms lists words which have duplicated meaning or spelling, e.g. authorize and authorise are the same word but with U.S./British spelling. vol and volume typically have the same meaning, etc. It is also useful for words which are commonly mispelled. Again don't simply translate the English version since it may not apply to your language. If appropriate please fill out this file with synonyms applicable to your language.

subSilver localisation

Before we can make a translation available we will also want to produce a localisation of the subSilver buttons for your language. If you have Photoshop or Paint Shop Pro you can do this yourself using the subSilver SDK (available from the downloads page).

Alternatively we can produce the localisation for you. In this case please contact Acyd Burn or dhn with translations of each of the subSilver buttons listed below:

  • icon_aim.gif
  • icon_edit.gif
  • icon_email.gif
  • icon_icq_add.gif
  • icon_ip.gif
  • icon_msnm.gif
  • icon_pm.gif
  • icon_profile.gif
  • icon_quote.gif
  • icon_search.gif
  • icon_www.gif
  • icon_yim.gif
  • msg_newpost.gif
  • post.gif
  • reply.gif
  • reply-locked.gif
.

If your language uses an encoding other than iso-8859-1 please say which encoding to use within the PM. Otherwise special characters may not appear correctly and the images will be incorrect.

Please note that we will not release a localisation until subSilver images are available.

What to do when you're finished

Please package up your localisation (if submitting subSilver and lang files please package them seperately) and write a PM to Acyd Burn to let him know your package is ready for distribution. In that message please be sure to include the following details:

  • Your username (or usernames if more than one person is involved) here at phpBB.com,
  • The language you have translated (in English)
  • and the language localised


The package will then be checked and you will be notified of any problem. If you fail to respond to any message sent I'm afraid your package will not appear. Please allow at least 7 days before asking where your package is.

If everything is well we will add you (and the other told users) as the language pack author. From there on you see an update link beneath your language pack listed. Following this link leads to the language pack update page where you are able to submit your package.

Important things to note

lang_main.php

When translating lang_main.php you will find a block of variables near the top:
Code:
$lang['ENCODING'] = 'iso-8859-1';
$lang['DIRECTION'] = 'ltr';
$lang['LEFT'] = 'left';
$lang['RIGHT'] = 'right';
$lang['DATE_FORMAT'] =  'd M Y'

The first of these is the encoding that should be used by the browser to display your language, e.g. Western European = iso-8859-1 (or iso-8859-15), Traditional Chinese = big5, etc. Please use an appropriate encoding!

The next three variables; DIRECTION, LEFT and RIGHT determine how text should be displayed in the browser, from left to right or right to left. Most languages are left to right and so the English settings can be left as they are. If your language is right to left you should change DIRECTION to rtl and flip the LEFT and RIGHT variables, i.e. LEFT = right and RIGHT = left. Please do not translate these values into your language! They should be left in English.

The final variable DATE_FORMAT is a short date format common to your language or locale. Try and use a format which is indeed common but which can be applied to all locales using your language. For example the UK uses a short date format of dd/mm/yy but North America uses a format mm/dd/yy. If we were to use the UK format for English the 1st June 2003 would be output as 01/06/03. However Americans and Canadians would read this as January 6th 2003. Therefore we use a date format which can be easily understood by all, d M Y which would output that date as 1 Jun 2003.

You may optionally include a message indicating you translated this language via the $lang['TRANSLATION_INFO'] = '' variable. Please keep any such information brief and to the point. Additionally you may include comments within lang_main.php, e.g. to enable people to contact you, to indicate revision numbers, etc. Again please keep any such comments brief.

email templates

The email templates have a certain format to them, you must follow this format! All the templates contain at least a line:
Code:
Charset: XXXXXX

Where XXXXX is the appropriate encoding for your language. In many cases this will be same as that used in lang_main.php but occasionally it will be different.

A number of the templates also contain a line:
Code:
Subject: XXXXXXX

you should translate only XXXXXX (where XXXXX is the appropriate subject heading). Do not translate anything before the colon, : ! i.e. Subject: should be left as Subject: and not translated into your language. The same applies to Charset:. If you do translate these emails will be sent with incorrect charset and/or subject headings!

Similarly do not translate anything within curly braces, { }. The text within these is replaced by phpBB when sending an email. If you translate them the user will receive an incorrect message.

Finally do not add extra newlines, particularly not between Charset/Subject and the bulk of the message. Similarly do not remove newlines. Doing so may cause emails to be sent with the wrong encoding or missing Subjects and/or incorrect message text.

Format of all files

If possible please try to save your files in UNIX format rather than Windows, PC or Mac format. Your editor may allow you to switch between file types, please see your editors documentation.

What to do when you have completed your translation

When you have completed your language (and subSilver if relevant) files please first check them! If at all possible please test them on an installation of phpBB 2.0. This will quickly show whether any basic problems exist, e.g. unclosed quotes, missing semi-colons ;, etc.

Once submitted (through the update page being told earlier about) some basic checks will be done to ensure all the required files are present and that all variables have been translated. If any problems are found you will be notified and asked to correct them. The packages will then be made available via our download page here.

How to update your language packages

If you wish to submit updates to your language packages (or subSilver images) please visit the downloads page. If you are listed as maintaining a language you will find a small "Update" link next to your language. Click that and you will be able to modify the localised name and submit new packages. You will need to submit a full archive (either .zip or .tar.gz) and not just single files!

The submit procedure will do various checks and inform you if any files or variables are missing. If this happens you should update your packages and resubmit them. Updated packages will be made available as soon as possible but this could be anything up to 2 days+ depending on the time of year.

FAQ

  • My language is listed but isn't being maintained!

    If your language is listed please contact the listed maintainer. If you do not receive a reply with two weeks (14 days) please contact Acyd Burn via PM here.

    Most of the Group and Teams are native English speakers (with a few from continental European nations) and we therefore rely on the community to localise phpBB. If you have the time and skill to translate all the necessary files please see the "Getting Started" section above. If not but you know someone who does perhaps you can persuade them to volunteer.
  • I maintain a language but cannot update it!

    If you maintain one of the language packages listed on our downloads page but cannot see a little "Update" link please contact Acyd Burn.
  • I get "Missing key" errors when submitting an updated package?!

    The update system does a number of checks on submitted archives. One of these tests to see whether all the variables present in the current release of phpBB are present in your files. If any are missing you are notified in the way you describe. You should add these missing variables (referring to the lang_english files in the most recent release of phpBB) and try resubmitting your package.
  • There are errors in X language!
    If you find what you consider to be errors, mistakes, etc. in a translation please contact the appropriate maintainer. Please do not post a bug report nor contact Acyd Burn. We only maintain the English language pack and will not alter any other localisation. This is simply because as native English speakers (as most of the Group is) we cannot be certain any change is correct.

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.