Help:Translating: Difference between revisions

Help page
No edit summary
No edit summary
Line 1: Line 1:
The Resonite wiki uses the [https://www.mediawiki.org/wiki/Extension:Translate Translate MediaWiki extension], for enabling translations and for content to be surfaced in different languages.
<languages />
<translate>The Resonite wiki uses the [https://www.mediawiki.org/wiki/Extension:Translate Translate MediaWiki extension], for enabling translations and for content to be surfaced in different languages.</translate>


The extension has [https://www.mediawiki.org/wiki/Help:Extension:Translate extensive documentation] and [https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example video tutorials available].
<translate>The extension has [https://www.mediawiki.org/wiki/Help:Extension:Translate extensive documentation] and [https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example video tutorials available].</translate>


For brevity, we'll also present some information here.
<translate>For brevity, we'll also present some information here.</translate>


== Preparing a page for translation ==
<translate>== Preparing a page for translation ==</translate>
This information is based on [https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example mediawiki's tutorial].
<translate>This information is based on [https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example mediawiki's tutorial].</translate>
 
# Ensure the page is at a reasonable level of stability
#* Pages that are under construction or change frequently should not be included until they are ready.
# Add <nowiki><languages /></nowiki> to the top of the page in the ''source editing'' view.
# Surround translatable elements in <nowiki><translate></translate></nowiki> tags.
#* See further guidance on this below
# Mark this page for translation
#* This currently can only be done by administrators while we setup things.


# <translate>Ensure the page is at a reasonable level of stability</translate>
#* <translate>Pages that are under construction or change frequently should not be included until they are ready.</translate>
# <translate>Add <nowiki><languages /></nowiki> to the top of the page in the ''source editing'' view.</translate>
# <translate>Surround translatable elements in <nowiki><translate></translate></nowiki> tags.</translate>
#* <translate>See further guidance on this below</translate>
# <translate>Mark this page for translation</translate>
#* <translate>This currently can only be done by administrators while we setup things.</translate>
<translate>
== Best practices for translate tags ==
== Best practices for translate tags ==
These are based on [https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_administration#Markup_examples Mediawiki's Examples].
These are based on [https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_administration#Markup_examples Mediawiki's Examples].
</translate>


* Do not wrap the whole page in <nowiki><translate></nowiki>
* <translate>Do not wrap the whole page in <nowiki><translate></nowiki></translate>
** This is a problem we had in he past which lead to confusion sometimes.
** <translate>This is a problem we had in he past which lead to confusion sometimes.</translate>
* Instead wrap select parts with the tags.
* <translate>Instead wrap select parts with the tags.</translate>
* A good example is actually the [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&action=edit source of previous linked mediawiki page].
* <translate>A good example is actually the [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&action=edit source of previous linked mediawiki page].</translate>
* Be careful around:
* <translate>Be careful around:</translate>
** Tables
** <translate>Tables</translate>
** Images
** <translate>Images</translate>
** Templates
** <translate>Templates</translate>
** Lists
** <translate>Lists</translate>
 
<translate>
=== Tables ===
=== Tables ===
'''Don't''':
'''Don't''':
Line 51: Line 53:
</nowiki>
</nowiki>
</pre>
</pre>
 
</translate>
* Wrapping a whole table in translate tags makes it hard to translate.
* <translate>Wrapping a whole table in translate tags makes it hard to translate.</translate>
 
<translate>
'''Do'''
'''Do'''
<pre>
<pre>
Line 69: Line 71:
|}
|}
</pre>
</pre>
</translate>
* <translate>Wrapping each individual item in translate tags makes it '''easier''' to translate.</translate>


* Wrapping each individual item in translate tags makes it '''easier''' to translate.
<translate>
 
== Images ==
== Images ==
Wrap only, the description/alt-text in <nowiki><translate></nowiki> e.g.
Wrap only, the description/alt-text in <nowiki><translate></nowiki> e.g.
</translate>


<pre>
<pre>
Line 79: Line 83:
[[File:MediaWiki database schema latest.svg|thumb|link=https://www.mediawiki.org/w/index.php?title=Manual:Database_layout/diagram&action=render|<translate>Database schema of MediaWiki core</translate>]]</nowiki></pre>
[[File:MediaWiki database schema latest.svg|thumb|link=https://www.mediawiki.org/w/index.php?title=Manual:Database_layout/diagram&action=render|<translate>Database schema of MediaWiki core</translate>]]</nowiki></pre>


<translate>
== Example Pages ==
== Example Pages ==
The following pages have examples of '''good'' uses of the <nowiki><translate></nowiki> tags:
The following pages have examples of '''good'' uses of the <nowiki><translate></nowiki> tags:
</translate>
* [[Resonite Team]]
* [[Resonite Team]]

Revision as of 07:23, 19 January 2024

The Resonite wiki uses the Translate MediaWiki extension, for enabling translations and for content to be surfaced in different languages.

The extension has extensive documentation and video tutorials available.

For brevity, we'll also present some information here.

Preparing a page for translation

This information is based on mediawiki's tutorial.

  1. Ensure the page is at a reasonable level of stability
    • Pages that are under construction or change frequently should not be included until they are ready.
  2. Add <languages /> to the top of the page in the source editing view.
  3. Surround translatable elements in <translate></translate> tags.
    • See further guidance on this below
  4. Mark this page for translation
    • This currently can only be done by administrators while we setup things.

Best practices for translate tags

These are based on Mediawiki's Examples.

  • Do not wrap the whole page in <translate>
    • This is a problem we had in he past which lead to confusion sometimes.
  • Instead wrap select parts with the tags.
  • A good example is actually the source of previous linked mediawiki page.
  • Be careful around:
    • Tables
    • Images
    • Templates
    • Lists

Tables

Don't:


<translate>

{| class="wikitable"
|+ Food complements
|-
|Orange
|Apple
|-
|Bread
|Pie
|-
|Butter
|Ice cream
|}

</translate>

  • Wrapping a whole table in translate tags makes it hard to translate.

Do

{| class="wikitable"
|+<translate nowrap>Food complements</translate>
|-
|<translate nowrap>Orange</translate>
|<translate nowrap>Apple</translate>
|-
|<translate nowrap>Bread</translate>
|<translate nowrap>Pie</translate>
|-
|<translate nowrap>Butter</translate>
|<translate nowrap>Ice cream</translate>
|}
  • Wrapping each individual item in translate tags makes it easier to translate.

Images

Wrap only, the description/alt-text in <translate> e.g.


[[File:MediaWiki database schema latest.svg|thumb|link=https://www.mediawiki.org/w/index.php?title=Manual:Database_layout/diagram&action=render|<translate>Database schema of MediaWiki core</translate>]]

Example Pages

The following pages have examples of 'good uses of the <translate> tags: