Differences

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

Link to this comparison view

Next revision
Previous revision
en:entwickler:how_to_make_your_plugin_translatable [2015/11/19 16:08] – created fasseen:entwickler:how_to_make_your_plugin_translatable [2019/08/01 08:29] (current) – [Use language files within your plugin] fasse
Line 2: Line 2:
  
 ==== Create an xml file with your strings ==== ==== Create an xml file with your strings ====
-Admidio uses for translations the [[http://developer.android.com/guide/topics/resources/string-resource.html|Android string resource]]. This is a very compact xml format that should contain every string you use in your plugin. +Admidio uses for translations the [[https://developer.android.com/guide/topics/resources/string-resource.html|Android string resource]]. This is a very compact xml format that should contain every string you use in your plugin. 
  
 The format looks like this: <code xml><?xml version="1.0" encoding="UTF-8"?> The format looks like this: <code xml><?xml version="1.0" encoding="UTF-8"?>
Line 21: Line 21:
  
 You may now have the following file in your plugin folder //plugin_folder/languages/en.xml//. You may now have the following file in your plugin folder //plugin_folder/languages/en.xml//.
 +
 +For more information about the language file itself have a look at [[en:entwickler:mehrsprachigkeit|this documentation]].
 +
 +==== Use language files within your plugin ====
 +
 +Also in Plugins own language files can be integrated and accessed to existing Admidio language files. Access to the Admidio language files is done relatively easily over the already used syntax in Admidio itself. 
 +<code php>$gL10n->get('SYS_ALL')</code>\\
 +If someone wants to use new unused texts in the plugin, so it must be created an own language file for the plugin. For this, a folder is created in the plugin folder **languages**, where then a newly language file is to be created ,example **de.xml**. The structure of this language file must match from the section **XML language file**. This new folder will be automatically loaded if you open Admidio in a new browser session. Now, using the familiar syntax texts from these language files of plugins are accessible. There is no special adaptation necessary. <code php>$gL10n->get('PLG_MY_PLUGIN_HOUSE')</code>
  
 ==== Find translators for your language file ==== ==== Find translators for your language file ====
-Now that you have created a language file it's possible to translate these strings to several other languages. You can do that by yourself or search for people who will do this but it's also possible to add your file to the [[https://www.transifex.com/admidio/admidio/dashboard/|Admidio Project]] at [[http://www.transifex.com|Transifex]]. We have already people who translate Admidio into another language and maybe they could also translate the strings of your plugin.+Now that you have created a language file it's possible to translate these strings to several other languages. You can do that by yourself or search for people who will do this but it's also possible to add your file to the [[https://www.transifex.com/admidio/admidio/dashboard/|Admidio Project]] at [[https://www.transifex.com|Transifex]]. We have already people who translate Admidio into another language and maybe they could also translate the strings of your plugin.
  • en/entwickler/how_to_make_your_plugin_translatable.1447945727.txt.gz
  • Last modified: 2015/11/19 16:08
  • by fasse