Lokalizacja - tłumaczenie interfejsu i dokumentacji

From FreeCAD Documentation
Revision as of 10:09, 4 January 2020 by Kaktus (talk | contribs) (Created page with "Zgodnie z ogólnym konsensusem, strona referencyjna w Wiki jest stroną angielską, która powinna być utworzona jako pierwsza. Jeśli chcesz zmienić lub dodać treść do s...")

Lokalizacja oznacza zasadniczo proces dostarczania oprogramowania z wielojęzycznym interfejsem użytkownika. W FreeCAD możesz ustawić język interfejsu użytkownika w Edycja → Preferencje → Ogólnie. FreeCAD używa Qt, aby umożliwić obsługę wielu języków. W systemach Unix/Linux, FreeCAD domyślnie korzysta z bieżących ustawień lokalnych systemu.

Pomoc w tłumaczeniu programu FreeCAD

Jedną z bardzo ważnych rzeczy, które użytkownicy mogą wnieść do FreeCAD (jeśli na przykład nie posiadają umiejętności programowania) jest pomoc w tłumaczeniu jego różnych elementów (kod źródłowy, Wiki, strona internetowa, dokumentacja itp...) na inny język. Są dostępne następujące sposoby, aby tego dokonać.

Przetłumacz kod źródłowy FreeCAD

FreeCAD korzysta z systemu tłumaczeń on-line, zwanego Crowdin.

Jest to oprogramowanie zamknięte, ale bezpłatne dla projektów FOSS. Poniżej znajdują się instrukcje, jak go używać:

  • Udaj się na stronę Crowdin tłumaczenia projektu FreeCAD;
  • Zaloguj się tworząc nowy profil lub używając innego konta (GitHub, GitLab, GMail itp...)
  • Kliknij na język nad którym chcesz pracować;
  • Rozpocznij tłumaczenie przez kliknięcie przycisku Translate przy jednym z plików. Na przykład FreeCAD.ts' zawiera ciągi tekstu z głównego interfejsu graficznego FreeCAD.
  • Możesz głosować na istniejące tłumaczenia lub dodawać własne.
Jeśli aktywnie bierzesz udział w tłumaczeniu FreeCAD i chcesz być informowany przed premierą kolejnego wydania, aby mieć czas na zapoznanie się z treścią tłumaczenia, zapisz się do jednego z zespołów tłumaczy Crowdin FreeCAD.


Tłumaczenie dokumentacji Wiki dla FreeCAD

Wiki zawiera wiele treści, z których większość tworzy podręcznik. Możesz przeglądać dokumentację zaczynając od Strony głównej, lub zajrzeć do podręcznika użytkownika Spis treści pomocy online.

Aby móc tłumaczyć wiki, musisz mieć uprawnienia do edycji wiki; zobacz Jak mogę uzyskać uprawnienia do edycji na wiki?.

Powinieneś również posiadać znajomość znaczników wiki i stosować się do ogólnych wytycznych dotyczących stylizacji opisanych na Witrynie Wiki.

Rozszerzenie do tłumaczenia Mediawiki

Kiedy Wiki została odłączona od SourceForge, Yorik zainstalował MediaWiki's Translation extension, które ułatwia tłumaczenie stron. Zaletą rozszerzenia tłumaczeń jest to, że tytuł strony może być teraz przetłumaczony, śledzi tłumaczenia, powiadamia, czy oryginalna strona została zaktualizowana, oraz utrzymuje tłumaczenia w synchronizacji z oryginalną stroną angielską.

Narzędzie jest udokumentowane w Pomoc:Rozszerzenia:Tłumaczenie i jest częścią MediaWiki Pakietu rozszerzeń językowych.

Aby szybko rozpocząć przygotowywanie strony do tłumaczenia, proszę przeczytać przykład Tłumaczenie strony. Zasadniczo, para znaczników <translate> ... </translate> musi otaczać całą stronę, aby aktywować system tłumaczenia, a strona musi być oznaczona do tłumaczenia.

Aby zobaczyć przykładowy sposób działania narzędzia do tłumaczenia, odwiedź stronę Strona główna. Na górze pojawi się automatycznie wygenerowany pasek językowy. Kliknij na Hauptseite. (niemiecki), doprowadzi cię do Main Page/de. Tuż pod tytułem, możesz przeczytać Ta strona jest przetłumaczoną wersją strony głównej, a tłumaczenie jest w XX% kompletne, XX jest bieżącą wartością procentową postępu tłumaczenia. Kliknij na Tłumacz u góry strony, aby uruchomić narzędzie do aktualizacji, korekty i przeglądania istniejącego tłumaczenia.

Jeśli przejdziesz do strony Main Page/de, zauważysz, że nie możesz już edytować strony bezpośrednio, przez kliknięcie znacznika [Edit], a górny link Edit został zastąpiony linkiem Translate, który otwiera narzędzie do tłumaczenia.

Przy dodawaniu nowych treści należy najpierw utworzyć stronę w języku angielskim, a następnie przetłumaczyć ją na inny język. Jeśli ktoś chce zmienić lub dodać treść na stronie, najpierw należy zmodyfikować stronę w języku angielskim.

Jeśli nie jesteś pewien, jak postępować z tłumaczeniami, nie wahaj się poprosić o pomoc w Development → Wiki subforum lub w podforum konkretnego języka na forum FreeCAD.

Istotne uwagi

Każdy użytkownik wiki posiadający uprawnienia Edytora jest w stanie uruchomić narzędzie do tłumaczenia oraz tworzyć, zapisywać i przeglądać tłumaczenia.

Jednak tylko użytkownicy z uprawnieniami Administrator mogą oznaczać strony do tłumaczenia. Strona, która nie jest oznaczona do tłumaczenia, nie będzie korzystać z rozszerzenia tłumaczenia i nie będzie prawidłowo zsynchronizowana z informacjami w języku angielskim.

Lewy pasek boczny jest również przetłumaczalny, ale tylko Administratorzy mogą modyfikować ten element strony. Proszę postępować zgodnie z dedykowanymi instrukcjami na stronie Tłumaczenie paska Sidebar.

Przy pierwszym przełączeniu strony do nowego systemu tłumaczeń, traci ona wszystkie swoje stare "ręczne" tłumaczenia. Aby odzyskać tłumaczenie, należy zapisać kopię starego tekstu w trybie offline przed przełączeniem. Następnie możesz użyć tego starego przetłumaczonego tekstu do wypełnienia jednostek tłumaczeń w nowym systemie. Możesz również otworzyć wcześniejszą wersję z historii i w ten sposób odzyskać stary tekst. Musi to być zrobione dla każdego języka, który miał przetłumaczoną stronę.

Tłumaczenie dokumentacji FreeCAD

Zgodnie z ogólnym konsensusem, strona referencyjna w Wiki jest stroną angielską, która powinna być utworzona jako pierwsza. Jeśli chcesz zmienić lub dodać treść do strony, powinieneś zrobić to najpierw na angielskiej stronie, a dopiero po zakończeniu aktualizacji przenieść modyfikację na przetłumaczoną stronę.

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 .

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