Localisation/sv: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
{{docnav|Branding|Extra python modules}} |
{{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 == |
||
Line 45: | Line 47: | ||
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]. |
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]. |
||
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 <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. |
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. |
||
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 |
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. |
||
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. |
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. |
||
Line 66: | Line 68: | ||
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. |
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. |
||
⚫ | |||
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=== |
||
Line 96: | Line 102: | ||
== Translate the FreeCAD website == |
== Translate the FreeCAD website == |
||
Translation of the FreeCAD website is now done through [https://crowdin.com/translate/freecad/561/en-en Crowdin]. The file is named |
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 == |
== Development - How to Add Localisation == |
||
Line 109: | Line 113: | ||
All of the above steps are performed by the "translation scripts" which are run by an administrator periodically. |
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. |
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}} |
{{Code|code=lupdate -ts myModule.ts}} |
||
Revision as of 19:31, 6 October 2019
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").
Page Naming Convention
#REDIRECT [[About_FreeCAD/fr]]
{{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
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub