Translation guide

osFaq has built in multi-language support. To change languages, just select your desired language from the option on the osFaq settings page.

Since osFaq was written a significant amount of effort has been put into the translation system. The reason for this was fueled by public demand and an internationally diverse user base.
The changes in osFaq v1.0-ST help bring it all together. From the Installer onwards, almost everything can be translated including the system setting descriptions. Image and Attachment uploads also support UTF-8 character-sets.

Below, Ive included a list of thoughts and major points to act as a rough guide for anyone wishing to translate osFaq for their language. If you do a full translation for a language not already included with osFaq, and would like to have it included in the base source code, please contact me with a link to your translation or some way I can contact you and Ill do my best to include it in the next release.

From osFaq v1.0-ST onwards the following translations are included:

For Translators:

To create a new translation pack (for osFaq v1.0 ST and above):

  1. Creating a new Translation pack:
    1. Copy the english translation folder in /faq/include/language/ and name your copy to your translations name.
    2. The installer/upgrader also has a translation folder in /faq/setup/inc/language/.
    • Please use only standard ASCII characters for the folder names.
    • See the existing translations in the language folders for examples.
  2. Goto the settings area, edit the language and select your new translation from the list (a log out is no longer required to see new languages for v1.0 ST and above).
    • NOTE: The installer will ask the installee to choose a language when it starts.
  3. When editting a language file, make sure you are using a UTF-8 capable editor and make sure the file is saved as UTF-8. Otherwise any non-ascii characters will become corrupted.
    • NOTES: There are a number of cost-free open-source editors available if you dont already have one. JEdit, Eclipse and Netbeans are all excellant editors, theres tons more. Naturally most commercial editors are also fine. I use a range of editors depending on what Im doing; both open source and commercial types.

osFaq v1.0 ST and above comes with a single SQL file in each translation folder at [/faq/include/language/…]

  • The SQL translation file is for the osFaq settings page and contains the setting names and descriptions.
  • When updating the SQL file there are some simple rules to follow:
    • For the language column, enter that same name you used for the translation folder.
    • Backslash single quotes that appear in your text.
    • Do NOT use any ; characters in your text.
    • Do NOT include SQL comments in the file.
    • Before releasing a translation to the public, test the file in osFaq. If you encounter any errors you are unable to resolve you should also try testing the file in PhpMyAdmin (in a test database). If you are still having trouble, please let me know via the projects support area. You might find it easiest to edit the SQL file using PhpMyAdmin or some other SQL client software.

General notes for the SQL Translation file:

  • osFaq will run through some validation checks before attempting to use an SQL translation file. If any errors are encountered while inserting an SQL translation file it will attempt to restore the previous version of the language if it was already installed.
    • During the validation process osFaq will notify you if:
      • There are any duplicated or missing entries in the file.
      • Any of the entries have the wrong language name.
      • The file isnt valid for osFaq.
      • There are any SQL syntax errors.
  • If the language SQL is not included with a translation or not in the database, the system will fallback to english.
  • To refresh the SQL entries for an installed language, upload the new SQL file to the appropriate language translation folder, go to osFaq settings, edit the language then click save without making any changes. That will cause osFaq to replace the existing translation in the DB with the new data.
  • Multiple languages can reside in the database at once without conflicting.

If you would like to add anything to this document, please contact me via the projects area at Sourceforge