Localisation/pt-br: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(64 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
'''Localisation''' is in general the process of providing a Software with a multiple language user interface. In FreeCAD you can set the language of the user interface under ''Edit→Preferences→Application''. FreeCAD uses [[wikipedia:Qt (toolkit)|Qt]] to enable multiple language support. On Unix/Linux systems, FreeCAD uses the current locale settings of your system by default.


== Helping to translate FreeCAD ==
<div class="mw-translate-fuzzy">
{{Docnav
|[[Branding/pt-br|Branding]]
|[[Module_Creation/pt-br|Criação de módulos]]
}}
</div>


{{TOCright}}
One of the very important things you can do for FreeCAD if you are not a programmer, is to help to translate the program in your language. To do so is now easier than ever, with the use of the [http://crowdin.net Crowdin] collaborative on-line translation system.


<span id="Overview"></span>
=== How to Translate ===
==Visão geral==


'''Localização''' é, em geral, o processo de fornecer um Software com uma interface de usuário em vários idiomas. No FreeCAD, você pode definir o idioma da interface do usuário em {{MenuCommand|Editar → Preferências → Geral}}. O FreeCAD usa o [[wikipedia:Qt (toolkit)|Qt]] para permitir o suporte a vários idiomas. Em sistemas Unix/Linux, o FreeCAD usa as configurações de localidade atuais do seu sistema por padrão.
* Go to the [http://crowdin.net/project/freecad FreeCAD translation project page on Crowdin];
* Login by creating a new profile, or using a third-party account like your GMail address;
* Click on the language you wish to work on;
* Start translating by clicking on the Translate button next to one of the files. For example, ''FreeCAD.ts'' contains the text strings for the FreeCAD main GUI.
* You can vote for existing translations, or you can create your own.


<span id="Helping_to_translate_FreeCAD"></span>
'''Note''': If you are actively taking part in translating FreeCAD and want to be
== Ajudando a traduzir o FreeCAD ==
informed before next release is ready to be launched,
so there is time to review your translation, please subscribe
to one of the Crowdin FreeCAD translation teams.


Uma das coisas muito importantes que os usuários podem contribuir com o FreeCAD (se, por exemplo, não tiverem habilidades de programação) é ajudar a traduzir seus diferentes aspectos (código-fonte, wiki, website, documentação, etc.) para outro idioma. Aqui estão as maneiras de como fazer isso.
== Preparing your FreeCAD/master modules for translation ==
These are the parts to the FreeCAD translation process:
* extract text strings from source code into *.ts files
* load *.ts files into [http://crowdin.net/project/freecad FreeCAD Crowdin].
* translation of strings within Crowdin
* extract modified/new *.ts files from Crowdin
* convert *.ts files into *.qm files and update each module's *.qrc file
* update FreeCAD master


<span id="Translate_the_FreeCAD_source_code"></span>
All of the above steps are performed by the "translation scripts" which are run by an administrator periodically.
== Traduzir o código fonte do FreeCAD ==


O FreeCAD utiliza um sistema de tradução on-line colaborativo de terceiros chamado [https://crowdin.net Crowdin].
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:
{{Code|code=lupdate -ts myModule.ts}}


[[File:Logo-crowdin.png|320px]]
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].


<div class="mw-translate-fuzzy">
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.
É um software proprietário, mas gratuito para projetos [https://pt.wikipedia.org/wiki/Software_livre_e_de_c%C3%B3digo_aberto FOSS]. Abaixo estão as instruções sobre como usá-lo:
</div>


* Vá para a [http://crowdin.net/project/freecad página do projeto de tradução FreeCAD no Crowdin]
== Preparing your 3rd party module or macro for translation ==
* Faça login criando um novo perfil ou usando uma conta de terceiros (GitHub, GitLab, GMail etc...)
3rd party modules or macros are translated in much the same fashion, except that you must do some of the work yourself.
* Clique no idioma que deseja traduzir
This [https://www.forum.freecadweb.org/viewtopic.php?f=3&t=25180 forum discussion] describes the details .
* Comece a traduzir clicando no botão {{Button||Traduzir}} ao lado de um dos arquivos. Por exemplo, {{FileName|FreeCAD.ts}} contém as sequências de texto para a GUI principal do FreeCAD.
* Você pode votar nas traduções existentes ou pode criar a sua própria.


{{Message|Se você está participando ativamente da tradução do FreeCAD e deseja ser informado antes que o próximo lançamento esteja pronto para ser lançado, para que haja tempo para revisar sua tradução, inscreva-se em uma das equipes de tradução do FreeCAD no Crowdin.}}
== Automating Translation Updates ==
Currently FreeCAD uses the Crowdin API via [[Crowdin Scripts]] to pull and push translations in to Crowdin and back in to the Github repo.


{{Emphasis|Nota:}} Detalhes sobre como usar o Crowdin podem ser encontrados na página [[Crowdin_Administration|Crowdin Administration]].
== 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.


<span id="Translating_external_workbenches"></span>
== Translating the wiki ==
== Traduzindo bancadas externas ==


Visite [[Translating_an_external_workbench|Traduzindo uma bancada externa]].
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]].


<span id="FreeCAD_Preferences_for_Translators"></span>
===Translation plugin===
== Preferências para tradutores do FreeCAD ==


A partir do FreeCAD 0.20, as seguintes variáveis podem ser adicionadas manualmente à seção BaseApp/Preferences/General do arquivo {{FileName|user.cfg}} para ajudar no desenvolvimento de novas traduções:
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.


'''AdditionalLanguageDomainEntries''' - para adicionar idiomas totalmente novos ao FreeCAD que não são atualmente suportados pelo código-fonte, você pode usar esta preferência do usuário para adicionar à lista de idiomas disponíveis. O formato dos idiomas é "Language Name"="code"; por exemplo:
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].


<pre>
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].
<FCText Name="AdditionalLanguageDomainEntries">"Esperanto"="eo";"French"="fr";</FCText>
</pre>


'''AdditionalTranslationsDirectory''' - adiciona um diretório adicional para o FreeCAD procurar por arquivos *.qm. Este local terá precedência sobre $userAppDataDir/translations e $resourceDir/translations. Por exemplo:
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.


<pre>
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.
<FCText Name="AdditionalTranslationsDirectory">C:/Users/FreeCADUser/TestTranslations</FCText>
</pre>


<span id="Translate_the_FreeCAD_wiki"></span>
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.
== Traduzindo o wiki do FreeCAD ==


Este wiki hospeda muitos conteúdos, a maioria dos quais compõem o manual. Você pode navegar pela documentação a partir da [[Main_Page/pt-br|Página principal]], ou dar uma olhada no manual do usuário [[Online Help Toc/pt-br|Índice da Ajuda Online]].
It is recommended to have basic knowledge of wiki style formatting and general guidelines of the FreeCAD wiki, because you will have to deal with some tags while translating. You can find this information on [[WikiPages]].


Para traduzir o wiki, você deve ter permissões de edição do wiki; veja [[Frequently_asked_questions#How can I get edit permission on the wiki?|How can I get edit permission on the wiki?]].
The sidebar (navigation menu on the left) is also translatable. Please follow dedicated instructions on [[Localisation Sidebar]] page.


Você também deve ter conhecimento suficiente da marcação wiki e seguir as diretrizes gerais de estilo descritas em [[WikiPages/pt-br|Páginas Wiki]].
'''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.'''


<span id="Mediawiki_Translation_Extension"></span>
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]].
=== Extenção para tradução do Mediawiki===


Quando o wiki saiu do SourceForge, [[User:Yorik|Yorik]] instalou [http://www.mediawiki.org/wiki/Help:Extension:Translate MediaWiki's Translation extension] que facilita a tradução de páginas. As vantagens da extensão de tradução são que o título da página agora pode ser traduzido, as traduções são monitoradas, ela notifica se a página original foi atualizada e mantém as traduções sincronizadas com a página original em inglês.


A ferramenta está documentada em [http://www.mediawiki.org/wiki/Help:Extension:Translate Help:Extension:Translate] e faz parte do [http://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle Pacote de extensão de idiomas do MediaWiki].
If you are unsure how to proceed, don't hesitate to ask for help in the [http://forum.freecadweb.org forum].

Para começar a preparar uma página para tradução de forma rápida, leia o [http://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example Exemplo de tradução de página].
Basicamente um par de tags

<pre>
&lt;translate&gt; ... &lt;/translate&gt;
</pre><!--using lt and gt so that tags are not recognized-->

precisam envolver toda a página para ativar o sistema de tradução, e a página precisa ser marcada para tradução.

Para ver um exemplo de como a ferramenta de tradução funciona, visite a [[Main Page/pt-br|Página principal]]. Você verá uma barra de idiomas gerada automaticamente na parte superior. Clique em [[Main Page/de|Deutsch]] (Alemão), ele irá levá-lo para [[Main Page/de]]. Logo abaixo do título, "Hauptseite" (em inglês "Página principal"), você pode ler <small>{{Emphasis|Esta página é uma versão traduzida da página Main Page e a tradução está XX% completa}}</small>, XX sendo a porcentagem atual de tradução. Clique em "Traduzir" no topo da página para iniciar o utilitário de tradução para atualizar, corrigir e revisar a tradução existente.

Se você for para [[Main Page/pt-br]], notará que não pode mais editar a página diretamente clicando nas tags [Edit], e o link superior "Editar" foi substituído pelo link "Traduzir" que abre o utilitário de tradução.

Ao adicionar novo conteúdo, a página em inglês deve ser criada primeiro e depois traduzida para outro idioma. Se alguém quiser alterar ou adicionar conteúdo em uma página, a página em inglês deve ser modificada primeiro.

Se você não tiver certeza de como proceder com as traduções, não hesite em pedir ajuda no [https://forum.freecadweb.org/viewforum.php?f=21 Development → Wiki subforum] ou no [https ://forum.freecadweb.org/viewforum.php?f=11 subfórum de idioma específico] no [http://forum.freecadweb.org fórum FreeCAD].

===Important notes===

Every wiki user that has "Editor" permissions is able to launch the translate utility to 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.

The left sidebar is also translatable, but only Administrators can modify this element of the site. Please follow the dedicated instructions on [[Localisation Sidebar|Localisation Sidebar]].

The first time you switch a page to the new translation system, it loses all its old "manual" translations. To recover a translation, you should save an offline copy of the old text before the switch. Then you can use this old translated text to fill in the translation units in the new system. You can also open an earlier version from the history, and get the old text in this way. This has to be done for every language that had a translated page.

=== 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.


===Old translation instructions===
===Old translation instructions===


{| class="mw-collapsible mw-collapsed wikitable"
{| class="mw-collapsible mw-collapsed wikitable"
|These instructions are for historical background only, while the pages are being passed to the new translation plugin.
|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 />
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 />
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 />
You must then [[Frequently_asked_questions#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 />
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 />
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 />
Line 92: Line 126:
* [[Template:GuiCommand]] : is the Gui Command information block in upper-right of command documentation.
* [[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: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 />
''' 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 />
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 />
Line 97: Line 132:
* The page About FreeCAD/fr is the page with content
* The page About FreeCAD/fr is the page with content
* The page À propos de FreeCAD contains this code:
* The page À propos de FreeCAD contains this code:
#REDIRECT <nowiki>[[About FreeCAD/fr]]</nowiki>
#REDIRECT <nowiki>[[About_FreeCAD/fr]]</nowiki>
* In the About FreeCAD/fr page, the Docnav code will look like this:
* 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>
<nowiki>{{docnav/fr|[[Online_Help_Startpage/fr|Bienvenue dans l'aide en ligne de FreeCAD]]|[[Feature_list/fr|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.
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 ==
{{docnav|Branding|Extra python modules}}

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 ==

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

=== Preparing your FreeCAD/master modules for translation ===

These are the parts to the FreeCAD translation process:
* extract text strings from source code into *.ts files
* load *.ts files into [http://crowdin.net/project/freecad FreeCAD Crowdin].
* translation of strings within Crowdin
* extract modified/new *.ts files from Crowdin
* convert *.ts files into *.qm files and update each module's *.qrc file
* update FreeCAD master

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 {{FileName|myModule/Gui/Resources}}. Then open a terminal window (or Windows/OSX equivalent) in your "translations" directory and enter the following command:
{{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].

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.

=== Preparing your 3rd party module or macro for translation ===

3rd party modules or macros are translated in much the same fashion, except that you must do some of the work yourself.
This [https://www.forum.freecadweb.org/viewtopic.php?f=3&t=25180 forum discussion] describes the details.

Update: see [[Translating_an_external_workbench|Translating an external workbench]]

=== Older module translation techniques ===

[[Localization_Older_Methods|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|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 ==

* [[Crowdin_Administration|Crowdin Administration]]
* [[Crowdin_Scripts|Crowdin Scripts]]

==Scripting==

{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

To get a dictionary with the languages the FreeCAD interface supports, use the {{incode|supportedLocales}} method of the {{incode|FreeCADGui}} module.

{{Code|code=
locales = FreeCADGui.supportedLocales()
}}

After execution {{incode|locales}} will contain:

{{Code|code=
{'English': 'en', 'Afrikaans': 'af', 'Arabic': 'ar', 'Basque': 'eu', 'Catalan': 'ca', 'Chinese Simplified': 'zh-CN', 'Chinese Traditional': 'zh-TW', 'Croatian': 'hr', 'Czech': 'cs', 'Dutch': 'nl', 'Filipino': 'fil', 'Finnish': 'fi', 'French': 'fr', 'Galician': 'gl', 'German': 'de', 'Hungarian': 'hu', 'Indonesian': 'id', 'Italian': 'it', 'Japanese': 'ja', 'Kabyle': 'kab', 'Korean': 'ko', 'Lithuanian': 'lt', 'Norwegian': 'no', 'Polish': 'pl', 'Portuguese': 'pt-PT', 'Portuguese, Brazilian': 'pt-BR', 'Romanian': 'ro', 'Russian': 'ru', 'Slovak': 'sk', 'Slovenian': 'sl', 'Spanish': 'es-ES', 'Swedish': 'sv-SE', 'Turkish': 'tr', 'Ukrainian': 'uk', 'Valencian': 'val-ES', 'Vietnamese': 'vi'}
}}

To get the current interface language use the {{incode|getLocale}} method of the same module:

{{Code|code=
locale = FreeCADGui.getLocale()
}}

If the current language is English {{incode|locale}} will contain:

{{Code|code=
'English'
}}

To get the corresponding [https://support.crowdin.com/api/language-codes/ language code] you can use use:

{{Code|code=
locale = FreeCADGui.supportedLocales()[Gui.getLocale()]
}}

If the current language is English the result will be:

{{Code|code=
'en'
}}

To set the current interface language use the {{incode|setLocale}} method of the same module. You can specify the language or the language code:

{{Code|code=
FreeCADGui.setLocale('Russian')
FreeCADGui.setLocale('ru')
}}



<div class="mw-translate-fuzzy">
[[Category:Developer Documentation/pt-br]]
{{Docnav
|[[Branding/pt-br|Marca]]
|[[Module_Creation/pt-br|Criação de módulos]]
}}
</div>


{{Userdocnavi{{#translation:}}}}
{{clear}}
[[Category:Developer Documentation{{#translation:}}]]
[[Category:Wiki{{#translation:}}]]

Latest revision as of 10:06, 31 March 2023

Visão geral

Localização é, em geral, o processo de fornecer um Software com uma interface de usuário em vários idiomas. No FreeCAD, você pode definir o idioma da interface do usuário em Editar → Preferências → Geral. O FreeCAD usa o Qt para permitir o suporte a vários idiomas. Em sistemas Unix/Linux, o FreeCAD usa as configurações de localidade atuais do seu sistema por padrão.

Ajudando a traduzir o FreeCAD

Uma das coisas muito importantes que os usuários podem contribuir com o FreeCAD (se, por exemplo, não tiverem habilidades de programação) é ajudar a traduzir seus diferentes aspectos (código-fonte, wiki, website, documentação, etc.) para outro idioma. Aqui estão as maneiras de como fazer isso.

Traduzir o código fonte do FreeCAD

O FreeCAD utiliza um sistema de tradução on-line colaborativo de terceiros chamado Crowdin.

É um software proprietário, mas gratuito para projetos FOSS. Abaixo estão as instruções sobre como usá-lo:

  • Vá para a página do projeto de tradução FreeCAD no Crowdin
  • Faça login criando um novo perfil ou usando uma conta de terceiros (GitHub, GitLab, GMail etc...)
  • Clique no idioma que deseja traduzir
  • Comece a traduzir clicando no botão ao lado de um dos arquivos. Por exemplo, FreeCAD.ts contém as sequências de texto para a GUI principal do FreeCAD.
  • Você pode votar nas traduções existentes ou pode criar a sua própria.
Se você está participando ativamente da tradução do FreeCAD e deseja ser informado antes que o próximo lançamento esteja pronto para ser lançado, para que haja tempo para revisar sua tradução, inscreva-se em uma das equipes de tradução do FreeCAD no Crowdin.


Nota: Detalhes sobre como usar o Crowdin podem ser encontrados na página Crowdin Administration.

Traduzindo bancadas externas

Visite Traduzindo uma bancada externa.

Preferências para tradutores do FreeCAD

A partir do FreeCAD 0.20, as seguintes variáveis podem ser adicionadas manualmente à seção BaseApp/Preferences/General do arquivo user.cfg para ajudar no desenvolvimento de novas traduções:

AdditionalLanguageDomainEntries - para adicionar idiomas totalmente novos ao FreeCAD que não são atualmente suportados pelo código-fonte, você pode usar esta preferência do usuário para adicionar à lista de idiomas disponíveis. O formato dos idiomas é "Language Name"="code"; por exemplo:

<FCText Name="AdditionalLanguageDomainEntries">"Esperanto"="eo";"French"="fr";</FCText>

AdditionalTranslationsDirectory - adiciona um diretório adicional para o FreeCAD procurar por arquivos *.qm. Este local terá precedência sobre $userAppDataDir/translations e $resourceDir/translations. Por exemplo:

<FCText Name="AdditionalTranslationsDirectory">C:/Users/FreeCADUser/TestTranslations</FCText>

Traduzindo o wiki do FreeCAD

Este wiki hospeda muitos conteúdos, a maioria dos quais compõem o manual. Você pode navegar pela documentação a partir da Página principal, ou dar uma olhada no manual do usuário Índice da Ajuda Online.

Para traduzir o wiki, você deve ter permissões de edição do wiki; veja How can I get edit permission on the wiki?.

Você também deve ter conhecimento suficiente da marcação wiki e seguir as diretrizes gerais de estilo descritas em Páginas Wiki.

Extenção para tradução do Mediawiki

Quando o wiki saiu do SourceForge, Yorik instalou MediaWiki's Translation extension que facilita a tradução de páginas. As vantagens da extensão de tradução são que o título da página agora pode ser traduzido, as traduções são monitoradas, ela notifica se a página original foi atualizada e mantém as traduções sincronizadas com a página original em inglês.

A ferramenta está documentada em Help:Extension:Translate e faz parte do Pacote de extensão de idiomas do MediaWiki.

Para começar a preparar uma página para tradução de forma rápida, leia o Exemplo de tradução de página. Basicamente um par de tags

<translate> ... </translate>

precisam envolver toda a página para ativar o sistema de tradução, e a página precisa ser marcada para tradução.

Para ver um exemplo de como a ferramenta de tradução funciona, visite a Página principal. Você verá uma barra de idiomas gerada automaticamente na parte superior. Clique em Deutsch (Alemão), ele irá levá-lo para Main Page/de. Logo abaixo do título, "Hauptseite" (em inglês "Página principal"), você pode ler Esta página é uma versão traduzida da página Main Page e a tradução está XX% completa, XX sendo a porcentagem atual de tradução. Clique em "Traduzir" no topo da página para iniciar o utilitário de tradução para atualizar, corrigir e revisar a tradução existente.

Se você for para Main Page/pt-br, notará que não pode mais editar a página diretamente clicando nas tags [Edit], e o link superior "Editar" foi substituído pelo link "Traduzir" que abre o utilitário de tradução.

Ao adicionar novo conteúdo, a página em inglês deve ser criada primeiro e depois traduzida para outro idioma. Se alguém quiser alterar ou adicionar conteúdo em uma página, a página em inglês deve ser modificada primeiro.

Se você não tiver certeza de como proceder com as traduções, não hesite em pedir ajuda no Development → Wiki subforum ou no [https ://forum.freecadweb.org/viewforum.php?f=11 subfórum de idioma específico] no fórum FreeCAD.

Important notes

Every wiki user that has "Editor" permissions is able to launch the translate utility to 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.

The left sidebar is also translatable, but only Administrators can modify this element of the site. Please follow the dedicated instructions on Localisation Sidebar.

The first time you switch a page to the new translation system, it loses all its old "manual" translations. To recover a translation, you should save an offline copy of the old text before the switch. Then you can use this old translated text to fill in the translation units in the new system. You can also open an earlier version from the history, and get the old text in this way. This has to be done for every language that had a translated page.

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.

Old translation instructions

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.

Preparing your FreeCAD/master modules for translation

These are the parts to the FreeCAD translation process:

  • extract text strings from source code into *.ts files
  • load *.ts files into FreeCAD Crowdin.
  • translation of strings within Crowdin
  • extract modified/new *.ts files from Crowdin
  • convert *.ts files into *.qm files and update each module's *.qrc file
  • update FreeCAD master

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.

Preparing your 3rd party module or macro for translation

3rd party modules or macros are translated in much the same fashion, except that you must do some of the work yourself. This forum discussion describes the details.

Update: see Translating an external workbench

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

Scripting

See also: FreeCAD Scripting Basics.

To get a dictionary with the languages the FreeCAD interface supports, use the supportedLocales method of the FreeCADGui module.

locales = FreeCADGui.supportedLocales()

After execution locales will contain:

{'English': 'en', 'Afrikaans': 'af', 'Arabic': 'ar', 'Basque': 'eu', 'Catalan': 'ca', 'Chinese Simplified': 'zh-CN', 'Chinese Traditional': 'zh-TW', 'Croatian': 'hr', 'Czech': 'cs', 'Dutch': 'nl', 'Filipino': 'fil', 'Finnish': 'fi', 'French': 'fr', 'Galician': 'gl', 'German': 'de', 'Hungarian': 'hu', 'Indonesian': 'id', 'Italian': 'it', 'Japanese': 'ja', 'Kabyle': 'kab', 'Korean': 'ko', 'Lithuanian': 'lt', 'Norwegian': 'no', 'Polish': 'pl', 'Portuguese': 'pt-PT', 'Portuguese, Brazilian': 'pt-BR', 'Romanian': 'ro', 'Russian': 'ru', 'Slovak': 'sk', 'Slovenian': 'sl', 'Spanish': 'es-ES', 'Swedish': 'sv-SE', 'Turkish': 'tr', 'Ukrainian': 'uk', 'Valencian': 'val-ES', 'Vietnamese': 'vi'}

To get the current interface language use the getLocale method of the same module:

locale = FreeCADGui.getLocale()

If the current language is English locale will contain:

'English'

To get the corresponding language code you can use use:

locale = FreeCADGui.supportedLocales()[Gui.getLocale()]

If the current language is English the result will be:

'en'

To set the current interface language use the setLocale method of the same module. You can specify the language or the language code:

FreeCADGui.setLocale('Russian')
FreeCADGui.setLocale('ru')