This is an old revision of the document!
Table of Contents
Localizing DokuWiki (the Software)
DokuWiki's user interface can be configured to use any language by setting the appropriate option in the config.
You can help translating DokuWiki to your language by visiting the DokuWiki Localization Hub. We recommend to join the I18N Mailing List to be informed when new strings are added and need to be translated.
Localizing DokuWiki and its plugins and templates
Most of DokuWiki and its plugins and templates only provide localization for English and some other languages. We encourage you to translate them into your native language.
Important things to keep in mind when translating:
- Please try to complete your countries main official language before starting another dialect.
- If you do major translation work it is recommended to check your translations in the development snapshot. This gives you the opportunity to correct errors and verify the layout in your language.
- In some languages words and sentences tend to get longer than the original English words. Keep in mind that your translation needs to work on any screen size and it often looks better if words are in line with other items on the page.
- When translating technical descriptions of external origin like the API's delivered by Github, Twitter, Google etc please read the external manual first. This is especially important for translating interfaces. Maybe a localized version of the manual or helppages is already at the external source and you can use all or part of these.
- As DokuWiki wants to be standards-compliant, consider learning about these regarding your language first. You can learn about correct spelling and interpunction from dictionaries or webpages maintained by public institutions.
- Always keep the format strings intact, i.e. identical. Strings like these
%1$d
and<i>%s</i>
and<strong>Update:</strong>
. The wordUpdate:
should be translated but the word<strong>
not.
Directions for consistent translations
At the consistent translations page you can find:
- some preferred translations for regularly used words
- and how to handle placeholder order in non-english strings.
Plugins
Plugin authors can register their plugin at the DokuWiki Localization Hub where you can easily help to translate the plugin.
If a plugin is not translatable via the hub you can do it manually:
- Copy the content of
lib/plugins/<pluginname>/lang/en/
to
lib/plugins/<pluginname>/lang/<ISO-lang-code>/
- Zip up the new language folder and send it to the author for inclusion in future releases
For any further questions or general help you could send a mail to the I18N-Mailinglist or ask for help in the IRC-Channel.
Changing some localized texts and strings in your installation
There are many localized texts in DokuWiki like emails that are sent on registration, password forgotten, the text above the edit form, and more. Also the strings used in the buttons and links are translated. You can modify these by creating custom files with your version of the texts. This way your changes aren't overwritten on upgrades.
You can change these texts by copying the <name>.txt
files or copying some strings from lang.php
:
- from
inc/lang/<ISO 639-1-lang-code>/
- to
conf/lang/<ISO-lang-code>/
and editing the copied content.
You can do the same thing for plugins and templates by copying <name>.txt
or some strings from lang.php
:
- from
lib/plugins/<plugin>/lang/<ISO-lang-code>/
- to
conf/plugin_lang/<plugin>/<ISO-lang-code>/
- from
lib/tpl/<template>/lang/<ISO-lang-code>/
- to
conf/template_lang/<template>/<ISO-lang-code>/
Copy only strings from lang.php
which you will modify. The remaining strings are read from the original file.
Translating txt-files is possible since “Rincewind” 2011-04-22. Translating some strings from lang.php
since Release 2014-09-29 “Hrun”.
Example
Example of an English lang.php
file. This is possible for every language.
- conf/lang/en/lang.php
<?php /** * Customization of the english language file * Copy only the strings that needs to be modified */ $lang['btn_admin'] = 'Admin Panel';
Translating DokuWiki.org (the documentation)
Translating the DokuWiki documentation here at dokuwiki.org is encouraged. Translated pages are to be named like their English counterparts and stored in a separate namespace based on their ISO code. To make this easier the Translation Plugin adds links to existing and missing translations in the upper left corner of every page.
Only languages manually configured by the administrator are shown in the selector. If you want to add translations for a language currently not shown, just manually create the pages in the appropriate language subnamespace and send a mail to the I18N mailing list asking for your language to be added.
Translation Guidelines
- Feel free to create any missing translation
- Only pages in the top namespace should be translated
- Translated pages need to have the same (English) name as the original page
- Translated pages have to be stored in a sub namespace of the root namespace named by the ISO language code
- Please don't add stubs saying the page does not exist, yet.
- Please refrain from cluttering translations with credit lines – if you want to be recognized as translator, log in first
- A good starting point for translations is the manual
- You may also want to translate the sidebar to your language
Disabling translation feature for certain pages
Where translation is not sensible the ~~NOTRANS~~
macro should be inserted into the page.
See also
- Directions for consistent translations
- The I18N Team (translation team)
help:pages:'namespaces':
/:/
===== Creating Namespaces =====
You don't need to create namespaces separately; simply create pages with colons in the pagename.
The token after the last colon will be the name of the page itself, while all other tokens are namespaces.
All namespaces used in your pagename that don't exist already will be created by DokuWiki automatically.
A namespace can be created in the media manager after having selected a file on the local computer and adding a name:
(of namespace wanted) just before the media file name and then clicking upload
. This will create on the fly the namespace (folder) for the file media, visible after a refresh of the windows.
In DokuWiki, pages are created as in every other wiki. Simply create a link to a non existing page, follow this link, and click on Create this page. See also Adding pages.
^ Examples: ||
| example
.example
.:example | refers to the page “example” in the current namespace. |
| :example | refers to the page “example” in the root namespace. |
| ..example
..:example
.:..:example | refers to the page “example” in the parent namespace |
| wiki:example | refers to the page “example” in the namespace “wiki”. The namespace “wiki” is located beneath the root namespace. |
| ns1:ns2:example
:ns1:ns2:example | refers to the page “example” in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the root namespace. |
| .ns1:ns2:example
.:ns1:ns2:example | refers to the page “example” in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the current namespace. |
| ..ns1:ns2:example
..:ns1:ns2:example | refers to the page “example” in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beside the current namespace (i.e. both ns1 and the current namespace are beneath the same parent namespace, wherever according to the root namespace this parent may be located itself). |
| .ns1:ns2:
.:ns1:ns2: | refers to start page of the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the current namespace.
Please refer to Namespace Default Linking below how the start page is determined |
| ~example
~:example | refers to the page “example”, using the current page as a namespace. Eg. if used on the page “foo:bar”, the link will refer to “foo:bar:example”. This is an effective way of creating sub-namespaces from existing pages. |
Gotcha: The syntax for relative and absolute internal links is non-unique and complex relative to directory and filename conventions.
Links are absolute if and only if they have a “:” prefix or have no prefix but do have intermediate (or suffix) “:”
Links relative to the current namespace may also begin with either “.” or “.:” (“..” or “..:” for parent namespace).
===== Referring Images =====
Regarding referring of namespaces, images and other media files are handled like wiki pages. That means, the following refers to an image that belongs to the current namespace:
<code>
</code>
===== Deleting namespaces =====
When all pages inside a namespace are removed (see delete a page) the namespace logically doesn’t exist anymore. DokuWiki usually deletes the now empty directory as well.
===== How to rename namespaces? =====
==== Manual way ====
In order to rename a namespace manually you will have to:
* Rename the folders that represent the namespace in:
* data/pages
* data/media
(if this exists)
* Remove metadata for the namespace under data/meta
* Remove attic data for the namespace under data/attic
(or move that over as well, if you want to preserve old versions)
For example, on a Unix host, you could:
* mv /dokuwiki_base/data/pages/old_namespace /dokuwiki_base/data/pages/new_namespace
* mv /dokuwiki_base/data/media/old_namespace /dokuwiki_base/data/media/new_namespace
* rm -Rf /dokuwiki_base/data/meta/old_namespace
* move: mv /dokuwiki_base/data/attic/old_namespace /dokuwiki_base/data/attic/new_namespace
or remove: rm -Rf /dokuwiki_base/data/attic/old_namespace
Note that the old_namespace
and/or new_namespace
words may need to be encoded if they are on a non-Latin character set (i.e. Greek, Russian, etc).
* Correct (by editing them) all the links to the pages under the moved namespace (you can discover those before moving the namespace by reviewing each page's backlinks).
* Browse each and every page under the new namespace. This will create the missing indexing information and metadata for the pages under the moved namespace.
However, you will still have lots of junk left around. For example in data/changes.log
, various files under cache (including the .idx
files etc). If possible you could just start from a blank state
as follows (again under Unix) but be warned that this will mean losing all your historical information (i.e. recent changes
):
* cat /dev/null > /dokuwiki_base/data/changes.log
* rm -Rf /dokuwiki_base/data/attic/*
* rm -Rf /dokuwiki_base/data/cache/?
* rm -Rf /dokuwiki_base/data/cache/*.idx
* rm -Rf /dokuwiki_base/data/cache/purgefile
* Browse each and every page of your Wiki.
DISCLAIMER: I understand this is convoluted (and maybe I missed/messed a couple of things you should also do). All in all this is a PITA. You may also use a couple of plugins that are available for (re)building the searchindex for the complete wiki, erasing entire cache and/or old wiki revisions thus avoiding having to do this manually.
===== Namespace Default Linking =====
It is possible to link to the default page of a namespace by ending the linkid
with a colon: [[foo:bar:]]
. Which page the link links to is dependent on the
existence of certain named files. For [[foo:bar:]]
the following pages are
checked:
<code>
foo:bar:$conf['start']
foo:bar:bar
foo:bar
</code>
The pages are checked in that order and whatever page is found first will be linked to. Autoplural linking is not done for those links.
See startpage to learn about configuring the startpage name (defaults to start
).
===== Interwiki Links =====
DokuWiki supports Interwiki links. These are quick links to other Wikis.
For example: Wiki is a link to Wikipedia's page about Wikis. → Main article: Interwiki