====== Translator Plugin ====== ---- plugin ---- description: MySQL based translation tool author : i-net software / Gerry Weißbach email : tools@inetsoftware.de type : action, admin, syntax lastupdate : 2011-01-07 compatible : 2009-07-30 depends : conflicts : similar : tags : language, database, mysql downloadurl: https://trello.com/1/cards/5afb22062ac5aff2271782d5/attachments/5afb222011781dd0a4f04f06/download/translator.zip bugtracker : http://www.inetsoftware.de/support/e-mail-support-accounts sourcerepo : donationurl: screenshot_img: ---- :!: This plugin requires [[https://github.com/i-net-software/dokuwiki-plugin-databaseconnector|Database Connector Plugin]]. ===== Download and Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. ===== Documentation ===== > //Translator — Manage your project translations// The Translator plugin helps developers to create translations for multi-language setups of their programs. The data is completely stored in a MySQL Database. You simply translate the same values (key and value have to be exactly the same on import) only once to have them updated in other categories. Translators can display ''all'', ''not translated'' and ''translated'' values to concentrate on either currently empty values or (spell) checking existing values. The input of the language files must have the following format: # Key = Value # e.g. dialog.OK = OK dialog.Cancel = Cancel $data['create'] = Create new Page ==== Configuration ==== You will have to edit some settings in the DokuWiki Configuration Manager in order to use the translator. Here you can define the “Master Language” -- which is English by default. You can also enter the connection data to your database system containing the translation data. > **Prequisite:** you need an MySQL database up and running and your PHP has to have the mysqli extension. You'll need to create a database prior to using the plugin. ==== Administration ==== === User === After having set up the database connection you can access the administration GUI for the translator plugin (from the admin menu) and add translation rights to your users. The List will display all users in your DokuWiki together with an input field where you can add language shortcuts which will be used as identifiers for the languages, e.g. ''%%de|es|it%%''. Hit update to save your changes. === Categories === Next you'll want to create categories. A category consists of a unique identifier and a file pattern with the shortcut ”[LANG]” within the name, which will be replaced with the language abbreviations. Later on, the system checks if imported files really belong to a category by matching the file to the pattern. For example: * **Pattern:** LanguageResources[LANG].properties * You can import files with: * LanguageResources.properties (this is the **Master Language**) * LanguageResources_en.properties (also the **Master Language** if set to ''en'') * LanguageResources_de.properties (Language is ''de'') * LanguageResources_zh_CN.properties (Language is ''zh_CN'') === Import === When you create your first category the admin page offers a new fieldset with an upload form. There you can choose a category, as well as insert the version you want to create (this version is only needed for a Master Language) and upload the files. > **Hint:** If you have a modern browser supporting HTML5 (e.g Safari 4+ or the latest Chrome editions), you can select multiple files to be imported at once. === Export === The Export Manager offers all categories and available languages of the system. Hitting the export button downloads a language file where the filename is matches the category pattern. ==== Syntax ==== The following syntax code has to be inserted into the page that you want to have the public translator. It will display the status of the current translations and the translation matrix for users who are logged in and have the right to edit a translation. ~~TRANSLATOR~~