Multiple Languages within one MindTouch Site (Polyglot)

    Status

    This feature has been available since the Jay Cooke (8.05) release.

    Introduction

    Traditionally, multiple wiki instances are needed to support multiple languages.   This approach is problematic since wiki management needs to be handled separately for each language; users need to maintain an account and user page per language, the same services need to be registered for each instance, common templates cannot be leveraged, and there is no easy mechanism for performing cross-language searches.  With the upcoming changes described in this document, MindTouch Deki will provides seamless support for multiple languages within one wiki!

    Site Language

    Each site is associated with a default language: this is usually en-us, but can be overwritten in "Site Settings" by using the "Site site language" option:

    language-sitesettings.png

    This value is used to localize the user interface, if that language's resource file exists.

    Setting your wiki into multi-language mode

    A wiki may be converted to a "multi-language" mode by adding the config key languages with a comma-separated list of language codes (example: en,ko,zh-cn,it,ja,pt,ru,nl,pl,hu,ca,cs,fr,de,es,fi,zh-tw) through the "Configuration" screen in the control panel. When this occurs, 3 UI changes occur:

    • The "Page properties" dialog allows you to set a language to a page
    • "User preferences" allows each user to select their own language (from the languages config key list)
    • Dropdowns appear for Search and Tags to allow users to filter result sets

    Note:  Do not confuse the languages config key with the ui/language config key.  They are separate and different config keys.  The ui/language config key is the general  language to use for the site and changing the  key will not enable multi-language support.

    Order of Precedence

    When a page is loaded, Deki Wiki will first examine the language assigned to the page through "Page properties." If this value has not been set, Deki Wiki will examine the language set by the user in their "User Preferences." If this does not exist, Deki Wiki will use the general site language set by the administrator.

    Page Language

    Every page is now associated with a language (or language neutral), which can be set through a page properties user interface.  New pages automatically inherit language settings from their parent.  As a result, it is easy to setup the following sort of hierarchy under the home page, where all pages created under Main_Page are automatically English, under Portada are Spanish, and under メインページ are Japanese:

    Heirarchy.png

       

    The page language determines the language of the user interface; changing the page language will cause the language of all the menus and buttons shown on that page to change.  Thus, once a users navigate within a language sub-tree, it appears as if the wiki is decidicated to the selected language.

    Localized Templates

    In order to promote a common set of templates across multiple languages, Deki Wiki now supports localized templates.  To insert localized text, use the lang attribute; lang="<language>" includes the content only if the page using the template has the specified language, whereas lang="*" includes the content if no other language match is found.  For example, to create a template of a red box warning that something is obsolete:

    <span style="border: 1px solid #FF9999; background-color: #FFDBDB;  font-size: 9px; vertical-align: text-top;">

    <div lang="*">Obsolete</div>
    <div lang="es">Obsoleto</div>
    <div lang="ja">廃止</div>

    </span>

    Output when included on an English page:  Obsolete.PNG

    Output when included on a Spanish page:  Obsolete (Spanish).PNG

    Output when included on a Japanese page:  Obsolete (Japanese).PNG

    Cross-Language Search

    Deki Wiki provides several mechanisms to help users locate content in other languages:

    Related Pages

    Often, the same page appears in multiple languages.  The following Deki Wiki extension makes it possible to associate these pages:

     {{wiki.languages({ '<language1>': '<path1>', '<language2': '<path2>', ... })}}
    


    For example, adding the DekiScript below to an English page on XML associates it with the corresponding Spanish and Japanese XML pages:

        

    {{ wiki.languages( { 'es': 'Portada/XML', 'ja': 'メインページ/XML' } ) }}

     Output(as seen on the bottom of the page:

    languages.png

    The location of the "In other languages" can vary depending on the skin implementation

    Tags

    By default, when the user clicks to view a page tag, only pages with the same language are displayed.  However, the Special:Tags page will also expose an option to view pages with the same tag across all languages (or a particular language).

    Search

    By default, search will only include results from the currently active language.  However, like the Special:Tags page, Special:Searchwill also expose an option to search for pages across all languages (or a particular language).

       

       

    Tag page

    Files 7

    FileVersionSizeModified 
    Viewing 6 of 6 comments: view all
    One thing that always annoyed me about wikipedia is that different languages have different content for the same topic.

    There is no mechanism to enforce translations to maintain 1:1 relationships. Using the "Page Language" method Deki Wiki will end up with the same problem.

    What would be really great is storing all translations in the same topic text, with client-side tools assisting translators:
    * Per-paragraph translations
    * Warning symbols for translated content that wasn't updated after a change was made to another language
    * Assume embedded content is language-neutral but allow per-language overriding (for example graphics which contain text)

    With this in place, translations would have a better chance of being in sync and partial translations would be possible. For example a user could select a "give me spanish except when the english version is more recent" setup and they would see pages with certain paragraphs in English.
    Posted 04:25, 23 Apr 2008
    Wmertens has a very good point.

    I hope that the site I'm creating will be in atleast ten different languages. And while I hope the data will stay 1:1 if you guys made it easier for translators and people fluent or good in several languages that would be such a plus.

    As it's hard to say in which language the best information on a topic might be written in first, and then translated from. It's not an easy problem but wow imagine the possibilities.
    Posted 07:23, 12 May 2008
    you say to use a: comma-separated list of language codes - where can we find them?
    this is a link to ISO language codes - the question is, are these ok for Mindtouch use adn are all of them supported?: http://www.itnews.org.uk/w_qrefs/w_international/p_langcodes.cfm edited 07:54, 21 Nov 2008
    Posted 07:47, 21 Nov 2008
    "you say to use a: comma-separated list of language codes - where can we find them?"
    I can't find them too.Please help me. edited 19:17, 6 Jan 2009
    Posted 19:16, 6 Jan 2009
    The language codes can be found on this page: http://wiki.developer.mindtouch.com/MindTouch_Deki/Languages
    Posted 21:26, 6 Jan 2009
    I followed the article and i insert a dekiscript with the code:



    Code:
    {{wiki.languages({ 'en': '/teste_en' })}} and i get this error:

    "}" expected: /content/body/pre, line 1, column 2

    Can you help me?
    Posted 04:19, 19 Jan 2012
    Viewing 6 of 6 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by