Localisation/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "== Перевод wiki ==")
(Updating to match new version of source page)
(48 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
{{docnav|Branding|Extra python modules}}

<div class="mw-translate-fuzzy">
'''Локализация''' это в общем процесс предоставления програмного обеспечения c пользовательским интерфейсом поддерживающем несколько языков . В FreeCAD вы можете установить язык пользовательского интерфейса в ''Edit→Preferences→Application''. FreeCAD использует [[wikipedia:Qt (toolkit)|Qt]] чтобы поддерживать несколько языков. В Unix/Linux системах, FreeCAD использует текущие настройки локали(языковые настройки) вашей системы, по умолчаннию.
'''Локализация''' это в общем процесс предоставления програмного обеспечения c пользовательским интерфейсом поддерживающем несколько языков . В FreeCAD вы можете установить язык пользовательского интерфейса в ''Edit→Preferences→Application''. FreeCAD использует [[wikipedia:Qt (toolkit)|Qt]] чтобы поддерживать несколько языков. В Unix/Linux системах, FreeCAD использует текущие настройки локали(языковые настройки) вашей системы, по умолчаннию.
</div>


== Помощь с переводом FreeCAD ==
== Помощь с переводом FreeCAD ==


Одно очень важных дел которые вы можете сделать для FreeCAD, если вы не программист, это помочь с переводом программы на ваш язык. Сейчас это легче чем когда-либо, с использованием [http://crowdin.net Crowdin] системы совместного on-line перевода.
Одно из очень важных дел которое пользователи могут сделать для FreeCAD (если например они не имеют навыков программирования ), это помочь с переводом различных частей проекта (программа, сайт, вики, документация и т. д.) на другой язык. Вот как это можно сделать


=== Перевести программное обеспечение FreeCAD ===
=== Как Переводить ===
FreeCAD использует стороннюю коллективную систему онлайн переводов, называемую [https://crowdin.net Crowdin]. Она проприетарная, но бесплатна для проектов с открытым исходным кодом. Ниже представлены инструкции по использованию этой системы.


* Отправляйтесь на [http://crowdin.net/project/freecad страницу проекта перевода FreeCAD на Crowdin];
* Отправляйтесь на [http://crowdin.net/project/freecad страницу проекта перевода FreeCAD на Crowdin];
* Войдите, создав новый профиль, или воспользовавшись сторонними аккаунтами, такими как ваш GMail адрес;
* Войдите, создав новый профиль, или воспользовавшись сторонними аккаунтами (GitHub, GitLab, GMail итд...);
* Щелкните на языке с которым вы хотите работать;
* Щелкните иконку языка на котоый хотите перевести;
* Начните переводить , щелкнув на кнопке Translate рядом с одним из файлов. Например, ''FreeCAD.ts'' cсодержит текстовые строки для главного окна FreeCAD.
* Начните переводить , щелкнув на {{Кнопке|Translate}} рядом с одним из файлов. Например, ''FreeCAD.ts'' содержит текстовые строки для главного окна FreeCAD.
* Вы можете голосовать за существующие переводы, или вы можете создавать свой собственный.
* Вы можете голосовать за существующие переводы, или вы можете создавать свой собственный.


<div class="mw-translate-fuzzy">
'''Примечание''': Если вы активно принимаете участие в переводе FreeCAD и хотите быть в курсе когда будет готов к запуску следующий релиз, так чтобы было время рассмотреть ваш перевод, пожалуйста подпишитесь на этот опрос: http://www.freecadweb.org/tracker/view.php?id=137
'''Примечание''': Если вы активно принимаете участие в переводе FreeCAD и хотите быть в курсе когда будет готов к запуску следующий релиз, так чтобы было время рассмотреть ваш перевод, пожалуйста подпишитесь на этот опрос: http://www.freecadweb.org/tracker/view.php?id=137
</div>


<div class="mw-translate-fuzzy">
== Перевод wiki ==
</div>


<div class="mw-translate-fuzzy">
=== Перевод с помощью Qt-Linguist (старый способ) ===
В этой вики содержится много контента, большинство из которого собрано в руководства. Вы можете просмотреть документацию, начиная со [[Main Page/ru| стартовой страницы]] или можно взглянуть на [[Online Help Toc/ru| руководство пользователя]]
</div>


<div class="mw-translate-fuzzy">
Следующая информация не нужно больше использовать и скорее всего она устарела. В настоящее время она хранится здесь, так что программисты могут ознакомится с тем, как это работает.
Примечание: чтобы иметь возможность перевести вики, вы должны сначала, конечно [[FAQ#How_can_I_get_edit_permission_on_the_wiki.3F|получить разрешение на редактирование вики]].
</div>


<div class="mw-translate-fuzzy">
* Откройте все языковые катологи указанные ниже
Необходимо иметь базовые знания о стиле форматирования вики, а также обладать общими основными принципами вики FreeCAD, потому что при переводе вы будете иметь дело с некоторыми специальными тегами. Вы можете найти эту информацию на странице [[WikiPages]]
* Убедитесь что .ts файла с вашим языковым кодом не существует ("fr" для французкого, "de" для немецкого, и.т.д...)
</div>
* Если он существует, вы можете скачать этот файл, если вы желаете изменить/просмотреть/лучше перевести (щелкните на файле, для скачивания)
* Если его не существует, скачайте .ts файл без языкового кода (или любой другой доступный.ts файл, он тоже будет работать)
* Переименуйте файл добавив ваш языковой код
* Откройте его в программе Qt-Linguist
* Начните перевод (Qt Linguist очень прост в использовании)
* Как только все будет готово, сохраните ваш файл
* [http://www.freecadweb.org/tracker/main_page.php отправте файлы нам] так чтобы мы могли их включить в исходный код freecad, чтобы они принесли пользу и другим пользователям.


<div class="mw-translate-fuzzy">
==== Доступные файлы переводов ====
===Плагин для перевода===
</div>


<div class="mw-translate-fuzzy">
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Gui/Language/ FreeCAD main GUI]
После того, как вики была убрана с SourceForge, [[User:Yorik|Yorik]] установил [http://www.mediawiki.org/wiki/Help:Extension:Translate плагин для перевода] который позволяет облегчить переводы между страницами. Например, теперь может быть переведён заголовок страницы. Другие преимущества плагина для перевода в том, что он отслеживает переводы, уведомляет, если исходная страница была обновлена, и поддерживает синхронизацию переводов с оригинальной страницей на английском языке.
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Complete/Gui/Resources/translations/ Complete Workbench]
</div>
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Drawing/Gui/Resources/translations/ Drawing Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Draft/Languages/ Draft Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/ReverseEngineering/Gui/Resources/translations/ Reverse Engineering Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Fem/Gui/Resources/translations/ FEM Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Robot/Gui/Resources/translations/ Robot Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Image/Gui/Resources/translations/ Image Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Sketcher/Gui/Resources/translations/ Sketcher Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Mesh/Gui/Resources/translations/ Mesh Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Test/Gui/Resources/translations/ Test Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Points/Gui/Resources/translations/ Points Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Raytracing/Gui/Resources/translations/ Raytracing Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Part/Gui/Resources/translations/ Part Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/PartDesign/Gui/Resources/translations/ PartDesign Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Assembly/Gui/Resources/translations/ Assembly Workbench]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/MeshPart/Gui/Resources/translations/ MeshPart Workbench]


<div class="mw-translate-fuzzy">
== Подготовка собственных модулей/приложений для перевода ==
Инструмент описан в [http://www.mediawiki.org/wiki/Help:Extension:Translate Extension:Translate] и является частью [http://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle Language Extension Bundle].
</div>


<div class="mw-translate-fuzzy">
=== Требования ===
Чтобы быстро начать работу по подготовке страницы для перевода и активации плагина, пожалуйста, прочитайте [http://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example/ru страницу с примером перевода].
</div>


<div class="mw-translate-fuzzy">
Для локализации вашего модуля приложения вам понадобятся помошники которые поставляются с ''Qt''. Вы можете скачать их с [http://www.trolltech.com/products/qt/downloads Trolltech-Website], а также они содержаться в [[Third Party Libraries|LibPack]]:
Чтобы увидеть пример того, как работает инструмент перевода, один раз плагин перевод активируется на странице, вы можете посетить [[Main Page/ru| Стартовую страницу]]. Вы увидите новую языковую строку меню внизу. Она была сгенерирована автоматически. Нажмите, например, на немецкую ссылку, это преместит Вас на [[Main Page/de| стартовую страницу на немецком языке]]. Прямо под названием, вы можете прочитать "Эта страница представляет собой 'переведенную версию' страницы Стартовая страница и перевод завершен на хх%." (Хх - это текущий фактический процент перевода). Нажмите на ссылку "translated version", чтобы начать перевод, либо обновить или исправить существующий перевод.
;qmake: Создает файлы проекта
</div>
;lupdate: Извлекает или обновляет оригинальные тексты в вашем проекте , сканируя исходный код
;Qt-Linguist: ''Qt-Linguist'' очень прост в использовании и поможет вам переводить отличными функциями , вроде сборника общих предложений.


<div class="mw-translate-fuzzy">
=== Настройка Проекта ===
Вы обнаружите, что не можете больше напрямую редактировать страницу, как только страница была отмечена, как перевод. Вы должны использовать утилиту (плагин) для перевода.
</div>


<div class="mw-translate-fuzzy">
Для начала локализации перейдите в GUI-часть вашего модуля и в командной строке введите:
При добавлении нового контента, вначале должна быть создана страница на английском языке, а затем она переводится на другой язык. Если кто-то хочет изменить / добавить контент на странице, он первым делом должен сделать английскую версию.
<pre>
</div>
qmake -project
</pre>
Это просканирует каталог вашего проекта на наличие файлов содержащих текстовые строки и создаст фал проекта , как в следующем примере:
<pre>
######################################################################
# Automatically generated by qmake (1.06c) Do 2. Nov 14:44:21 2006
######################################################################
TEMPLATE = app
DEPENDPATH += .\Icons
INCLUDEPATH += .
# Input
HEADERS += ViewProvider.h Workbench.h
SOURCES += AppMyModGui.cpp \
Command.cpp \
ViewProvider.cpp \
Workbench.cpp
TRANSLATIONS += MyMod_de.ts
</pre>


<div class="mw-translate-fuzzy">
Вы можете вручную добавить сюда файлы. Раздел <tt>TRANSLATIONS</tt> содержит список файлов с переводом для каждого языка. В приведенном выше примере ''MyMod_de.ts'' является переводом на немецкий.
Если вы не знаете, как поступить, не стесняйтесь обратится за помощью на [http://forum.freecadweb.org/ форум].
</div>


===Important notes===
Теперь вам нужно запустить <tt>lupdate</tt> чтобы извлечь все строки символьные строки из вашего GUI. Запускайте <tt>lupdate</tt> после внесения изменений в исходном коде это безопасно, так как она(программа) никогда не удаляет строки из ваших файлов переводов. Она только добоваляет новые строки.


Every wiki user that has "Editor" permissions is able to launch the translate utility and write, save, and review translations.
Теперь, необходимо добавить <tt>.ts</tt>- файлы в ваш проект в VisualStudio. Укажите для них следующий пользовательский метод построения:
<syntaxhighlight>
python ..\..\..\Tools\qembed.py "$(InputDir)\$(InputName).ts"
"$(InputDir)\$(InputName).h" "$(InputName)"
</syntaxhighlight>
Примечание: Введите это в командной строе, разрывая строку команды только для написания расположения цели.


However, only users with "Administrator" permissions are able to mark pages for translation. A page that is not marked for translation won't make use of the translation extension and won't be correctly synchronized to the English information.
Компилируя <tt>.ts</tt>-файл из примера выше, будет создан файл ''MyMod_de.h''. Лучше всего его включить в ''App<Modul>Gui.cpp''. В нашем примереэто должен быть ''AppMyModGui.cpp''. Туда вы добавите строчку
<syntaxhighlight>
new Gui::LanguageProducer("Deutsch", <Modul>_de_h_data, <Modul>_de_h_len);
</syntaxhighlight>
для публикации перевода в приложении.


<div class="mw-translate-fuzzy">
=== Настройка python файлов для перевода ===
Боковая панель (меню навигации слева) также может быть переведена. Пожалуйста, следуйте инструкциям на странице [[Localisation Sidebar]].
</div>


<div class="mw-translate-fuzzy">
Для облегчения локализации py файлов вы можете использовать инструмент "pylupdate4" , он принимает один или несколько py фалов. С -ts опцией вы можете подготовить/обновить один или более .ts файлов. Например, чтобы подготовить .ts файл для французского просто введите в командной строке:
'''Примечание:''' первый раз при переключении страниц на новую систему перевода, она теряет все свои старые "Ручные" переводы. Чтобы восстановить перевод, вам необходимо открыть более раннюю версию из архива, и копировать / вставлять абзацы вручную в новой системе перевода.
<pre>
</div>
pylupdate4 *.py -ts YourModule_fr.ts
</pre>
Инструмент pylupdate просканирует ваши .py фалы на наличие translate() или tr() функций и создаст YourModule_fr.ts файл. Этот файл может быть переведен с помощью QLinguist и YourModule_fr.qm файла созданого в QLinguist или с помощью команды
<pre>
lrelease YourModule_fr.ts
</pre>
Помните что pylupdate4 не очень хорошо распознает функцию translate(), её необходимо корректно отредактировать ( смотри файлы Draft module как примеры). Внутри вашего файла, вы можете настроить переводчик , как здесь (после загрузки вашей QApplication но ПЕРЕД созданием qt виджетов):
<pre>
translator = QtCore.QTranslator()
translator.load("YourModule_"+languages[ln])
QtGui.QApplication.installTranslator(translator)
</pre>
По желанию, вы можете создать XML файл Draft.qrc со следующим содержанием:
<pre>
<RCC>
<qresource prefix="/translations" >
<file>Draft_fr.qm</file>
</qresource>
</RCC>
</pre>
и запустив pyrcc4 Draft.qrc -o qrc_Draft.py создайти приложение(big Python) содержащее все ваши ресурсы. Кстати этот подход также работает для помещения значка в один из фалов ресурсов


=== Translate the FreeCAD documentation ===
== Перевод wiki ==


As per general consensus, the reference page in the wiki is the English page, which should be created first. If you want to change or add content to a page, you should do it to the English page first, and only once the update is completed, port the modification to the translated page.
This wiki is hosting a lot of contents, the majority of which build up the manual. You can browse the documentation starting from the [[Main Page]], or have a look at the User's manual [[Online Help Toc]].


===Старые инструкции по переводу===
===Translation plugin===


{| class="mw-collapsible mw-collapsed wikitable"
When the Wiki moved away from SourceForge, [[User:Yorik|Yorik]] installed a [http://www.mediawiki.org/wiki/Help:Extension:Translate Translation plugin] which allows to ease translations between pages. For example, the page title can now be translated. Other advantages of the Translation plugin are that it keeps track of translations, notifies if the original page has been updated, and maintains translations in sync with the original English page.
|These instructions are for historical background only. Translations should use the new system with the [[#Mediawiki Translation Extension]] described above.
|-
|
So the first step is to '''check if the manual translation has already been started for your language''' (look in the left sidebar, under "manual").<br />
If not, head to the [http://forum.freecadweb.org/ forum] and say that you want to start a new translation, we'll create the basic setup for the language you want to work on.<br />
You must then [[FAQ#How_can_I_get_edit_permission_on_the_wiki.3F|gain wiki edit permission]].<br />
If your language is already listed, see what pages are still missing a translation (they will be listed in red). The technique is simple: '''go into a red page, and copy/paste the contents of the corresponding English page, and start translating'''.<br />
Do not forget to include all the tags and templates from the original English page. Some of those templates will have an equivalent in your language (for example, there is a French Docnav template called Docnav/fr). You should use '''a slash and your language code''' in almost all the links. Look at other already translated pages to see how they did it.<br />
Add a slash and your language code in the categories, like <nowiki>[[Category:Developer Documentation/fr]]</nowiki> <br />
And if you are unsure, head to the forums and ask people to check what you did and tell you if it's right or not.<br />
Four templates are commonly used in manual pages. These 4 templates have localized versions (Template:Docnav/fr, Template:fr, etc...)
* [[Template:GuiCommand]] : is the Gui Command information block in upper-right of command documentation.
* [[Template:Docnav]] : it is the navigation bar at the bottom of the pages, showing previous and next pages.
* [[Template:Userdocnavi]] : gives direct links to the main base pages<br />
''' Page Naming Convention '''<br />
Please take note that, due to limitations in the Sourceforge implementation of the MediaWiki engine, we require that your pages all keep their original English counterpart's name, appending a slash and your language code. For example, the translated page for About FreeCAD should be About Freecad/es for Spanish, About FreeCAD/pl for polish, etc. The reason is simple: so that if translators go away, the wiki's administrators, who do not speak all languages, will know what these pages are for. This will facilitate maintenance and avoid lost pages.<br />
If you want the Docnav template to show linked pages in your language, you can use '''redirect pages'''. They are basically shortcut links to the actual page. Here is an example with the French page for About FreeCAD.<br />
* The page About FreeCAD/fr is the page with content
* The page À propos de FreeCAD contains this code:
#REDIRECT <nowiki>[[About_FreeCAD/fr]]</nowiki>
* In the About FreeCAD/fr page, the Docnav code will look like this:
<nowiki>{{docnav/fr|[[Online_Help_Startpage/fr|Bienvenue dans l'aide en ligne de FreeCAD]]|[[Feature_list/fr|Fonctionnalités]]}}</nowiki>
The page "Bienvenue dans l'aide en ligne de FreeCAD" redirects to Online_Help_Startpage/fr, and the page "Fonctionnalités" redirects to Feature_list/fr.
|}


== Translate the FreeCAD website ==
The tool is documented in [http://www.mediawiki.org/wiki/Help:Extension:Translate Extension:Translate], and is part of a [http://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle Language Extension Bundle].
Translation of the FreeCAD website is now done through [https://crowdin.com/translate/freecad/561/en-en Crowdin]. The file is named {{FileName|homepage.po}}.


== Development - How to Add Localisation ==
To quickly get started on preparing a page for translation and activating the plugin, please read the [http://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example Page translation example].
This section is for developers who want to add localisation to their code.


<div class="mw-translate-fuzzy">
To see an example of how the Translation tool works once the translation plugin is activated on a page, you can visit the [[Main Page]]. You will see a new language menu bar at the bottom. It is automatically generated. Click for instance on the German link, it will get you to [[Main Page/de]]. Right under the title, you can read "This page is a '''translated version''' of a page Main Page and the translation is xx% complete." (xx being the actual percentage of translation). Click on the "translated version" link to start translation, or to update or correct the existing translation.
== Подготовка собственных модулей/приложений для перевода ==
</div>


All of the above steps are performed by the "translation scripts" which are run by an administrator periodically.
You will notice that you cannot directly edit a page anymore once it's been marked as a translation. You have to go through the translation utility.


Preparing your module for translation is quite easy. First, you need to ensure that you have a "translations" directory in {{FileName|myModule/Gui/Resources}}. Then open a terminal window (or Windows/OSX equivalent) in your "translations" directory and enter the following command:
When adding new content, the English page should be created first, then translated into another language. If someone wants to change/add content in a page, he should do the English one first.
{{Code|code=lupdate -ts myModule.ts}}


This creates an empty translation file. Once this is done, you need to ensure that the translation scripts are updated as in this [https://github.com/FreeCAD/FreeCAD/pull/810 pull request].
'''REMARK: The first time you switch a page to the new translation system, it looses all its old 'manual' translations. To recover the translation, you need to open an earlier version from the history, and copy/paste manually the paragraphs to the new translation system.'''


Everything after this is automatic as far as a developer is concerned. The administrator will extract the text strings, the translators will translate them, then the administrator will extract the translations and update FreeCAD/master.
Remark: to be able to translate in the wiki, you must of course [[FAQ#How_can_I_get_edit_permission_on_the_wiki.3F|gain wiki edit permission]].


<div class="mw-translate-fuzzy">
===Old translation instructions===
=== Требования ===
These instructions are for historical background only, while the pages are being passed to the new translation plugin.
</div>


=== Older module translation techniques ===
So the first step is to '''check if the manual translation has already been started for your language''' (look in the left sidebar, under "manual").
[[Localization Older Methods]] describes the use of translation tools such as Qt Linguist, lupdate, lrelease, pylupdate4, etc in detail. Most of this is no longer required for FreeCAD/master modules, but may be helpful preparing and updating 3rd party modules.


== Automating Crowdin Translation Updates ==
If not, head to the [http://forum.freecadweb.org/ forum] and say that you want to start a new translation, we'll create the basic setup for the language you want to work on.
Currently FreeCAD maintainers use the Crowdin API via [[Crowdin Scripts]] to pull and push translations in to Crowdin and back in to the Github repo. The Crowdin API gives FreeCAD maintainers the ability to automate aspects of the project's translation workflow, for more info refer to the [https://support.crowdin.com/api/api-integration-setup/ Crowdin API documentation].


== Related Pages ==
You must then [[FAQ#How_can_I_get_edit_permission_on_the_wiki.3F|gain wiki edit permission]].
* [[Crowdin Administration]]
* [[Crowdin Scripts]]


{{docnav/ru|Branding/ru|Extra python modules/ru}}
If your language is already listed, see what pages are still missing a translation (they will be listed in red). The technique is simple: '''go into a red page, and copy/paste the contents of the corresponding English page, and start translating'''.


{{Userdocnavi}}
Do not forget to include all the tags and templates from the original English page. Some of those templates will have an equivalent in your language (for example, there is a French Docnav template called Docnav/fr). You should use '''a slash and your language code''' in almost all the links. Look at other already translated pages to see how they did it.


<div class="mw-translate-fuzzy">
Add a slash and your language code in the categories, like <nowiki>[[Category:Developer Documentation/fr]]</nowiki>
[[Category:Developer Documentation/ru]]
</div>


[[Category:Wiki]]
And if you are unsure, head to the forums and ask people to check what you did and tell you if it's right or not.

Four templates are commonly used in manual pages. These 4 templates have localized versions (Template:Docnav/fr, Template:fr, etc...)
* [[Template:GuiCommand]] : is the Gui Command information block in upper-right of command documentation.
* [[Template:Docnav]] : it is the navigation bar at the bottom of the pages, showing previous and next pages.

====Page Naming Convention====

Please take note that, due to limitations in the Sourceforge implementation of the MediaWiki engine, we require that your pages all keep their original English counterpart's name, appending a slash and your language code. For example, the translated page for About FreeCAD should be About Freecad/es for Spanish, About FreeCAD/pl for polish, etc. The reason is simple: so that if translators go away, the wiki's administrators, who do not speak all languages, will know what these pages are for. This will facilitate maintenance and avoid lost pages.

If you want the Docnav template to show linked pages in your language, you can use '''redirect pages'''. They are basically shortcut links to the actual page. Here is an example with the French page for About FreeCAD.

* The page About FreeCAD/fr is the page with content
* The page À propos de FreeCAD contains this code:
#REDIRECT <nowiki>[[About FreeCAD/fr]]</nowiki>
* In the About FreeCAD/fr page, the Docnav code will look like this:
<nowiki>{{docnav/fr|Bienvenue sur l'aide en ligne|Fonctionnalités}}</nowiki>
The page "Bienvenue sur l'aide en ligne" redirects to Online Help Startpage/fr, and the page "Fonctionnalités" redirects to Feature list/fr.

If you are unsure how to proceed, don't hesitate to ask for help in the [http://forum.freecadweb.org/ forum].

{{docnav|Branding|Extra python modules}}

[[Category:Developer Documentation]]


{{clear}}
{{clear}}
<languages/>

Revision as of 19:30, 6 October 2019

Branding
Extra python modules

Локализация это в общем процесс предоставления програмного обеспечения c пользовательским интерфейсом поддерживающем несколько языков . В FreeCAD вы можете установить язык пользовательского интерфейса в Edit→Preferences→Application. FreeCAD использует Qt чтобы поддерживать несколько языков. В Unix/Linux системах, FreeCAD использует текущие настройки локали(языковые настройки) вашей системы, по умолчаннию.

Помощь с переводом FreeCAD

Одно из очень важных дел которое пользователи могут сделать для FreeCAD (если например они не имеют навыков программирования ), это помочь с переводом различных частей проекта (программа, сайт, вики, документация и т. д.) на другой язык. Вот как это можно сделать

Перевести программное обеспечение FreeCAD

FreeCAD использует стороннюю коллективную систему онлайн переводов, называемую Crowdin. Она проприетарная, но бесплатна для проектов с открытым исходным кодом. Ниже представлены инструкции по использованию этой системы.

  • Отправляйтесь на страницу проекта перевода FreeCAD на Crowdin;
  • Войдите, создав новый профиль, или воспользовавшись сторонними аккаунтами (GitHub, GitLab, GMail итд...);
  • Щелкните иконку языка на котоый хотите перевести;
  • Начните переводить , щелкнув на Template:Кнопке рядом с одним из файлов. Например, FreeCAD.ts содержит текстовые строки для главного окна FreeCAD.
  • Вы можете голосовать за существующие переводы, или вы можете создавать свой собственный.

Примечание: Если вы активно принимаете участие в переводе FreeCAD и хотите быть в курсе когда будет готов к запуску следующий релиз, так чтобы было время рассмотреть ваш перевод, пожалуйста подпишитесь на этот опрос: http://www.freecadweb.org/tracker/view.php?id=137

Перевод wiki

В этой вики содержится много контента, большинство из которого собрано в руководства. Вы можете просмотреть документацию, начиная со стартовой страницы или можно взглянуть на руководство пользователя

Примечание: чтобы иметь возможность перевести вики, вы должны сначала, конечно получить разрешение на редактирование вики.

Необходимо иметь базовые знания о стиле форматирования вики, а также обладать общими основными принципами вики FreeCAD, потому что при переводе вы будете иметь дело с некоторыми специальными тегами. Вы можете найти эту информацию на странице WikiPages

Плагин для перевода

После того, как вики была убрана с SourceForge, Yorik установил плагин для перевода который позволяет облегчить переводы между страницами. Например, теперь может быть переведён заголовок страницы. Другие преимущества плагина для перевода в том, что он отслеживает переводы, уведомляет, если исходная страница была обновлена, и поддерживает синхронизацию переводов с оригинальной страницей на английском языке.

Инструмент описан в Extension:Translate и является частью Language Extension Bundle.

Чтобы быстро начать работу по подготовке страницы для перевода и активации плагина, пожалуйста, прочитайте страницу с примером перевода.

Чтобы увидеть пример того, как работает инструмент перевода, один раз плагин перевод активируется на странице, вы можете посетить Стартовую страницу. Вы увидите новую языковую строку меню внизу. Она была сгенерирована автоматически. Нажмите, например, на немецкую ссылку, это преместит Вас на стартовую страницу на немецком языке. Прямо под названием, вы можете прочитать "Эта страница представляет собой 'переведенную версию' страницы Стартовая страница и перевод завершен на хх%." (Хх - это текущий фактический процент перевода). Нажмите на ссылку "translated version", чтобы начать перевод, либо обновить или исправить существующий перевод.

Вы обнаружите, что не можете больше напрямую редактировать страницу, как только страница была отмечена, как перевод. Вы должны использовать утилиту (плагин) для перевода.

При добавлении нового контента, вначале должна быть создана страница на английском языке, а затем она переводится на другой язык. Если кто-то хочет изменить / добавить контент на странице, он первым делом должен сделать английскую версию.

Если вы не знаете, как поступить, не стесняйтесь обратится за помощью на форум.

Important notes

Every wiki user that has "Editor" permissions is able to launch the translate utility and write, save, and review translations.

However, only users with "Administrator" permissions are able to mark pages for translation. A page that is not marked for translation won't make use of the translation extension and won't be correctly synchronized to the English information.

Боковая панель (меню навигации слева) также может быть переведена. Пожалуйста, следуйте инструкциям на странице Localisation Sidebar.

Примечание: первый раз при переключении страниц на новую систему перевода, она теряет все свои старые "Ручные" переводы. Чтобы восстановить перевод, вам необходимо открыть более раннюю версию из архива, и копировать / вставлять абзацы вручную в новой системе перевода.

Translate the FreeCAD documentation

As per general consensus, the reference page in the wiki is the English page, which should be created first. If you want to change or add content to a page, you should do it to the English page first, and only once the update is completed, port the modification to the translated page.

Старые инструкции по переводу

These instructions are for historical background only. Translations should use the new system with the #Mediawiki Translation Extension described above.

So the first step is to check if the manual translation has already been started for your language (look in the left sidebar, under "manual").
If not, head to the forum and say that you want to start a new translation, we'll create the basic setup for the language you want to work on.
You must then gain wiki edit permission.
If your language is already listed, see what pages are still missing a translation (they will be listed in red). The technique is simple: go into a red page, and copy/paste the contents of the corresponding English page, and start translating.
Do not forget to include all the tags and templates from the original English page. Some of those templates will have an equivalent in your language (for example, there is a French Docnav template called Docnav/fr). You should use a slash and your language code in almost all the links. Look at other already translated pages to see how they did it.
Add a slash and your language code in the categories, like [[Category:Developer Documentation/fr]]
And if you are unsure, head to the forums and ask people to check what you did and tell you if it's right or not.
Four templates are commonly used in manual pages. These 4 templates have localized versions (Template:Docnav/fr, Template:fr, etc...)

  • Template:GuiCommand : is the Gui Command information block in upper-right of command documentation.
  • Template:Docnav : it is the navigation bar at the bottom of the pages, showing previous and next pages.
  • Template:Userdocnavi : gives direct links to the main base pages

Page Naming Convention
Please take note that, due to limitations in the Sourceforge implementation of the MediaWiki engine, we require that your pages all keep their original English counterpart's name, appending a slash and your language code. For example, the translated page for About FreeCAD should be About Freecad/es for Spanish, About FreeCAD/pl for polish, etc. The reason is simple: so that if translators go away, the wiki's administrators, who do not speak all languages, will know what these pages are for. This will facilitate maintenance and avoid lost pages.
If you want the Docnav template to show linked pages in your language, you can use redirect pages. They are basically shortcut links to the actual page. Here is an example with the French page for About FreeCAD.

  • The page About FreeCAD/fr is the page with content
  • The page À propos de FreeCAD contains this code:
#REDIRECT [[About_FreeCAD/fr]]
  • In the About FreeCAD/fr page, the Docnav code will look like this:
{{docnav/fr|[[Online_Help_Startpage/fr|Bienvenue dans l'aide en ligne de FreeCAD]]|[[Feature_list/fr|Fonctionnalités]]}}

The page "Bienvenue dans l'aide en ligne de FreeCAD" redirects to Online_Help_Startpage/fr, and the page "Fonctionnalités" redirects to Feature_list/fr.

Translate the FreeCAD website

Translation of the FreeCAD website is now done through Crowdin. The file is named homepage.po.

Development - How to Add Localisation

This section is for developers who want to add localisation to their code.

Подготовка собственных модулей/приложений для перевода

All of the above steps are performed by the "translation scripts" which are run by an administrator periodically.

Preparing your module for translation is quite easy. First, you need to ensure that you have a "translations" directory in myModule/Gui/Resources. Then open a terminal window (or Windows/OSX equivalent) in your "translations" directory and enter the following command:

lupdate -ts myModule.ts

This creates an empty translation file. Once this is done, you need to ensure that the translation scripts are updated as in this pull request.

Everything after this is automatic as far as a developer is concerned. The administrator will extract the text strings, the translators will translate them, then the administrator will extract the translations and update FreeCAD/master.

Требования

Older module translation techniques

Localization Older Methods describes the use of translation tools such as Qt Linguist, lupdate, lrelease, pylupdate4, etc in detail. Most of this is no longer required for FreeCAD/master modules, but may be helpful preparing and updating 3rd party modules.

Automating Crowdin Translation Updates

Currently FreeCAD maintainers use the Crowdin API via Crowdin Scripts to pull and push translations in to Crowdin and back in to the Github repo. The Crowdin API gives FreeCAD maintainers the ability to automate aspects of the project's translation workflow, for more info refer to the Crowdin API documentation.

Related Pages

Branding/ru
Extra python modules/ru