Editing language

Once you've made a new language (based on English), you can start translation. Basically, there are 2 different ways of translating Drake CMS:

Language files are a collection of the following types of files:

It is STRONGLY advised that you use Language Manager, whenever it is possible. If you REALLY want to use an external editor, read the notes below about translating PHP include files:

  1. Drake CMS language files are stored in a, 2 lowercase letters, folder (named using the ISO 3166 specification) and consist of plain PHP files with define declarations inside them. Example:
     <?php
     define('_RESOURCE_ID_1', "this is an example resource\nwith newlines and %s special parameters");
     define('_RESOURCE_ID_2', "this resource contains < HTML entities >, but you will not see them
     in the rendered output nor the language editing form");
     ...
     ?>
  2. The language files must be encoded in UTF-8 WITHOUT BOM, otherwise Drake CMS will crash on some pages
  3. Language resources MUST NOT contain any HTML tags. If you have some, the Normalization (you can read more about it in Testing language) procedure should fix them
  4. Language resources are automatically saved by Drake CMS through the htmlspecialchars() PHP function, so they will not contain any HTML-breaking character. They can contain newlines, although they will be rendered, as HTML line breaks only if they are be placed in HTML output. If you are using the Language Manager to make your translations, you do not have to worry about HTML entities and encoding, as the language files will be properly saved by Drake CMS itself. However, if you are using an external editor, remember that it has to support UTF-8 (like Notepad++), but still you have to take care with XHTML entities like &, <, > etc. which must be encoded (&amp;, &lt;, &gt;) manually

If you've decided to use Language Manager, cycle between PHP filenames to edit them. When you've finished, press Save button. Next time when you'll be editing your language, a new option called Save & edit again appear. That way you can save your changes (so you won't lost them if something wrong happened) and continue editing.

image

Whichever method you choose - please remember that if a language resource contains special parameters (like %s or %d) you MUST keep their order within the language resource. You should also read IMPORTANT notes about Special language resources.

It is also possible to translate the Frontend site (site which is visible as a default main site after installation at the address http://address_of_your_drake_installation/) and other words which can't be found in any of the previously mentioned files - it's because they're in the Drake CMS database. If you would like to translate them also, follow these steps:

  1. Make a brand new Drake CMS installation (it's IMPORTANT that you really make a new one using the latest SVN files)
  2. Install your language
  3. Translate all the remaining visible English strings through the Administration panel using edit functions (for example: Menu -> Add/Edit Menus) OR you can edit them manually later (not suggested)
  4. Make a backup of database through System -> Database -> Manage Backups
  5. If you did not translate all of the remaining English words (as described in step 3), now you will have to open the backup file and manually edit the appropriate English strings. It's YOUR RESPONSIBILITY, you have to know what you're doing
  6. Open backup file and remove:

    the DKPDL headers (first 2 lines),

    all DROP and CREATE statements,

    all INSERT INTO #__users statements

  7. Rename backup file to inserts.sql and upload it via SVN to /i18n/<language>/install/inserts.sql path