DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:translation

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:translation [2015-06-30 17:14] – [Installation] Sugg2: "must not" -> "you need not" 213.61.229.77plugin:translation [2023-12-14 23:50] (current) – version upped andi
Line 1: Line 1:
 ====== Translation Plugin ====== ====== Translation Plugin ======
- 
 ---- plugin ---- ---- plugin ----
 description: Help with translation efforts in a multilingual wiki description: Help with translation efforts in a multilingual wiki
Line 6: Line 5:
 email      : andi@splitbrain.org email      : andi@splitbrain.org
 type       : syntax, action type       : syntax, action
-lastupdate : 2015-05-22 +lastupdate : 2023-12-14 
-compatible : Angua,Adora Belle,Hrun+compatible : Angua, Adora Belle, Hrun, Frusterick Manners, Greebo, Hogfather
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : language+tags       : language, translation
  
 downloadurl: https://github.com/splitbrain/dokuwiki-plugin-translation/zipball/master downloadurl: https://github.com/splitbrain/dokuwiki-plugin-translation/zipball/master
Line 19: Line 18:
 ---- ----
  
-This plugin shows a list of available translations for a page. It is very simple and was built with the needs of www.dokuwiki.org in mind and is used for documentation translation efforts here. There are a few limitations:+This plugin shows a list of available translations for a page. It is very simple and was built with the needs of [[:dokuwiki|www.dokuwiki.org]] in mind and is used for documentation translation efforts here. There are a few limitations:
  
   * separate namespaces are used to store translations   * separate namespaces are used to store translations
Line 26: Line 25:
 ===== Download ===== ===== Download =====
  
-Use the download link given above to download the file manually or through the plugin manager. +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
 ==== Changes ==== ==== Changes ====
  
Line 34: Line 32:
 ===== Installation ===== ===== Installation =====
  
-  - Download and install the plugin through the [[plugin:Plugin]] Manager.+  - Search and install the plugin using the [[plugin:Extension]] Manager.
   - Configure it through the [[plugin:config|Config Manager]]   - Configure it through the [[plugin:config|Config Manager]]
   - Add the following code in your template's ''main.php'' in the directory ''lib/tpl/<yourTemplate>/'' (or put it in a ''lib/tpl/default/pageheader.html'' file for the old default template)   - Add the following code in your template's ''main.php'' in the directory ''lib/tpl/<yourTemplate>/'' (or put it in a ''lib/tpl/default/pageheader.html'' file for the old default template)
Line 59: Line 57:
   - no pages in the top namespace and all languages in sub namespaces   - no pages in the top namespace and all languages in sub namespaces
  
-Here at dokuwiki.org the first method is used. Certain features OTOH will only work with second method.+Here at dokuwiki.org the first method is used. Certain features OTOH will only work with the second method.
  
 There are several config options, all accessible through the config manager. There are several config options, all accessible through the config manager.
  
-The most important thing to configure is a list of languages you want to use in the ''translations'' setting. It is good practice to use [[http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes|ISO language codes]] for this. Your translation namespaces will be named like the options you set here. Separate each language with a comma or space. Depending on the type of setup you want to add your default language (the one configured in [[config:lang]]) here or omit it.+The most important thing to configure is a list of languages you want to use in the ''translations'' setting. It is good practice to use [[wp>List_of_ISO_639-1_codes|ISO language codes]] for this. Your translation namespaces will be named like the options you set here. Separate each language with a comma or space. Depending on the type of setup you want to add your default language (the one configured in [[config:lang]]) here or omit it.
  
   - for the default language in the top namespace, omit it from the config   - for the default language in the top namespace, omit it from the config
Line 70: Line 68:
 By default a list of translation links is shown. This can take quite a bit space when you have many translations. Enabling the ''dropdown'' option should help here. By default a list of translation links is shown. This can take quite a bit space when you have many translations. Enabling the ''dropdown'' option should help here.
  
-If you want to restrict translations to certain namespace you can define it in the ''translationns'' option. This is optional, leaving it empty will enable the plugin for the whole wiki.+If you want to restrict translations to one certain namespace you can define it in the ''translationns'' option. This is optional, leaving it empty will enable the plugin for the whole wiki.
  
 Similar to the above setting you can also disable translations for certain pages or namespaces using the ''skiptrans'' setting. It expects a regular expression to be matched against pagenames. When it matches, the translation switcher will not be displayed. The regexp is applied to the full pagename which starts with colon. Similar to the above setting you can also disable translations for certain pages or namespaces using the ''skiptrans'' setting. It expects a regular expression to be matched against pagenames. When it matches, the translation switcher will not be displayed. The regexp is applied to the full pagename which starts with colon.
 +
 +If you want to switch on the translation flag only for specific namespaces, you can do this by defining a regular expression that inverts the result, for example\\
 +''^((?!:redaktionssystem:techn_doku|:technik:verkaufsunterlagen|:en).)*$''.\\
 +Then only in the namespaces "redaktionssystem:techn_doku", "technik:verkaufsunterlagen" and "en" the translation plugin is active.
  
 You can optionally choose to let the plugin translate the whole user interface of DokuWiki too when a non-default language page is selected. Just enable the ''translateui'' option accordingly. You can optionally choose to let the plugin translate the whole user interface of DokuWiki too when a non-default language page is selected. Just enable the ''translateui'' option accordingly.
Line 119: Line 121:
 Usability experts agree that using country flags to represent a language is a really bad idea and should be avoided at all costs. This is because languages do not correspond to single countries. Usability experts agree that using country flags to represent a language is a really bad idea and should be avoided at all costs. This is because languages do not correspond to single countries.
  
-Simple example: what flag should represent English? The flag of England (red cross on white), the British flag (Union Jack) or the flag of the United states (Star-spangled banner)? Or what language would you expect when you see the Swiss flag? French? German? Rheto-Romanic?+Simple example: what flag should represent English? The flag of England (red cross on white), the Union Flag (aka "Union Jack"for the UK or the flag of the United states (Stars and stripes)? Or what language would you expect when you see the Swiss flag? French? German? Rheto-Romanic?
  
 I added support for flags because of the high demand for it but I strongly advise against using it. If you do, remember that your choice of flags will most probably annoy one group of your users, regardless what you chose. I added support for flags because of the high demand for it but I strongly advise against using it. If you do, remember that your choice of flags will most probably annoy one group of your users, regardless what you chose.
  
-Please note that flag support isn't 100% working when using the ''dropdown'' option in all Browsers. +New flags can be placed in SVG format in the ''flags'' directory of the plugin and need to be named after the language ISO code. 
- +
-New flags can be place in the ''flags'' directory of the plugin and need to be named after the ISO code. Only .gif is supported currently.+
  
 ===== Namespace template variables ===== ===== Namespace template variables =====
  
-The translation plugin add variables usable in [[:namespace_templates|Namespace Templates]].+The translation plugin adds variables usable in [[:namespace_templates|Namespace Templates]].
 ^ Variable ^ Description ^ Example ^ ^ Variable ^ Description ^ Example ^
 | @LANG@ | Language you have entered in your [[config:lang|lang config]] | en | | @LANG@ | Language you have entered in your [[config:lang|lang config]] | en |
Line 135: Line 135:
  
  
-===== Old translation warning based on ACL ===== 
- 
-I use translation for a public website, and would like a means to only show old translations only to registered users: As I also use the publish plugin, the translation page shows the "old translation" warning if there is a draft of the original. 
- 
-I am using an ugly hack now, which works, but would very much welcome a proper and maintainable implementation in the future. 
- 
- 
-===== Loading language selector ===== 
- 
-Would be great if the language selector could be loaded without modifying the template (and losing the changes with the next update and then trying hard to remember where you added it the last time). Don't know if there's a hook for that in the default template, but would definitely be helpful. Thanks! 
plugin/translation.1435677276.txt.gz · Last modified: 2015-06-30 17:14 by 213.61.229.77

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki