Localisation/sv: Difference between revisions

From FreeCAD Documentation
(Created page with "=== Hur man namnger sidor ===")
(Updating to match new version of source page)
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
{{docnav|Branding|Extra python modules}}

<div class="mw-translate-fuzzy">
'''Lokalisering''' är i allmänhet den process som ger användargränssnittet i ett program flera språk. I FreeCAD så kan du ställa in användargränssnittets språk under ''Redigera?Alternativ?Allmänt''. FreeCAD använder [[http://sv.wikipedia.org/wiki/Qt Qt]] för att aktivera flerspråkssupport. På Unix/Linux system så använder FreeCAD som standard de gällande locale-inställningarna för systemet.
'''Lokalisering''' är i allmänhet den process som ger användargränssnittet i ett program flera språk. I FreeCAD så kan du ställa in användargränssnittets språk under ''Redigera?Alternativ?Allmänt''. FreeCAD använder [[http://sv.wikipedia.org/wiki/Qt Qt]] för att aktivera flerspråkssupport. På Unix/Linux system så använder FreeCAD som standard de gällande locale-inställningarna för systemet.
</div>


== Hjälpa till med att översätta FreeCAD ==
== Hjälpa till med att översätta FreeCAD ==


<div class="mw-translate-fuzzy">
En av de mycket viktiga saker du kan göra för FreeCAD, om du inte är en programmerare, är att hjälpa till att översätta programmet till ditt språk. Det är nu lättare än någonsin att göra det då vi nu använder oss av [http://crowdin.net Crowdin] online översättningssystemet där man kan samarbeta med flera personer
En av de mycket viktiga saker du kan göra för FreeCAD, om du inte är en programmerare, är att hjälpa till att översätta programmet till ditt språk. Det är nu lättare än någonsin att göra det då vi nu använder oss av [http://crowdin.net Crowdin] online översättningssystemet där man kan samarbeta med flera personer
</div>


<div class="mw-translate-fuzzy">
=== Hur man översätter ===
=== Hur man översätter ===
</div>


<div class="mw-translate-fuzzy">
* Gå till [http://crowdin.net/project/freecad FreeCADs projektsida för översättning på Crowdin];
* Gå till [http://crowdin.net/project/freecad FreeCADs projektsida för översättning på Crowdin];
* Logga in genom att skapa en ny profil, eller genom att använda ett tredjepartskonto som t.ex din Gmail adress;
* Logga in genom att skapa en ny profil, eller genom att använda ett tredjepartskonto som t.ex din Gmail adress;
Line 12: Line 22:
* Börja översätt genom att klicka på Translate knappen intill en av filerna. ''FreeCAD.ts'' innehåller till exempel textsträngarna för FreeCADs huvudgränssnitt.
* Börja översätt genom att klicka på Translate knappen intill en av filerna. ''FreeCAD.ts'' innehåller till exempel textsträngarna för FreeCADs huvudgränssnitt.
* Du kan rösta på existerande översättningar, eller så kan du skapa dina egna.
* Du kan rösta på existerande översättningar, eller så kan du skapa dina egna.
</div>


<div class="mw-translate-fuzzy">
'''Notera''': Om du deltar aktivt i översättningen av FreeCAD och vill bli
'''Notera''': Om du deltar aktivt i översättningen av FreeCAD och vill bli
informerad innan nästa utgåva är klar att släppas,
informerad innan nästa utgåva är klar att släppas,
so du får tid att granska din översättning, så prenumerera på
so du får tid att granska din översättning, så prenumerera på
denna punkt: http://www.freecadweb.org/tracker/view.php?id=137
denna punkt: http://www.freecadweb.org/tracker/view.php?id=137
</div>


<div class="mw-translate-fuzzy">
== Översätta wikin ==
</div>


This wiki hosts 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]].
=== Översätta med Qt-Linguist (det gamla sättet) ===


To translate the wiki, you must have wiki edit permissions; see [[FAQ#How can I get edit permission on the wiki?|How can I get edit permission on the wiki?]].
Följande information behöver inte användas längre och kommer troligen att bli föråldrad. Det behålls här så att programmerare kan studera hur det fungerar.


You should also have enough knowledge of wiki markup and follow the general styling guidelines described on [[WikiPages]].
* Öppna alla FreeCADs språkmappar som visas nedan
* Verifiera att en .ts fil med din språkkod inte finns ("fr" för franska, "de" för tyska, "se" för svenska, etc...)
* Om den finns, så kan du ladda ned den filen, om du vill ändra/granska/förbättra översättningen (klicka på filen, ladda sedan ned)
* Om den inte finns, ladda ned den .ts fil utan språkkod (eller någon annan .ts med språkkod, kommer också att fungera)
* Döp om filen med din språkkod
* Öppna den med Qt-Linguist programmet
* Börja översätt (Qt Linguist är mycket lättanvänt)
* När du är klar, spara din fil
* [http://www.freecadweb.org/tracker/main_page.php skicka filerna till oss] så vi kan inkludera dem i FreeCADs källkod så andra får glädje av dem.


=== Mediawiki Translation Extension===
=== Tillgängliga översättningsfiler ===


When the wiki moved away from SourceForge, [[User:Yorik|Yorik]] installed [http://www.mediawiki.org/wiki/Help:Extension:Translate MediaWiki's Translation extension] which facilitates translating pages. Advantages of the translation extension are that the page title can now be translated, it keeps track of translations, it notifies if the original page has been updated, and it maintains translations in sync with the original English page.
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Gui/Language/ FreeCAD main GUI]
* [http://free-cad.svn.sourceforge.net/viewvc/free-cad/trunk/src/Mod/Complete/Gui/Resources/translations/ Complete Workbench]
* [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]


The tool is documented in [http://www.mediawiki.org/wiki/Help:Extension:Translate Help:Extension:Translate], and is part of [http://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle MediaWiki Language Extension Bundle].
== Förbereda dina egna moduler/applikationer för översättning ==


To quickly get started on preparing a page for translation, please read the [http://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example Page translation example]. Essentially, a pair of {{incode|<nowiki><translate> ... </translate></nowiki>}} tags need to surround the entire page to activate the translation system, and the page needs to be marked for translation.
=== Förkrav ===


To see an example of how the translation tool works, visit the [[Main Page]]. You will see an automatically generated language bar at the top. Click on [[Main Page/de|Hauptseite]] (German), it will get you to [[Main Page/de]]. Right under the title, you can read <small>{{Emphasis|This page is a translated version of the page Main Page and the translation is XX% complete}}</small>, XX being the current percentage of translation. Click on "Translate" at the top of the page to start the translation utility to update, correct and review the existing translation.
För att lokalisera din applikationsmodul så behöver du de hjälpare som kommer tillsammans med ''Qt''. Du kan ladda ned dem från [http://www.trolltech.com/products/qt/downloads Trolltech-Webbplatsen], men de finns också i [[Third Party Libraries/sv|LibPack]]:


If you go to [[Main Page/de]], you will notice that you cannot edit the page directly anymore by clicking the [Edit] tags, and the top link "Edit" has been substituted by the "Translate" link that opens the translation utility.
;qmake: Genererar projektfiler
;lupdate: Extraherar eller uppdaterar originaltexterna i ditt projekt genom att skanna källkoden
;Qt-Linguist: ''Qt-Linguist'' är mycket enkelt att använda och hjälper dig att översätta med fina egenskaper som en frasbok för vanliga ord/meningar.


When adding new content, the English page should be created first, then translated into another language. If someone wants to change or add content in a page, the English page should be modified first.
=== Inställning av Projekt ===


<div class="mw-translate-fuzzy">
För att påbörja lokaliseringen av ditt projekt, gå till GUI-delen av din modul och skriv följande på kommandoraden:
Om du är osäker på hur du ska fortsätta, tveka inte att be om hjälp på [http://forum.freecadweb.org/ forumet].
<pre>
</div>
qmake -project
</pre>
Detta skannar din projektkatalog efter filer som innehåller textsträngar och skapar en projektfil som i följande exempel:
<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>


===Important notes===
Du kan lägga till filer manuellt här. Avsnittet <tt>TRANSLATIONS</tt> innehåller en lista med filer med översättningen för varje språk. I ovanstående exempel så är ''MyMod_de.ts'' den tyska översättningen.


Every wiki user that has "Editor" permissions is able to launch the translate utility and write, save, and review translations.
Nu behöver du köra <tt>lupdate</tt> för att plocka ut alla textsträngar i ditt gränssnitt. Genmóm att köra <tt>lupdate</tt> efter ändringar i källkoden är alltid säkert eftersom den aldrig raderar strängar från dina översättningsfiler. Den lägger endast till nya strängar.


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.
Nu behöver du lägga till <tt>.ts</tt>-filerna till ditt VisualStudio projekt. Specificera följande anpassade byggmetod för dem:
<syntaxhighlight>
python ..\..\..\Tools\qembed.py "$(InputDir)\$(InputName).ts"
"$(InputDir)\$(InputName).h" "$(InputName)"
</syntaxhighlight>
Notera: skriv detta i en enda kommandorad, radbrytningen är endast för utseendet här.


The left sidebar is also translatable, but only Administrators can modify this element of the site. Please follow the dedicated instructions on [[Localisation Sidebar]].
Genom att kompilera <tt>.ts</tt>-filen i ovanstående exempel, så skapas headerfilen ''MyMod_de.h'' . Bästa platsen att inkludera denna är i ''App<Modul>Gui.cpp''. I vårt exempel så skulle det vara ''AppMyModGui.cpp''. Där lägger du till raden
<syntaxhighlight>
new Gui::LanguageProducer("Deutsch", <Modul>_de_h_data, <Modul>_de_h_len);
</syntaxhighlight>
för att publicera din översättning i applikationen.


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.
=== Ställa in pythonfiler för översättning ===


=== Translate the FreeCAD documentation ===
För att förenkla lokalisering av py filer så kan du använda verktyget "pylupdate4" vilket accepterar en eller fler py filer. Med alternativet -ts så kan du förbereda/uppdatera en eller fler .ts filer. För att till exempel förbereda en .ts fil för Franska, skriv i kommandoraden:
<pre>
pylupdate4 *.py -ts YourModule_fr.ts
</pre>
pylupdate verktyget kommer att skanna dina .py filer för translate() eller tr() funktioner och skapa en YourModule_fr.ts fil. Den filen kan sedan översättas med Qt-Linguist och en YourModule_fr.qm fil producerad från Qt-Linguist eller mad kommandot
<pre>
lrelease YourModule_fr.ts
</pre>
Var uppmärksam på att verktyget pylupdate4 inte är speciellt bra på att känna igen translate() funktioner, de måste formatteras mycket specifikt ( se Ritmodul filerna för exempel). Inuti din fil, så kan du ställa in en översättare som denna (efter att du har laddat din QApplication men INNAN du skapar några qt widgetar):
<pre>
translator = QtCore.QTranslator()
translator.load("YourModule_"+languages[ln])
QtGui.QApplication.installTranslator(translator)
</pre>
Alternativt, så kan du även skapa filen XML Draft.qrc med detta innehåll:
<pre>
<RCC>
<qresource prefix="/translations" >
<file>Draft_fr.qm</file>
</qresource>
</RCC>
</pre>
och genom att köra pyrcc4 Draft.qrc -o qrc_Draft.py så skapas en stor Python som innehåller alla resurser. Detta sätt fungerar också för att lägga alla ikonfiler i en resursfil


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.
== Översätta wikin ==


===Old translation instructions===
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]].


{| class="mw-collapsible mw-collapsed wikitable"
===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 />
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 ==
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.
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 ==
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].
This section is for developers who want to add localisation to their code.


<div class="mw-translate-fuzzy">
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].
== Förbereda dina egna moduler/applikationer för översättning ==
</div>


All of the above steps are performed by the "translation scripts" which are run by an administrator periodically.
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.


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:
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.
{{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].
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.


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: 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.'''


<div class="mw-translate-fuzzy">
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]].
=== Förkrav ===
</div>


===Old translation instructions===
=== 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.
These instructions are for historical background only, while the pages are being passed to the new translation plugin.


== Automating Crowdin Translation Updates ==
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").
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 ==
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.
* [[Crowdin Administration]]
* [[Crowdin Scripts]]


{{docnav/sv|Branding/sv|Extra python modules/sv}}
You must then [[FAQ#How_can_I_get_edit_permission_on_the_wiki.3F|gain wiki edit permission]].


{{Userdocnavi}}
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'''.


<div class="mw-translate-fuzzy">
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.
[[Category:Developer Documentation/sv]]
</div>


[[Category:Wiki]]
Add a slash and your language code in the categories, like <nowiki>[[Category:Developer Documentation/fr]]</nowiki>

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.

=== Hur man namnger sidor ===

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:31, 6 October 2019

Branding
Extra python modules

Lokalisering är i allmänhet den process som ger användargränssnittet i ett program flera språk. I FreeCAD så kan du ställa in användargränssnittets språk under Redigera?Alternativ?Allmänt. FreeCAD använder [Qt] för att aktivera flerspråkssupport. På Unix/Linux system så använder FreeCAD som standard de gällande locale-inställningarna för systemet.

Hjälpa till med att översätta FreeCAD

En av de mycket viktiga saker du kan göra för FreeCAD, om du inte är en programmerare, är att hjälpa till att översätta programmet till ditt språk. Det är nu lättare än någonsin att göra det då vi nu använder oss av Crowdin online översättningssystemet där man kan samarbeta med flera personer

Hur man översätter

  • Gå till FreeCADs projektsida för översättning på Crowdin;
  • Logga in genom att skapa en ny profil, eller genom att använda ett tredjepartskonto som t.ex din Gmail adress;
  • Klicka på det språk som du vill översätta;
  • Börja översätt genom att klicka på Translate knappen intill en av filerna. FreeCAD.ts innehåller till exempel textsträngarna för FreeCADs huvudgränssnitt.
  • Du kan rösta på existerande översättningar, eller så kan du skapa dina egna.
Notera: Om du deltar aktivt i översättningen av FreeCAD och vill bli  
informerad innan nästa utgåva är klar att släppas, 
so du får tid att granska din översättning, så prenumerera på  
denna punkt: http://www.freecadweb.org/tracker/view.php?id=137

Översätta wikin

This wiki hosts 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.

To translate the wiki, you must have wiki edit permissions; see How can I get edit permission on the wiki?.

You should also have enough knowledge of wiki markup and follow the general styling guidelines described on WikiPages.

Mediawiki Translation Extension

When the wiki moved away from SourceForge, Yorik installed MediaWiki's Translation extension which facilitates translating pages. Advantages of the translation extension are that the page title can now be translated, it keeps track of translations, it notifies if the original page has been updated, and it maintains translations in sync with the original English page.

The tool is documented in Help:Extension:Translate, and is part of MediaWiki Language Extension Bundle.

To quickly get started on preparing a page for translation, please read the Page translation example. Essentially, a pair of <translate> ... </translate> tags need to surround the entire page to activate the translation system, and the page needs to be marked for translation.

To see an example of how the translation tool works, visit the Main Page. You will see an automatically generated language bar at the top. Click on Hauptseite (German), it will get you to Main Page/de. Right under the title, you can read This page is a translated version of the page Main Page and the translation is XX% complete, XX being the current percentage of translation. Click on "Translate" at the top of the page to start the translation utility to update, correct and review the existing translation.

If you go to Main Page/de, you will notice that you cannot edit the page directly anymore by clicking the [Edit] tags, and the top link "Edit" has been substituted by the "Translate" link that opens the translation utility.

When adding new content, the English page should be created first, then translated into another language. If someone wants to change or add content in a page, the English page should be modified first.

Om du är osäker på hur du ska fortsätta, tveka inte att be om hjälp på forumet.

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.

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.

Förbereda dina egna moduler/applikationer för översättning

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.

Förkrav

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/sv
Extra python modules/sv