ویکی چندزبانه بنیاد مستندات

    From The Document Foundation Wiki
    This page is a translated version of the page TDF Wiki/Multilingual and the translation is 36% complete.
    Outdated translations are marked like this.

    این صفحه به محتوای «ویکی چندزبانه» که روی ویکی بنیاد مستندات ارائه می‌شود می‌پردازد.

    Warning.svg

    توضیح مهم
    از روش ترجمه OrigLang برای صفحات تازه ساخته شده استفاده نکنید. ما در حال گذار به افزونه ترجمه مدیاویکی هستیم.

    پس‌زمینه

    این صفحه حاوی نکات مهمی برای ویراستاران ویکی است. لطفاً قبل از افزودن محتوای ترجمه شده یا محلی به ویکی این صفحه را بخوانید.

    مطالب با تمرکز محلی

    این صفحات، فقط به زبان محلی نوشته می‌شوند و ترجمه نخواهند شد. آن‌ها زیرصفحه صفحه‌ای هستند که با کد زبان با حروف بزرگ نامگذاری شده است.

    مثال:

    
     https://wiki.documentfoundation.org/DE/Team
     https://wiki.documentfoundation.org/DE/Veranstaltungen
     ...
     https://wiki.documentfoundation.org/FR/Documentation/Publications
     
    

    مطالب با تمرکز جهانی

    این صفحات به انگلیسی تنظیم شده و به زبان‌های مختلف ترجمه می‌شوند. صفحات ترجمه شده، زیرمجموعه‌هایی هستند که با کد زبانشان نام‌گذاری شده‌اند. فرایند ترجمه با استفاده از افزونه ترجمه مدیاویکی مدیریت می‌شود.

    برای قابل ترجمه کردن یک صفحه این مراحل را دنبال کنید:

    1. محتوایی که باید ترجمه شود را در بلوک‌های <translate></translate> قرار دهید
    2. از الگوی {{#translation:}} برای افزودن پسوند زبان به عناصری مانند منوها، دسته‌ها یا حتی پیوندها به صفحات محلی استفاده کنید
    3. بلوک فهرست گزینشی زبان <languages/> را اضافه کنید
    1. پس از ذخیره کردن صفحه، روی پیوند بالای صفحه کلیک کنید که می‌گوید این صفحه را برای ترجمه مشخص کنید
    2. بررسی کنید که همه چیز درست باشد و روی دکمه‌ای در پایین صفحه کلید کنید که می‌گوید این نسخه را برای ترجمه مشخص کنید

    پس از علامت‌گذاری صفحه برای ترجمه، ضمیمه ترجمه به طور خودکار نشانگرهایی را به شکل <!--T:1--> برای نشان دادن رشته‌های قابل ترجمه اضافه می‌کند. برای این‌که یک قطعه از متن به طور خودکار به صورت یک رشته جدا شود، باید با خطوط خالی محاصره شود. برای الزام جداسازی رشته‌ها، می‌توانید قطعه‌های <translate></translate> بیشتری اضافه کنید. به ویژه به فهرست‌های گلوله‌دار یا شماره‌دار توجه کنید.

    وقتی محتوا را در صفحه منبع اضافه یا آن را تغییر می دهید، این متن در بالای صفحه ظاهر می شود: این صفحه از زمان آخرین علامت‌گذاری برای ترجمه تغییراتی دارد. روی پیوند «علامت گذاری شده برای ترجمه» کلیک کنید تا سامانه ترجمه به دنبال همان روال علامت‌گذاری اولیه برای ترجمه، به‌هنگام شود.

    Tips

    در شرایط مطلوب، مترجمان باید حداقل مقدار نشانه‌گذاری ویکی را ببینند. داشتن علامت‌گذاری برای یک جدول یا یک الگوی در رشته قابل ترجمه برای مترجم ناامیدکننده و گیج‌کننده است. سعی کنید چنین علامت‌گذاری را در خارج از بلوک های <translate></translate> بگذارید.

    عنوان صفحه به‌طور پیش‌فرض قابل ترجمه است، اما هنگام علامت‌گذاری صفحه‌ای برای ترجمه، می‌توانید این را با کادر انتخاب «اجازه ترجمه عنوان صفحه» کنترل کنید. عنوان صفحه اولین رشته قابل ترجمه در فهرست رشته‌ها است. در سامانه ترجمه و رابط، رشته نامی مانند "Translations:Faq/General/127/Page display title/ru" دارد در حالی که نام رشته‌های دیگر دارای شناسه‌های عددی مانند "4" در "Translations:Faq/General/127/4/ru" است.

    گاهی اوقات نیاز به دادن عنوان نمایشی متفاوت با نام موجود در مسیر صفحه وجود دارد. توجه داشته باشید که این کار توصیه نمی‌شود و باید از آن اجتناب کنید. در این موارد، از الگوی تغییر نام مانند این استفاده کنید: {{Rename|نام جدید من}}. این الگو مطمئن می شود که هیچ خطایی در صفحات ترجمه شده در مورد عنوان وجود ندارد.

    You can do a partial update of a translation while still leaving the status as outdated by clicking the downward-pointing triangle next to the translation unit name and selecting Show in wiki editor. You will be taken to a separate editing page where you can make your changes and save them while leaving the !!FUZZY!! special word at the start of the text intact.

    گاهی اوقات لازم است بدون نشانگرهای <!--T:1--> به منبع ویکی انگلیسی دسترسی پیدا کنید. این کار را می توان با افزودن /en در انتهای مسیر صفحه و سپس ویرایش منبع انجام داد. این به شما امکان می‌دهد ساختار صفحه را در یک صفحه جدید (مانند یادداشت‌های انتشار) کپی کنید.

    When working on a page with many translation blocks, it sometimes happens that you make a mistake with opening or closing translate tags. In a situation like this, the page preview will show all the translate markup alongside the content. Clicking Save changes has a suprisingly useful effect, however: instead of saving, it will display a reduced view of the source text, helping you to find your error.

    If you have blocks that only contain a single number, you can use the magic word {{formatnum:1234}} instead of a translate block. The number will automatically be formatted to non-Western styles, when needed. It is best to use the NOSEP parameter for whole numbers to prevent showing thousand separators as they can confuse readers. For decimal numbers it is best not to use NOSEP, because it would skip the localisation of the decimal separator.

    Below is an example of a page prepared for translation. Notice the separation of the bulleted list and contents in a table.

     {{TopMenu}}
     {{Menu}}
     {{Menu.Documentation}}
     <languages/>
    
     <translate>
     == Hello World ==
    
     * We must take the world as we find it
     * When we are gone, let the world be flooded
     * The world is as fools wish it to be
     * It's a small world!
     </translate>
     <translate>
     * Crows are black the world over
     * He slipped once and all the world knew about it
     * The world is like a market, the one does business and the other does none
     * Huge though the world is, I always miss when I hit at it
     </translate>
    
    
     {| class="wikitable"
     |-
     | <translate>Cell content</translate>
     |-
     | {{sometemplate|<translate>Text content for a template</translate>}}
     |-
     | <bdi>{{formatnum:-1.10714871779409}}</bdi>
     |-
     | {{formatnum:110714871779409|NOSEP}}
     |}
    
     [[Special:MyLanguage/Development/Create_a_Hello_World_LibreOffice_extension|<translate>Tutorial on creating a Hello World extension</translate>]]
    
     [[Category:Documentation]]
     
    

    As table content can be annoying to prepare for translation, a helper script has been created. Use it by copying a wiki article into a local text file and giving the file name as an argument for the script. The file contents will be rewritten in place. The formatnum magic word will be applied for integer, floating point and complex numbers, if they are the only content in a table cell. The script depends on wikitextparser, regex and wcwidth packages. Click Expand to see the script.

    
    #!/usr/bin/env python3
    #
    # uses the library https://github.com/5j9/wikitextparser
    import sys
    import wikitextparser as wtp
    
    def is_float_or_complex(value):
        try:
            float(value)
            return True
        except:
            return False
        try:
            complex(value)
            return True
        except:
            return False
    
    def wrap_translate(string):
        if string.endswith(('}}', '</translate>')) or (len(string) < 2 and not string.isnumeric()):
            return string
        elif string.isnumeric() or is_float_or_complex(string):
            if string.isnumeric():
                format_end = '|NOSEP}}'
            else:
                format_end = '}}'
            # Add bdi element so minuses will stay in place with RTL languages
            if string[0] == '-':
                return ' <bdi>{{formatnum:' + string + format_end + '</bdi> '
            else:
                return ' {{formatnum:' + string + format_end + ' '
        else:
            return ' <translate>' + string + '</translate> '
    
    with open(sys.argv[1]) as f:
        doc = f.read()
    
    p = wtp.parse(doc)
    tables = p.get_tables()
    
    for t in tables:
        if t.caption:
            caption = t.caption.strip()
            if len(caption) > 0:
                t.caption = wrap_translate(caption)
        for row in t.cells():
            for cell in row:
                c = cell.value.strip()
                if len(c) > 0:
                    cell.value = wrap_translate(c)
    
    with open(sys.argv[1], 'w') as f:
        f.write(p.string)
    
    

    انتقال محتوای ترجمه شدهٔ قدیمی به سامانه کنونی

    In the past, TDF wiki employed a translation process that used templates called OrigLang and Lang. The templates displayed a menu that linked the source page with the translated ones. You can find all the translated content that use the Lang template in this list: Special:WhatLinksHere/Template:Lang. Likewise, you can list the pages with OrigLang template.

    Translate extension has a migration tool, which helps in moving already translated content to the new system. If the source and translation blocks match exactly, the migration will be very easy. Otherwise you have to cut and paste strings between the input boxes.

    The migration goes as follows:

    1. After marking a page for translation, wait for some minutes, so the server will have processed the page
    2. Navigate to Special:PageMigration
    3. In the input box, input the language path of the page you want to migrate, like: Mypath/Mypage/de for some imaginary German translation
    4. Click the Import button
    1. Clean up the contents in the input boxes containing the old translations (for example, remove any useless menu templates)
    2. In the column with the translations, you can't leave empty or extra input boxes at the end, so delete them by clicking the trashcan icon next to them
    3. After you cleaned up and put everything in order, click the Save button

    Remember that you can always view the old version of a translated page using its View history link and clicking on an old revision.

    If you want to view the source of an old revision, copy its link from the history and visit the link after adding this to the end:

    &action=edit

    Sometimes it does not make sense to use the migration tool. Leaving wiki markup outside the translate elements often confuses the tool. In these cases, the suggestions presented by the translation memory can be more useful.

    Messages in the Sidebar

    To translate the messages ”Get Involved” and ”Support LibreOffice!”, you need to send the translations to one of the wiki administrators. The others are system messages which are translated in upstream MediaWiki.

    The translation of the additional Sidebar elements has been set up using the steps in the Translate extension help page for unstructured element translation. The administrators just need to visit Special:Translate/wiki-sidebar in order to translate the messages.

    The ”Main Page” and ”Get Involved” links use the Special:MyLanguage prefix, which makes them direct to a translated page, if it is available.