About Features Downloads Getting Started Documentation Events Support GitHub

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
legacy:vufind_1.x_developer_manual:language_localization_support [2015/12/21 16:47]
demiankatz ↷ Links adapted because of a move operation
legacy:vufind_1.x_developer_manual:language_localization_support [2018/12/19 14:19] (current)
Line 1: Line 1:
 ====== Language / Localization Support ====== ====== Language / Localization Support ======
-// This page refers to VuFind 1.x; for newer documentation, see [[development:architecture:localization|VuFind 2.x Language/Localization Support]]. // +// This outdated page has been deleted to prevent confusion; for current documentation, see [[development:architecture:localization|this page]]. To view old content for historical interest, see the "Old Revisionslist below. //
- +
-VuFind supports multiple languages in its user interface through two main mechanisms. +
- +
-===== Translate Function ===== +
- +
-VuFind supports a global translate() function (available as {translate text='xxx'} tags within the Smarty templates) which will translate a string of text into the user's currently selected language by looking at the map files in the web/lang directory of the VuFind installation. +
- +
-Notes: +
- +
-  * If you attempt to translate a string that is not found in a language map, the original string will be displayed untranslated. +
-  * If you turn debug on in [[configuration:files:config.ini]], a special marker will be shown around untranslated strings to help track down missing translations in the code. +
-  * Many of the translated strings in the language files are simply chunks of English text.  However, more recent additions are represented as shorter tokens (i.e. "adv_search_filters").  The token approach is often preferable since it allows for more concise map files and reduces the chances of conflicts where the same text has multiple meanings. +
- +
-==== Formatting Language Files ==== +
- +
-When modifying an existing language file or creating a new one, you should observe these standards: +
- +
-  * Save the file in UTF-8 format without a Byte Order Marker (BOM).  Including a BOM may cause VuFind to fail to parse the file correctly. +
-  * Sort the file after adding new lines.  The TextTools add-on for [[http://www.jedit.org/|jEdit]] does a good job of this. +
-  * Put double-quotes around multi-word phrases on the right side of the equals sign.  Do NOT put quotes around phrases on the left side of the equals sign. +
- +
-For an example of a full language file, see [[https://vufind.svn.sourceforge.net/svnroot/vufind/trunk/web/lang/en.ini|en.ini]]. +
- +
-===== Help Screen Translation ===== +
- +
-//Note: This feature applies to VuFind 1.0RC2 and later only.// +
- +
-VuFind's help screens contain too much text for the standard {translate} mechanism to be a practical way of presenting them in multiple languages.  Instead, under the web/interface/themes/[your_theme]/Help directory, the help templates are in folders whose names correspond with VuFind language codes (i.e. "enfor English) When a user requests a help screen, VuFind attempts to serve them the most appropriate version for their selected language, though it defaults to the English version if nothing else is available; as of this writing, help screens have not been translated into all possible languages. +
- +
-===== Adding a New Language ===== +
- +
-  - Create a new language file as described [[#formatting language files|above]] and put it in the web/lang directory. +
-  - If desired, translate help screens as described [[#help screen translation|above]]. +
-  - Edit [[configuration:files:config.ini]] and add your new language to the [Languages] section.+
legacy/vufind_1.x_developer_manual/language_localization_support.txt · Last modified: 2018/12/19 14:19 by demiankatz