Help:Extension:Translate/Unstructured element translation/de

Auf dieser Seite erfährst Du, wie Du die Übersetzung von benutzerdefinierten Wiki-Benutzeroberflächen-Nachrichten mit der Translate-Erweiterung etwas einfacher gestalten kannst. Dies gilt für jeden Teil des Wikis, den Du automatisch in der Sprache der Benutzeroberfläche bereitstellen möchtest. Das typischste Beispiel ist die Seitenleiste, da es nur eine geben kann. Dieselbe Methode kann aber für die Hauptseite verwendet werden, wenn Du alle Übersetzungen unter demselben Titel haben oder sogar für Vorlagen verwenden möchtest.

Diese Methode ist auch auf Wiki-Inhalte anwendbar, bei denen die Übersetzung ganzer Seiten einfach nicht passt, z. B. Seiten mit vielen Markups oder Vorlagen, deren Markups Du den Übersetzern nicht zur Verfügung stellen möchtest. Dies alles dreht sich um Interface-Aussagen oder das magische Wort, das Dir erlaubt überall dort Interface-Aussagen einzufügen, wo Du Wikitext schreiben kannst. Dieses Zauberwort ermöglicht es, die Aussage, ob Standard, individualisiert oder neu, automatisch in die jeweilige Sprache der Benutzeroberfläche zu ersetzen.

Du kannst es verwenden, um die Fähigkeit der automatischen Lokalisierung der Benutzeroberfläche des Wikis auf den Inhalt des Wikis zu übertragen, aber es löst das Problem nicht für anonyme Benutzer, die die Sprache der Benutzeroberfläche nicht standardmäßig ändern können. Beachte den Hinweis zur Universal Language Selector-Erweiterung weiter unten.

Im Vergleich zu einer reinen Seitenübersetzung, weist diese Methode einige Nachteile auf:


 * 1) MediaWiki developers usually discourage the usage of  because it fragments the cache. Instead of storing one cached rendered version of a page, when  is used it needs to be cached potentially in hundreds of different languages.
 * 2) It is harder to setup, requiring access to wiki configuration.
 * 3) There is no automatic tracking of outdated translations and completion statistics might be off when new messages are added or deleted.
 * 4) Only wiki administrators can add messages to the message groups and translate them. This means that the system is suitable only for pages which don't change often, or administrators will have a lot of work.

The good thing is that it works most of the time and you can still get the job done. There are two tutorials that provide examples of the common use cases. Before that there is section which details how to set up a message group, something which is always needed when using this method.

Einrichtung
A server administrator must complete this step. The following snippet needs to be added to LocalSettings.php: The message group id,, must be unique, so don't reuse the same id for multiple groups. The second parameter to the  constructor, , refers to the MediaWiki:Sidebar-messages page. The label is shown in dropdowns and other places where you can select a message group. The description is shown in Special:Translate. Those are the values you can and should change to what suits your wiki when adding a new custom message group.

Übersetzte Seitenleisten-Anleitung
We assume that the setup step has already been done. Then you should follow the sidebar customization guide carefully. Let's assume the following simple sidebar was created: And MediaWiki:Sidebar-commonpages contains, while MediaWiki:Sidebar-faq contains.
 * sidebar-commonpages
 * FAQ|sidebar-faq

Then all we need to do is to go to MediaWiki:Sidebar-messages (or whatever was defined in the previous step) and write there: sidebar-commonpages sidebar-faq That is, the names of the system messages, without the "MediaWiki:" namespace prefix, separated by whitespace.

Then go to Special:Translate/wiki-sidebar (or whatever was defined in the previous step; see Special:Translate for the list of defined groups). Now it is possible to translate the messages into other languages. Since all the messages are in the MediaWiki namespace, only a wiki administrator can edit the list of messages and actually translate them.

Übersetzte Hauptseiten-Anleitung
Another use case is a page with lots of markup or templates. The advantage of this method is that the language automatically appears in the user's interface language. The drawback is that to change the language in which the page is displayed, the interface language must be changed.

The implementation is the same as in the previous tutorial:


 * 1) Setup a new message group.
 * 2) Take a wiki page.
 * 3) Replace each translatable part with  and move the content to MediaWiki:Mainpage-messagename.
 * 4) Go to MediaWiki:Mainpage-messages (or what was defined in the setup) and add the message names there separated by whitespace.
 * 5) You are done. Go to Special:Translate to translate the main page.

Here is an example. Let's say Main Page contains:  is a community for chefs and bakers that love chocolate. We currently have full of chocolate. Dann ändere es in: 

Create MediaWiki:Mainpage-slogan with the content: is a community for chefs and bakers that love chocolate. Create MediaWiki:Mainpage-pagecount with the content: We currently have pages full of chocolate. Create MediaWiki:Mainpage-messages with the content: mainpage-slogan mainpage-pagecount And you are done! You can add and remove new messages any time you want.

Sprachen-Wähler
Not only the user can't choose what localised version of the page to read unless changing their preferences, but anonymous users can't set their user interface language and always use the wiki's default language. A page translated with this system will be in the default content language, if you don't provide anonymous users a way to select their language.

Luckily, there is a solution. With the extension it is possible to guess the user's preferred language and also to let the user manually select another language and store the choice in a cookie, with no need of tricks such as the   parameter, which is suitable mostly only for debugging.