Difference between revisions of "WikiTranslation"

From Synfig Studio :: Documentation
Jump to: navigation, search
(Wiki translation scheme proposal)
 
(OUTDATED INSTRUCTIONS MESSAGE)
 
(18 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Concept ==
+
THE FOLLOWING ISNTRUCTIONS ARE OUTDATED. WIKI TRANSLATION USES DLP MACROS NOW. PLEASE DO NOT USE THIS INSTRUCTIONS
  
One of possible solutions is to use the extension ParserFunctions to create a customizable template based on the existence or not of some pages.
+
{{TranslationBar|CONTENT={{Tr/en}} · {{Tr/de}} · {{Tr/es}} · {{Tr/fr}}}}
  
The page will be created in the main language of the wiki (English), translated pages bear the name of the main page by adding the language code preceded by a /, e.g. for About, page in Russian will be About/ru.
+
== For Translators ==
  
:: Maybe better use '.' sign instead of '/'? Not sure...
+
Page with a translation must bear the name of original English page, plus languages abbreviation (two-letter language code) preceded by a '.', e.g. for About, page in Russian will be About.ru.
  
I see a lot of advantages in such approach, such as:
+
Advantages:
 
* Titles are in one language, which is good for referencing and keeping wiki documentation in order.
 
* Titles are in one language, which is good for referencing and keeping wiki documentation in order.
 
* It also provides a clear mapping between original and translated pages.
 
* It also provides a clear mapping between original and translated pages.
 
* It is easy to implement.
 
* It is easy to implement.
  
== Configuration ==
+
When translating pages do '''''NOT''''' move them. Simply copy the content and add it to a new page.
  
You need two files from [[http://www.mediawiki.org/wiki/Extension:ParserFunctions_%28extended%29 here]]:
+
=== The Translation Bar ===
* Expr.php
+
* ParserFunctions.php
+
  
Download them, create directory 'ParserFunctions' in your 'extensions' directory and place there downloaded files.
+
The bar containing all available languages that is shown on top of the page is a {{l|Template:TranslationBar|template}} that you should use on all of your translated pages. The translation bar template is language-dependant so if there is no translation bar template for your language you should translate the template first. :)
  
:: I not sure if those files compatible with this version of MediaWiki?
+
Please sort the languages in the translation bar by the 2-character language code (but always list English first!), and don’t forget to update all other translations of the page you’re currently working on!
  
Then add in LocalSettings.php:
+
==== Language Templates ====
  
<pre>
+
To ease the input of languages that your keyboard is unable to reproduce, a couple of templates have been created. The name of those templates is constructed by appending the language code (e.g., “en” or “zh”) to the string “Tr/”. The template for the French language is “<tt>Tr/fr</tt>” and will output “<tt><nowiki>{{l|</nowiki>''current page name''.fr|Français}}</tt>” to create a link to the French version of this page.
require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
+
</pre>
+
  
All we have to do once the extension added to create the template Languages, for example:
+
As templates can be nested this makes creating a large translation bar pretty simple:
  
<pre>
+
<tt><nowiki>{{</nowiki>TranslationBar|CONTENT=<nowiki>{{</nowiki>Tr/en}} · <nowiki>{{</nowiki>Tr/de}} · <nowiki>{{</nowiki>Tr/fr}} · <nowiki>{{</nowiki>Tr/pl}} · <nowiki>{{</nowiki>Tr/pt}} · <nowiki>{{</nowiki>Tr/ru}} · <nowiki>{{</nowiki>Tr/tr}} · <nowiki>{{</nowiki>Tr/zh}}}}</tt>
<div style="vertical-align: middle;">
+
----
+
<span style="font-size:smaller">
+
Reference:
+
'''[[{{{1}}}|English]]''' –
+
Translations: 
+
{{
+
#ifexist: {{{1}}}/de | <span lang="de">[[{{{1}}}/de|Deutsch]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/es | <span lang="es">[[{{{1}}}/es|Español]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/fi | <span lang="fi">[[{{{1}}}/fi|Suomi]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/en | <span lang="en">[[{{{1}}}/fr|Français]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/it | <span lang="it">[[{{{1}}}/it|Italiano]]</span>  • 
+
}}{{
+
#ifexist: {{{1}}}/he | <span lang="he">[[{{{1}}}/he|עברית]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/ja | <span lang="ja">[[{{{1}}}/ja|日本語]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/ko | <span lang="ko">[[{{{1}}}/ko|한국어]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/no | <span lang="no">[[{{{1}}}/no|Norsk nynorsk]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/pl | <span lang="pl">[[{{{1}}}/pl|Polski]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/pt | <span lang="pt">[[{{{1}}}/pt|Português]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/ru | <span lang="ru">[[{{{1}}}/ru|Русский]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/sq | <span lang="sq">[[{{{1}}}/sq|Shqip]]</span> • 
+
}}{{
+
#ifexist: {{{1}}}/zh | <span lang="zh">[[{{{1}}}/zh|中文]]</span>  • 
+
}}</span>
+
----
+
</div>
+
</pre>
+
  
== Use ==
+
Unfortunately this does currently not work with templates for other languages than English.
For each page, you can add managing multi-language using the tag:
+
  
<pre>
+
=== To translate the text in images ===
{{Languages|About}}
+
</pre>
+
  
Where 'About' is the name of the page.
+
In {{l|Releases/Artwork}}this page you will find all the artwork (including editables files) of all the artwork me make for every new release of the project.
  
Then you can create the page translated into naming them appropriately depending on the language chosen
+
{{l|Styleguidelines|Here}} you can read our graphic style guidelines, where you will find help on how to create and edit the images of this site.
  
<pre>
+
== What functionality I expect from Multilanguage Extension ==
About/ru
+
* All pages named as described above.
</pre>
+
* There must be a list of available translations for current page on top of each page. Let's call it "Page languages list". (Extension detects if page with each language code exists).
 +
* There is a field in the {{l|Special:Preferences|user preferences}}, called "Language" (Already exists in MediaWiki)
 +
* Navigation improvements:
 +
** Let's say user have Language field in preferences set to 'tr'. Then:
 +
*** if user requests page {{l|Main Page}}, and page {{l|Main Page.tr}} exists, he automatically redirected to {{l|Main Page.tr}}.
 +
*** if user clicks some other language in "Page languages list", then his "Language" field in preferences sets to that language, and he continues browsing, according to previous rules.
 +
* It would be nice to have Language field set up according the browser settings automatically for new users and guests.
  
== Alternatives ==
+
== Useful Links ==
 +
* http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
 +
 
 +
== Possible Solutions ==
  
 
* http://www.mediawiki.org/wiki/Extension:MultiLanguageManager
 
* http://www.mediawiki.org/wiki/Extension:MultiLanguageManager
 
== Sources ==
 
 
 
* http://www.art122-5.net/index.php/MediaWiki_Multi-language
 
* http://www.art122-5.net/index.php/MediaWiki_Multi-language
 +
* http://www.mediawiki.org/wiki/Category:Internationalization_extensions

Latest revision as of 13:28, 5 March 2010

Languages Language: 

English • Deutsch • español • français • português


THE FOLLOWING ISNTRUCTIONS ARE OUTDATED. WIKI TRANSLATION USES DLP MACROS NOW. PLEASE DO NOT USE THIS INSTRUCTIONS

Template:TranslationBar

For Translators

Page with a translation must bear the name of original English page, plus languages abbreviation (two-letter language code) preceded by a '.', e.g. for About, page in Russian will be About.ru.

Advantages:

  • Titles are in one language, which is good for referencing and keeping wiki documentation in order.
  • It also provides a clear mapping between original and translated pages.
  • It is easy to implement.

When translating pages do NOT move them. Simply copy the content and add it to a new page.

The Translation Bar

The bar containing all available languages that is shown on top of the page is a template that you should use on all of your translated pages. The translation bar template is language-dependant so if there is no translation bar template for your language you should translate the template first. :)

Please sort the languages in the translation bar by the 2-character language code (but always list English first!), and don’t forget to update all other translations of the page you’re currently working on!

Language Templates

To ease the input of languages that your keyboard is unable to reproduce, a couple of templates have been created. The name of those templates is constructed by appending the language code (e.g., “en” or “zh”) to the string “Tr/”. The template for the French language is “Tr/fr” and will output “{{l|current page name.fr|Français}}” to create a link to the French version of this page.

As templates can be nested this makes creating a large translation bar pretty simple:

{{TranslationBar|CONTENT={{Tr/en}} · {{Tr/de}} · {{Tr/fr}} · {{Tr/pl}} · {{Tr/pt}} · {{Tr/ru}} · {{Tr/tr}} · {{Tr/zh}}}}

Unfortunately this does currently not work with templates for other languages than English.

To translate the text in images

In Releases/Artworkthis page you will find all the artwork (including editables files) of all the artwork me make for every new release of the project.

Here you can read our graphic style guidelines, where you will find help on how to create and edit the images of this site.

What functionality I expect from Multilanguage Extension

  • All pages named as described above.
  • There must be a list of available translations for current page on top of each page. Let's call it "Page languages list". (Extension detects if page with each language code exists).
  • There is a field in the user preferences, called "Language" (Already exists in MediaWiki)
  • Navigation improvements:
    • Let's say user have Language field in preferences set to 'tr'. Then:
      • if user requests page Synfig Wiki, and page Main Page.tr exists, he automatically redirected to Main Page.tr.
      • if user clicks some other language in "Page languages list", then his "Language" field in preferences sets to that language, and he continues browsing, according to previous rules.
  • It would be nice to have Language field set up according the browser settings automatically for new users and guests.

Useful Links

Possible Solutions


Languages Language: 

English • Deutsch • español • français • português