From Fedora Project Wiki
No edit summary
 
(18 intermediate revisions by 3 users not shown)
Line 2: Line 2:


= Fedora 本地化工作指南(新的) =
= Fedora 本地化工作指南(新的) =
{{admon/important|重要说明|Zanta 已经被弃用,此文档仅用于存档之用}}
== 愿景 ==
== 愿景 ==
这个页面,描述了如何加入L10N本地化团队。作为一个新的翻译者,应该如何在Zanta上翻译。
这个页面,描述了如何加入L10N本地化团队。作为一个新的翻译者,应该如何在Zanta上翻译。
Line 7: Line 10:
= 如何成为一个Fedora翻译者 =
= 如何成为一个Fedora翻译者 =
L10n项目显然不仅仅是为了翻译。不过,翻译却不妨成为一个不错的门槛来迈入本地化团队,下面是使您成为翻译者的一些基本步骤:
L10n项目显然不仅仅是为了翻译。不过,翻译却不妨成为一个不错的门槛来迈入本地化团队,下面是使您成为翻译者的一些基本步骤:
#[https://fedoraproject.org/wiki/L10N/Translate_on_Zanata#创建一个FAS账户 创建一个FAS账户]
# [[#Create_a_Fedora_account| 创建一个FAS账户 ]]
#[https://fedoraproject.org/wiki/L10N/Translate_on_Zanata#加入邮件列表 加入邮件列表]
# [[#Subscribe_to_the_Mailing_Lists| 订阅并加入邮件列表]]
#[https://fedoraproject.org/wiki/L10N/Translate_on_Zanata#介绍你自己 介绍你自己](您可以在您加入的邮件列表中做这个,并且创建Wiki中的User页面)
# [[#Introduce_Yourself| 自我介绍]] (It's a good idea to do it on all mailing list you have subscribed)
#[https://fedoraproject.org/wiki/L10N/Translate_on_Zanata#使用您的FAS账户登录Zanta 使用您的FAS账户登录Zanta]
# [[#Login_to_Zanata_with_your_FAS_account| 使用你的FAS账户登录Zanta]]
#[https://fedoraproject.org/wiki/L10N/Translate_on_Zanata#Find_your_language_team_and_join_in Find your language team and join in]
# [[#Find_your_language_team_and_join_in| 寻找适合于您的语言团队并加入]]
 
你的自我介绍很重要。 它有机会提高你的操作权限。 你可能还想[https://fedoraproject.org/wiki/L10N/Guide#How-to_create_a_Bugzilla_account 创建一个Bugzilla帐户]来处理用户反映的错误。


Your self-introduction is important. It raises your chances to be approved for write access. You may also want to [https://fedoraproject.org/wiki/L10N/Guide#How-to_create_a_Bugzilla_account create a Bugzilla account] to work on bugs reported by users.
{{Anchor|Create_a_Fedora_account}}
== 创建一个FAS账户 ==
# 打开 https://admin.fedoraproject.org/accounts 并点击“New Account(新建账号)”链接。
# 填写所有项,然后单击“Sign up(注册)”。 密码将通过电子邮件发送给你,你可以稍后更改密码。
# 现在再次访问 https://admin.fedoraproject.org/accounts 并用你的密码登录。
# 帐户系统会提醒你CLA未完成。


== Create a Fedora account ==
=== 签署CLA ===
# Open https://admin.fedoraproject.org/accounts and click the New Account link.
# Fill in each required parts and click Sign up. A password will be emailed to you, and you can change it later.
# Now visit https://admin.fedoraproject.org/accounts again and log in with your password.
# The account system will remind you that CLA is not completed.


=== Signing the CLA ===
要开始翻译前,你必须完成贡献者许可协议或CLA。


To begin translation, you must complete the Contributors License Agreement, or CLA.
# 访问 https://admin.fedoraproject.org/accounts 并用你在上一过程中获得的用户名和密码登录你的帐户。
# 在欢迎页面中,单击完成CLA或转到https://admin.fedoraproject.org/accounts/user/edit。
# 如果你尚未提供电话号码和地址的信息,将出现编辑帐户(user_name)页面,你需要填写每一项。否则将显示"Fedora Contributor License Agreement"页面。仔细阅读协议,如果你愿意,请点击我同意。
# 现在点击“保存”! 在页面底部保存你的信息。
# 出现用户视图页面,CLA项:显示为“CLA 已验证”。


# Visit https://admin.fedoraproject.org/accounts and login your account using your user name and password obtained from the previous process.
{{admon/note|注意 | 除管理员组外,其他人无法访问电话号码和地址信息。  请参阅 https://fedoraproject.org/wiki/Legal:PrivacyPolicy 上的Fedora隐私政策。 其他任何成员都可以通过访问用户的视图页面显示其他信息。}}
# In the Welcome page, click complete the CLA or go to https://admin.fedoraproject.org/accounts/user/edit.
# If the information of telephone number and postal address have not been provided yet, the Edit Account (user_name) page will be appeared and you need to fill in each of them. Otherwise Fedora Contributor License Agreement page will be displayed. Read through the agreement carefully and click I agree if you are happy to do so.
# Now click Save! located at the bottom of this page to save your information.
# The user-view page is appeared and shows the CLA: field as CLA Done.


{{admon/note|Note | Telephone Number and Postal Address information is NOT accessible by others except admin groups. Please refer to Fedora Privacy Policy at https://fedoraproject.org/wiki/Legal:PrivacyPolicy. Other fields will be displayed by any other member by visiting the user's view page.}}
{{admon/tip|有关FAS的更多信息| 有关Fedora帐户系统的更多详细信息,请参阅 https://fedoraproject.org/wiki/Account_System }}
{{admon/tip|More about FAS| You can visit https://fedoraproject.org/wiki/Account_System for more details about Fedora account system.}}


== Subscribe to the Mailing Lists ==
{{Anchor|Subscribe_to_the_Mailing_Lists}}
=== Main L10n mailing list ===
== 加入邮件列表 ==
{{admon/note| Note | Use English on this mailing list}}
=== L10n 邮件列表 ===
# Visit [https://lists.fedoraproject.org/mailman/listinfo/trans trans] mailing list subscribe page and subscribe it.
{{admon/note| 注意 | 在此邮件列表中使用英语}}
# You won't be able to send message to the list until you are approved by the admin of the mailing list. You will receive a confirmation email which contains a link to confirm your subscription. Click the link to confirm your subscription.
# 访问[https://lists.fedoraproject.org/mailman/listinfo/trans trans]邮件列表订阅页面并订阅它。
# 在管理员批准之前,你将无法向列表发送邮件。 你将收到一封确认电子邮件,其中包含确认订阅的链接。 单击链接以确认。


=== Your team mailing list ===
=== 你的team(团队)邮件列表 ===
{{admon/note| Note | Use your mother language is better on this mailing list}}
{{admon/note| 注意 | 在这个邮件列表中使用你的母语更好}}
# Visit https://fedoraproject.org/wiki/L10N/Teams and find your language team(s)
# 访问 https://fedoraproject.org/wiki/L10N/Teams 并找到你的语言团队。
# Subscribe the mailing list(s) for your language(s)
# 订阅你的语言的邮件列表


{{admon/important|Mailing list guidelines| You are recommended to read this [https://fedoraproject.org/wiki/Mailing_list_guidelines guidelines] before you post messages to a mailing list.}}
{{admon/important|邮件列表指南| 在发送消息到邮件列表之前,建议你阅读[https://fedoraproject.org/wiki/Mailing_list_guidelines 此指南]}}


== Introduce Yourself ==
{{Anchor|Introduce_Yourself}}
# Create a personal page at https://fedoraproject.org/wiki/User:Username.
== 介绍你自己 ==
# Make a short self-introduction to the mailing lists you have subscribed. If you don't know what to introduce, here is a template: https://fedoraproject.org/wiki/L10N_Self_introduction.
# https://fedoraproject.org/wiki/User:Username 创建个人页面(可选).
# 对你订阅的邮件列表进行简短的自我介绍。 如果你不知道要介绍什么,这里有一个模板:https://fedoraproject.org/wiki/L10N_Self_introduction。


The above two steps are very useful for Fedora contributors get to know and contact each other. The second step also helps your language coordinator to identify you and approve you as a translator of the team.
以上两个步骤对于Fedora贡献者相互了解和联系非常有用。 第二步还可以帮助你的语言管理员(协调员)认识你并批准你作为团队的翻译。


== Login to Zanata with your FAS account ==
{{Anchor|Login_to_Zanata_with_your_FAS_account}}
* Open https://fedora.zanata.org/ and click the blue 'Log In' button on the top-right of the page.  
== 使用您的FAS账户登录Zanta ==
* 打开 [https://fedora.zanata.org/ https://fedora.zanata.org/ ],然后单击页面右上角的蓝色“Log In(登录)”按钮。
[[File:zanata_login.png |600px]]
[[File:zanata_login.png |600px]]
* Then it will guides you to FedOAuth page in which you can Login with your FAS account and password you have registered in last section.
* 然后它将跳转到FedOAuth页面,你可以使用你在上一节中注册的FAS帐户和密码登录。
[[File:Fedoauth.png|600px]]
[[File:Fedoauth.png|600px]]
* Then you will be directed to a authentication page, click 'Approve'.
* 然后,你将被重定向到认证页面,单击“Approve(批准)”。
[[File:fas_approve.png|600px]]
[[File:fas_approve.png|600px]]
* A 'new user' page will be opened.
* “new user(新用户)”页面会打开。
You should enter your full name, username(FAS username) and your email address. Note: Please use your true email address but not your Fedora project alias(username@fedoraproject.org). When you finish them, click the Save button. A activation email will be sent immediately to your email address. Please find the mail in your inbox and open the  activation link that is provided in the mail. Then login with your FAS username and password. You won't need to follow this step again when you login next time. It's only necessary for new user login.
 
你应输入你的全名,用户名(FAS用户名)和你的电子邮件地址。 注意:请使用你的真实电子邮件地址,但不要使用你的Fedora项目别名(username@fedoraproject.org)。 完成后,单击“Save(保存)”按钮。 激活邮件将立即发送到你的邮件地址。 请在收件箱中找到邮件,然后打开邮件中显示的激活链接。 然后使用你的FAS用户名和密码登录。 下次登录时,你无需再次执行此步骤。 它只对新用户登录时是必要的。
 
{{Anchor|Find_your_language_team_and_join_in}}


== Find your language team and join in ==
== 寻找适合于你的语言团队并加入 ==
* Click Languages at the top of https://fedora.zanata.org, then you will see all the available languages.
*访问https://fedora.zanata.org并点击顶部的语言,然后你将看到所有可用的语言(已过期需要登陆后才可查看)。
[[File:Zanata_Languages.png |600px]]
[[File:Zanata_Languages.png |600px]]
* Find the language you want to translate and click the language code.
* 找到你要翻译的语言,然后单击语言编号。
* Click the blue button Request To Join Team on the left side of the page.
* 单击页面左侧的蓝色按钮申请加入团队。
[[File:Zanata_join_team.png |600px]]
[[File:Zanata_join_team.png |600px]]
* You should choose the role(s) you want to be and click Send Message. Additional message is optional. Here I use Afrikaans as example in screenshot below.
* 你可以选择你想要的角色,然后单击“Send Message(发送消息)”。 附加消息是可选的。 例子中,我使用南非荷兰语作为下面的截图。
[[File:Zanata_join.png | 600px]]
[[File:Zanata_join.png | 600px]]
* The team coordinator will receive a email notification about your request. You will be the team member as long as he/she approves your request. However, the coordinator may not approve each of your role request. In other words, if you request to be Translator, Reviewer and Coordinator, he/she may only approve you as a translator.
* 团队管理员(协调员)将收到有关你请求的电子邮件通知。 只要他/她批准你的请求,你将成为团队成员。 但是,管理员(协调员)可能不会批准你的每个角色请求。 换句话说,如果你要求成为翻译,审稿人和协调员,他/她可能只会批准你担任翻译角色。


= Translating =
= Translating =


== Translating online on Zanata ==
== 使用Zanata在线翻译==
 
 
 
 
 
 
 


'''Finding your project'''
'''寻找你的项目'''


----
----


在Zanata上有三种查找翻译文件的方法:


'''方法一''' : 项目搜索


There are three ways of finding your translation files on Zanata:
如果你知道翻译项目的标题,可以通过项目搜索框查找它
 
 
'''Option 1''' : Project search
 
If you know the title of your translation project, you can look for it thanks to the project search box


[[File:search projects.png|600px]]
[[File:search projects.png|600px]]


then select the appropriate project to see the available versions for translation.
然后选择合适的项目来查看可用的翻译版本。


[[File:versions.png|600px]]
[[File:versions.png|600px]]


'''方法二''' : 项目主页


'''Option 2''' : Projects Page
单击位于页面顶部的“Projects(项目)”链接,访问“Projects(项目)”页面上的所有项目。 通过单击列表字段名中的箭头,可以按名称,创建日期或当前活动状态对项目表进行排序。
 
Click on the “Projects” link located at the top of the page to access all projects on the Projects page. The table of projects can be sorted by name, creation date or current activity status by clicking the arrows in the table headings.


[[File:projects.png|600px]]
[[File:projects.png|600px]]


Click the name of a project to see the available versions for translation.
单击项目名称以查看可用于翻译的版本。


'''方法三''' : 用户仪表盘(控制台)


'''Option 3''' : User Dashboard
你也可以从用户仪表盘(控制台)访问你的翻译项目。
 
Your translation project can also be accessed from the User Dashboard.


[[File:dashboard2.png|200px]]
[[File:dashboard2.png|200px]]


The section “Activity” lists all your latest translations. If looking for a recently translated project, look for the name of the project through that list of messages. You can access a string, a document, a version or a whole project by clicking the relevant links in the message.
“Activity(活动)”部分列出了你的所有最新翻译。 如果要查找最近翻译的项目,请通过该列表信息查找项目的名称。 你可以通过单击列表信息中的相关链接文字来访问,文档信息,版本信息或整个项目。


[[File:Your activity.png|600px]]
[[File:Your activity.png|600px]]


 
'''开始翻译'''
'''Translating'''


----
----


 
找到并选择项目后,将打开以下编辑器:
After finding and selecting your project, the following editor will open:


[[File:Editor.png|800px]]
[[File:Editor.png|800px]]


1. Search
1. Search(搜索 )


Search strings by either typing a term directly in the box or by selecting a filter and entering a value by which you wish to filter the strings. For example, if you wish to display only the strings modified by yourself, select "last-modified-by" and enter your username.
直接在搜索框中输入相关名称或选择筛选来进行搜索。 例如,如果你只想显示自己修改的字符串,请选择“last-modified-by”并输入你的用户名。


[[File:filter terms.png|600px]]
[[File:filter terms.png|600px]]


2. String details(文字简介)


2. String details
允许你查看特定源文本的详细信息,包括注释。
 
Allows you to view the details of a specific source text, including comments.


3. Filtering
3. Filtering(筛选)


The strings can be filtered by state: Incomplete, Complete and Invalid (containing a warning or error).
字符串可以按状态筛选:Incomplete, Complete and Invalid(未完成,完成和无效)(包含警告或错误)。
For example, to display all Untranslated (empty), Fuzzy (draft) and Rejected strings, check the Incomplete box.
例如,要显示所有未翻译(未完成),草稿和无效的字符,请选中“Incomplete(未完成)”框。
To display only a specific type of Incomplete strings, check the corresponding box, e.g. Fuzzy.
仅显示特定类型的未完成符串,请选中相应的框,例如 Fuzzy(草稿)。


[[File:Incomplete2.png|600px]]
[[File:Incomplete2.png|600px]]




4. Copy message from source language
4. Copy message from source language(从源语言复制消息)


This function is useful when the source text contains tags, numbers or product names that should remain the same in the target language.
当源文本包含标签,数字或产品名称时应与需要翻译的语言保持一致,此功能非常有用。


5. Profile icon
5. Profile icon(个人资料图标)


Click on this icon to log out or access your dashboard.
单击此图标可注销或访问仪表盘。
The top right of the dashboard displays the number of words/messages/documents translated for the current day/week/month.
仪表盘的右上角显示当前日//月翻译的单词/消息/文档的数量。
The bottom part of the dashboard displays your Activity, i.e when and in which file you translated last
仪表盘的底部显示你的活动状态,即你最后翻译的文件的时间和位置。


6. Document list
6. Document list(文档列表)


Click to go back to the list of documents for this project
单击返回此项目的文档列表


7. Editor
7. Editor(编辑器)


This button allows you to revert to the editor from any other page you are in, e.g. from the Project-wide Search & Replace page.
This button allows you to revert to the editor from any other page you are in, e.g. from the Project-wide Search & Replace page.


8. Project-wide Search & Replace
8. Project-wide Search & Replace(整个项目的搜索与替换)


Use this option to search and replace specific terms or phrases throughout the whole file.
使用此选项可搜索并替换整个文件中的具体词或短句。
To do so:
操作如下:
Enter a term in the search box, set the search filter “search target”, and check the “Case sensitive” case if applicable.
在搜索框中输入一个词,设置搜索筛选“search target(搜索目标)”,并检查“Case sensitive(区分大小写)”的情况(如果适用)。
In the second text box, enter the term you would like to use instead. Then either check “Select all” or select the string(s) you would like to apply this change to and click “Replace” to apply your changes.
在第二个文本框中,输入你要使用的词语。 然后选中“Select all(全选)”或选择要应用此更改的文字,然后单击“Replace(替换)”更改。


9. Available Keyboard Shortcuts
9. Available Keyboard Shortcuts(键盘快捷键)


From the text editor page, click this button to view a list of all the shortcuts available.
在文本编辑器页面中,单击此按钮可查看所有可用快捷键的列表。


10. Notification
10. Notification(通知)


Click on this button to view the latest notifications, including the date, row number, id number of each modified string.
单击此按钮可查看最新通知,包括每个已修改文字的日期,行号,ID号。


11. Chat room
11. Chat room(群聊)


Use this function to interact with other translators
使用此功能可与其他翻译人员进行交流


12. Options
12. Options(设置)


This function allows you to modify a few options in order to customize your translating experience.
此功能允许你修改自定义修改默认选项。
For example, check the “Enter key saves immediately” box to use the Enter key to save strings.
例如,选中“Enter key saves immediately(立即输入密钥保存)”框以使用Enter键保存字符串。


[[File:Options.png|300px]]
[[File:Options.png|300px]]




13. Validation options
13. Validation options(验证设置)
 
This page allows you to select different validation options:
 
- HTML/XML tags: check that html/xml tags are consistence between the source and target text.
 
- Java variables: check that java style ({x}) variables are consistent.


- Leading/trailing newline (\n): check for consistent leading and trailing newline (\n).
此页面允许你选择不同的验证设置:


- Positional printf (XSI extension): check that positional printf style (%n$x) variables are consistent.
- HTML/XML tags:html/xml标签是检查源文本和目标文本之间是否一致。


- Printf variables: check that printf style (%x) variables are consistent.
- Java variables:检查 java style ({x}) 变量是否一致.


- Tab characters (\t): check whether source and target have the same number of tabs.
- Leading/trailing newline (\n)(行首、行尾的换行符): 检查行首和行尾随换行符是否一致 (\n).


- XML entity reference: check that XML entity are complete.
- Positional printf (XSI extension): 检查位于printf style (%n$x) 变量是否一致.


- Tab characters (\t)(制表符):检查源文件与目标是否具有相同数量的制表符。


14. Save as translated
- XML entity reference: 检查整个XML的标记是否完整。


Saving can either be done by clicking on this icon, clicking inside another string or by pressing Ctrl + Enter or the Enter key only (if the box “Enter key saves immediately” is checked in the Editor options (see 10.))
14. Save as translated(保存为已翻译)


15. Save as fuzzy
保存可以通过单击此图标,或者单击旁边的文字,在或者按Ctrl + Enter或仅按Enter键(如果在编辑器选项中选中“Enter key saves immediately(立即保存输入键)”)来完成保存(参见10.)。


You can use this button to set the current string as draft and indicate it needs further work.
15. Save as fuzzy(保存为草稿)


16. Cancel
你可以使用此按钮将当前文字保存为草稿,并设置它需要进一步的工作。


Use this button if you wish to cancel your changes.
16. Cancel(取消)


17. History
如果要取消更改,请使用此按钮。


This button takes you to a Translation History page allowing you to:
17. History(历史记录)


- leave a comment
此按钮将跳转到翻译历史页面,你可以:


- view the history of the translation for this specific string, including modification dates and user names
- 发表评论


- compare different versions (simply click on “Compare” for the two strings you wish to compare and click on the “Compare vers. X and X” tab to view the comparison.
- 查看此特定文字的翻译历史记录,包括修改日期和用户名


- 比较不同的版本,只需点击“Compare(比较)”,查看你要比较的两个字符,然后单击“Compare vers. X and X”选项查看比较。


[[File:Translation history.png|600px]]
[[File:Translation history.png|600px]]


[[File:Translation history 2.png|600px]]
[[File:Translation history 2.png|600px]]


[[File:Translation history 3.png|600px]]
[[File:Translation history 3.png|600px]]


18. Translation memory(翻译历史库)


18. Translation memory
Translation Memory(TM)是一种搜索与当前所选源字符串相等(100%)或类似(<100%)的翻译的工具。
 
The Translation Memory (TM) is a tool that searches for translations that are equal (100%) or similar (<100%) to the currently selected source string.
Matches can be copied to the translation text box and used as-is or modified before saving. To copy TM matches to the selected text box, click the “Copy” button, or use Ctrl+Alt+1 to Ctrl+Alt+4 keyboard shortcuts to copy the first to fourth match in the list.
Matches can be copied to the translation text box and used as-is or modified before saving. To copy TM matches to the selected text box, click the “Copy” button, or use Ctrl+Alt+1 to Ctrl+Alt+4 keyboard shortcuts to copy the first to fourth match in the list.
You can also search the TM for other phrases by entering them in the TM text box and clicking “Search”.
你还可以通过在TM文本框中输入并单击“Search”来搜索TM以查找其它短句。


19. Glossary
19. Glossary(词汇表)


If a glossary has been uploaded for your language, each word in the currently selected row will be searched for a glossary entry.
If a glossary has been uploaded for your language, each word in the currently selected row will be searched for a glossary entry.


== Translating offline ==
== 离线翻译 ==
 
 
There are two methods that allow you to translate offline:
 


'''Method 1: Zanata-cli'''
有两种方法可以让你离线翻译:


'''方法一: Zanata-cli'''


'''1. Installing zanata-cli'''


Go to http://zanata.org/help/
'''1. 安装 zanata-cli'''


Under “Cli” - Select “Installing the client ”
访问 http://zanata.org/help/


You can install the client in two ways:
在 “Cli” - 选择 “Installing the client


你可以通过两种方式安装客户端:


* install using [[dnf|DNF]] for Fedora 22 and later versions or with [[yum|YUM]] if you are using older release by running the following command:
* 使用 [[dnf|DNF]] 安装Fedora 22及更高版本或使用 [[yum|YUM]]安装,如果你使用旧版本运行以下命令:


<pre>sudo dnf install zanata-client
<pre>sudo dnf install zanata-client
sudo yum install zanata-client</pre>
sudo yum install zanata-client</pre>


or install with Ivy:
或使用Ivy安装:


Click on the “Zanata Ivy Client on github” link
点击“Zanata Ivy Client on github(github上的Zanata Ivy客户端)” 链接


Run the appropriate command depending on the system you use (Fedora, RHEL or other systems)
根据你使用的系统(Fedora,RHEL或其他系统)运行相应的命令


Once Ivy installed, click the zanata-cli file.
安装Ivy后,单击zanata-cli文件。


[[File:zanata.cli.png | 600px]]
[[File:zanata.cli.png | 600px]]


Copy and paste the content of the executable file into your text editor and save as “zanata-cli”.
将可执行文件的内容复制并粘贴到文本编辑器中,并另存为“zanata-cli”。
 
 
2. Configuring the client
 
 
Configuring the client requires two actions:
 
 
2.1 Configuring the user:
 
 
Start by creating or opening zanata.ini in ~/.config/ with your preferred text editor.


Two steps:
2. 配置客户端


配置客户端需要两个操作:


2.1.1. Creation of an API key
2.1 配置用户:


首先在 ~/.config/  中使用首选文本编辑器创建或打开“zanata.ini”。


2个步骤:


From your Zanata account, go to your dashboard and click “Settings”.
2.1.1. 创建API密钥


在Zanata帐户中,转到信息中心,然后点击“Settings(设置)”。


[[File:Dashboard-settings.png | 600px]]
[[File:Dashboard-settings.png | 600px]]


 
然后选择客户端
Then select Client
 


[[File:Client.png | 600px]]
[[File:Client.png | 600px]]


如果你没有,请生成API密钥。


If you do not have one, generate an API key.
2.1.2. 将标记为“Configuration [zanata.ini]”的文本框的内容复制到先前创建的zanata.ini文件中并保存该文件。
 
2.1.2. Copy the contents of the text-box labeled “Configuration [zanata.ini]” into your previously created zanata.ini file and save the file.  
 
 
2.2 Configuring the project:
 
To add project-version configuration to your project directory, navigate to your translation project in Zanata, for example:


Fedora Installation Guide -  f20 - select your locale - on the upper right corner, click the arrow and select “Download config file”
2.2 配置项目:


将项目版本配置添加到项目目录,navigate to your translation project in Zanata,,例如:
Fedora安装指南 -  f20  - 选择你的语言环境 - 在右上角,单击箭头并选择“Download config file(下载配置文件)”


[[File:Download config file.png | 600px]]
[[File:Download config file.png | 600px]]


将zanata.xml文件保存在首选位置。


Save the zanata.xml file in your preferred location.
3. 将文件下载到你的计算机
 


3. Downloading the files to your machine
在命令行中运行以下命令前,make sure you are in the directory containing the zanata.xml file.


Before running the following command in your command-line, make sure you are in the directory containing the zanata.xml file.
运行:
 
Run:


<pre>zanata-cli pull -s src -t trans -l <language code> --pull-type both</pre>
<pre>zanata-cli pull -s src -t trans -l <language code> --pull-type both</pre>


The source and translated files will be created into src (source) and trans (translated) files in your directory.
源文件和已翻译文件将创建到目录中的src(源)和trans(已翻译)文件中。


You can now open your files with your preferred translation editor and translate your project.
你现在可以使用首选编辑器打开文件并翻译项目。


4. 将文件上传到Zanata


4. Uploading the files to Zanata
将已翻译的文件推送回Zanata,请运行以下命令:
 
To push the translated files back to Zanata, run the following command:


<pre>zanata-cli push -s src -t trans -l <language code> --push-type trans</pre>
<pre>zanata-cli push -s src -t trans -l <language code> --push-type trans</pre>


Your translation has now been pushed back to Zanata and the TM has been updated with your changes.
你的翻译现已被推送Zanata,并且TM已根据你的更改进行了更新。
 
 


'''Method 2: Through the User Interface
'''方法二:通过用户界面
'''
'''


Login to https://translate.zanata.org/
登陆 https://translate.zanata.org/
 
Search for your project, for example the Fedora Installation Guide.


Select your language
搜索你的项目,例如 Fedora安装指南。


To download the entire project, click on the arrow located in the top right corner of the page (next to
选择你的语言
"sort") and click "Download All (zip)".


要下载整个项目,请单击页面右上角的箭头(“sort(排序)”旁边),然后单击“Download All (zip)(全部下载)”。


[[File:Projet entier.png | 600px]]
[[File:Projet entier.png | 600px]]


 
仅下载一个文件,请单击文件名左侧的箭头,然后选择“Download Translated [.po].(下载已翻译的)”。
 
To download one file only, click on the arrow located on the left of the filename, and select "Download Translated [.po]."


[[File:Download translated.png | 600px]]
[[File:Download translated.png | 600px]]


Save the file to your preferred location.
将文件保存到首选位置。


Translate the file.
翻译文件。


Once finished, upload the file(s) back to Zanata, selecting “Upload translation”.
完成后,将文件上传到Zanata,选择“Upload translation(上传翻译)”。


Note: Although it is possible to download a whole project, the upload is only possible file by file, by clicking the arrow located on the left of the filename, and selecting “Upload translation”.
注意:虽然可以下载整个项目,但只能通过文件,通过单击文件名左侧的箭头,然后选择“Upload translation(上传翻译)”来上传。


= Proofreading =
= 校对 =
It is very difficult for translators to find a typo or minor mistake within numbers of translated strings. So proofreading is very important. General speaking, proofreading only refers to the translated strings. However PO file plays a big role through L10n and i18n workflows. So translators  should keep the PO file validate during translation process, so other translators and maintainers can use them without any problem.
相对翻译人员来说很难在翻译的文字内找到拼写错误或轻微错误。 校对非常重要。 一般来说,校对仅涉及翻译的文字内容。 然而,PO文件通过L10n和i18n工作流程发挥了重要作用。 因此,翻译人员应在翻译过程中保持PO文件的有效性,以便其他翻译和维护人员可以正确地使用它们。


== PO File Validation ==
== PO文件校对 ==
Online translation editor provided by Zanata has a validation feature to check each string. If you prefer translating online, this feature will help you much.
Zanata提供的在线翻译编辑器具有检查每个字符串的校对功能。 如果你更喜欢在线翻译,此功能对你有所帮助。
The Validation options locates at the right side of the online editor. It provides several validation options for checking.
校对选项位于在线编辑器的右侧。 它提供了几种验证方法。


[[File:Zanata_validation_options.png |600px]]
[[File:Zanata_validation_options.png |600px]]


In this example, ending tag <pre></command></pre> is written as <pre></comd></pre>, the editor raises warnings, suggests that there exists unexpected tag. When you find warnings like this during online translation, you'd better double check your translation.
在此示例中,结束标记<pre></command></pre>被写为<pre></comd></pre>,编辑器会发出警告,表示可能存在错误标签(</command>)。 当你使用在线翻译期间显示这样的警告时,最好再仔细检查你的翻译。


[[File:Zanata_proofreading_error.png |600px]]
[[File:Zanata_proofreading_error.png |600px]]


If you prefer translating offline, you should always check your file's validity before you submit.
如果你希望离线翻译,应始终在提交前检查文件的有效性。
The basic command to do this is:
执行此操作的命令是:
<pre>msgfmt -cvo /dev/null po_file_to_check.po</pre>
<pre>msgfmt -cvo /dev/null po_file_to_check.po</pre>
Make sure that there is no error message.
确保没有错误信息。
 
== 翻译校对 ==


== Translation Proofreading ==
验证工具仅用于检查与编码语言相关的东西,变量或某些内容的有效性。 你不能指望它检查你真正翻译的文字内容。
Validation tool is only useful to check the validities of tags, variables or something that is related to coding language. You can't expect it to check your real translated strings.
例如,我错误地将英文单词“He”翻译成中文“它”(右边是“他”),验证工具不会警告你存在错误。 你的目标和责任是毫无错误地进行翻译。
阅读你翻译的内容是检查错误的好习惯。


For example, I mistakenly translated English word "He" to Chinese "它"(The right one is "他"), the validation tool will not warning you that there exists mistake. It's your goal and responsibility to make the translation without mistake.
===使用自动检查排版工具 ===
Depending on your language, the verification of the compliance to some typographic rules may be difficult to do without the help of a specialized tool. This is specially the case with the various types of spaces that are not visible. A tool (which is still in an early development stage) is available and it is described in the [[L10N/Typo_Purification_of_po_Files|L10N/Typo Purification of po Files]] page.


Read the strings you have translated is a good habit for proofreading.
===创建翻译文档(书)  ===


= Testing =
为了更容易地进行校对,通常在最终的上下文中看到翻译的消息。 请参考[[L10N/how_to_build_a_translated_book_from_translated_files_on_Zanata| 如何在Zanata上的翻译文件构建翻译的文档]]。
In fact, the directory <pre>/usr/share/locale/your_LOCALE/LC_MESSAGES/</pre> is the home of most of the localised files of system components and softwares.
So generally, if you want to the test translation of a software or a system component, the simplest way is:
* Backup the original file first, <pre>sudo cp /usr/share/locale/your_LOCALE/LC_MESSAGES/example.mo /usr/share/locale/your_LOCALE/LC_MESSAGES/example.mo.old</pre>
* Put the new mo file into the directory, <pre>sudo msgfmt -o new_example.po /usr/share/locale/your_LOCALE/LC_MESSAGES/new_example.mo</pre>
* Run that  software/component/command.


(A demo is going to be made in future. An old demo is available here: https://www.youtube.com/watch?v=Hi-7QZrUR3k)
= 测试 =
事实上,<code>/usr/share/locale/your_LOCALE/LC_MESSAGES/</code> 目录是系统组件和软件的大多数本地化文件所在地。
所以一般说来,如果你想测试软件或者系统组件的翻译,最简单的方法是:
* 首先备份原始文件:<pre>sudo cp /usr/share/locale/your_LOCALE/LC_MESSAGES/example.mo /usr/share/locale/your_LOCALE/LC_MESSAGES/example.mo.old</pre>
* 将新 mo 文件放到该目录里:<pre>sudo msgfmt -o new_example.po /usr/share/locale/your_LOCALE/LC_MESSAGES/new_example.mo</pre>
* 运行要测试的软件或系统组件或命令。


Sections below introduce two more advanced methods for testing.
(我们打算做一个新的演示。[https://www.youtube.com/watch?v=Hi-7QZrUR3k 这里]有一个旧演示。)


== Using permalinks ==
下面两小节将介绍两种更高级的测试方法。
One of the benefits of using the Zanata's translation platform, it's the ability to pull a translation from a permalink and then you can install it on your system by using few commands.
 
To obtain a permalink:
== 使用固定链接 (permalinks) ==
* go to translation project
使用 Zanata 翻译平台的一大好处是能够仅用几条命令从一个固定链接拉取翻译,并安装到系统里。
* select the version, if there is more than one
 
* select the language
要获取固定链接:
* click the Documents(YOUR_LOCALE) link in navigation bar
* 访问翻译项目
* copy the permalink (.po) in actions column
* 选择目标版本,如果有若干版本的话
Once you have the permalink, you can test the translation on your system by running the following command:
* 选择语言
{{admon/note| Note | We use 'ca' as locale, and anaconda as the component for test in this example.}}
* 点击导航栏里的 Documents (YOUR_LOCALE) 链接
* 复制 actions 栏的固定链接 (.po)
有了固定链接后,你可以在你的系统上通过运行如下命令测试翻译:
{{admon/note| 提示 | 这个例子里我们 locale 选择 'ca',测试组件选择 anaconda。}}
<pre>su -c 'mv /usr/share/locale/ca/LC_MESSAGES/anaconda.mo /user/share/locale/ca/LC_MESSAGES/anaconda.mo.old; \
<pre>su -c 'mv /usr/share/locale/ca/LC_MESSAGES/anaconda.mo /user/share/locale/ca/LC_MESSAGES/anaconda.mo.old; \
msgfmt <(curl -s https://fedora.zanata.org/rest/file/translation/anaconda/f23-branch/ca/po?docId=po%2Fanaconda &> /dev/stdout)\
msgfmt <(curl -s https://fedora.zanata.org/rest/file/translation/anaconda/f23-branch/ca/po?docId=po%2Fanaconda &> /dev/stdout)\
  -o /usr/share/locale/ca/LC_MESSAGES/anaconda.mo'</pre>
  -o /usr/share/locale/ca/LC_MESSAGES/anaconda.mo'</pre>


== Build a rpm with permalinks and fedpkg ==
== 使用固定链接和 fedpkg 构建 rpm ==
Sometimes, it is not so easy to simple msgfmt the po file and we should build a rpm including the translations to test. There is an example below:
有时候不太容易 msgfmt po 文件。我们应该构建一个包含翻译的 rpm 包进行测试。下面是一个例子:


<pre>su -c ‘dnf install -y fedpkg fedora-packager rpmdevtools’
<pre>su -c ‘dnf install -y fedpkg fedora-packager rpmdevtools’
Line 461: Line 429:
diff -urN sssd-$version sssd-${version}p > my.patch</pre>
diff -urN sssd-$version sssd-${version}p > my.patch</pre>


Edit sssd.spec file for including the patch (1st. '''Patch999: my.patch''' at the top; 2nd. '''%patch999 -p1''' in the %prep section, just after '''%setup -q'''. The last step -2nd- it's not required if there is a '''for p in %patches ; do'''):
编辑 sssd.spec 文件添加补丁(首先是文件顶部的 '''Patch999: my.patch''';第二步是 %prep 小节紧随 '''%setup -q''' '''%patch999 -p1'''。如果文件里有 '''for p in %patches ; do''' 的话不需要第二步):
<pre>...
<pre>...
### Patches ###
### Patches ###
Line 475: Line 443:
</pre>
</pre>


Build & install the patched rpm:
构建并安装打了补丁的 rpm:


<pre>fedpkg local
<pre>fedpkg local
su -c 'dnf install --nogpgcheck */*.rpm'</pre>
su -c 'dnf install --nogpgcheck */*.rpm'</pre>


= Credits =
= 常见问题 (FAQ) =
 
如下是关于本地化项目的常见问题解答。
 
===应该翻译哪个分支 (branch)?===
 
* 'master' 或开发中的 Fedora 版本对应的 'Fxx' 分支是优先翻译的分支。
 
* 已发布的 Fedora 版本对应的 'Fxx' 分支最好不要翻译。很可能会浪费你的时间。因为开发者通常不会拉取翻译并重新打包已发布的版本(“不回头看”)。但是,有些维护者会支持本地化工作并自行拉取新翻译。如果有特定原因需要更新软件包(例如影响可操作性或者功能),那是值得报 bug 强迫维护者更新翻译的。
 
* 'RHEL' 分支,可以忽视,因为很可能红帽翻译者会照顾的。不过这并不意味着不要翻译。如果你愿意翻译,你的贡献总是受欢迎的。
 
= 致谢 =


The following people contributed to this guide:
如下成员贡献了本文档(的英文版):
* Julie Carbone
* Julie Carbone
* [[User:Rbuj| Robert Antoni Buj ]]
* [[User:Rbuj| Robert Antoni Buj ]]
* [[User:tiansworld| Tian Shixiong]]
* [[User:tiansworld| Tian Shixiong]]
* Noriko Mizumoto (添加了 FAQ 一节)


However some of the contents in this guide are referenced from the  [[L10N/Guide| Fedora Localization Guide for Transifex platform]] indirectly or directly, so the [[L10N/Guide#Guide_information| writers ]] should be thanked here too.
值得一提的是本文档的部分内容直接或间接源自[[L10N/Guide|旧的针对 Transifex 平台的 Fedora 本地化指南]],所以我们这里也对旧版指南的[[L10N/Guide#Guide_information|作者]]表示感谢。


[[Category:Localization]]
[[Category:Localization]]

Latest revision as of 12:59, 12 February 2021

Fedora 本地化工作指南(新的)

Important.png
重要说明
Zanta 已经被弃用,此文档仅用于存档之用

愿景

这个页面,描述了如何加入L10N本地化团队。作为一个新的翻译者,应该如何在Zanta上翻译。

如何成为一个Fedora翻译者

L10n项目显然不仅仅是为了翻译。不过,翻译却不妨成为一个不错的门槛来迈入本地化团队,下面是使您成为翻译者的一些基本步骤:

  1. 创建一个FAS账户
  2. 订阅并加入邮件列表
  3. 自我介绍 (It's a good idea to do it on all mailing list you have subscribed)
  4. 使用你的FAS账户登录Zanta
  5. 寻找适合于您的语言团队并加入

你的自我介绍很重要。 它有机会提高你的操作权限。 你可能还想创建一个Bugzilla帐户来处理用户反映的错误。

创建一个FAS账户

  1. 打开 https://admin.fedoraproject.org/accounts 并点击“New Account(新建账号)”链接。
  2. 填写所有项,然后单击“Sign up(注册)”。 密码将通过电子邮件发送给你,你可以稍后更改密码。
  3. 现在再次访问 https://admin.fedoraproject.org/accounts 并用你的密码登录。
  4. 帐户系统会提醒你CLA未完成。

签署CLA

要开始翻译前,你必须完成贡献者许可协议或CLA。

  1. 访问 https://admin.fedoraproject.org/accounts 并用你在上一过程中获得的用户名和密码登录你的帐户。
  2. 在欢迎页面中,单击完成CLA或转到https://admin.fedoraproject.org/accounts/user/edit。
  3. 如果你尚未提供电话号码和地址的信息,将出现编辑帐户(user_name)页面,你需要填写每一项。否则将显示"Fedora Contributor License Agreement"页面。仔细阅读协议,如果你愿意,请点击我同意。
  4. 现在点击“保存”! 在页面底部保存你的信息。
  5. 出现用户视图页面,CLA项:显示为“CLA 已验证”。
Note.png
注意
除管理员组外,其他人无法访问电话号码和地址信息。 请参阅 https://fedoraproject.org/wiki/Legal:PrivacyPolicy 上的Fedora隐私政策。 其他任何成员都可以通过访问用户的视图页面显示其他信息。
Idea.png
有关FAS的更多信息
有关Fedora帐户系统的更多详细信息,请参阅 https://fedoraproject.org/wiki/Account_System

加入邮件列表

L10n 邮件列表

Note.png
注意
在此邮件列表中使用英语
  1. 访问trans邮件列表订阅页面并订阅它。
  2. 在管理员批准之前,你将无法向列表发送邮件。 你将收到一封确认电子邮件,其中包含确认订阅的链接。 单击链接以确认。

你的team(团队)邮件列表

Note.png
注意
在这个邮件列表中使用你的母语更好
  1. 访问 https://fedoraproject.org/wiki/L10N/Teams 并找到你的语言团队。
  2. 订阅你的语言的邮件列表
Important.png
邮件列表指南
在发送消息到邮件列表之前,建议你阅读此指南

介绍你自己

  1. https://fedoraproject.org/wiki/User:Username 创建个人页面(可选).
  2. 对你订阅的邮件列表进行简短的自我介绍。 如果你不知道要介绍什么,这里有一个模板:https://fedoraproject.org/wiki/L10N_Self_introduction。

以上两个步骤对于Fedora贡献者相互了解和联系非常有用。 第二步还可以帮助你的语言管理员(协调员)认识你并批准你作为团队的翻译。

使用您的FAS账户登录Zanta

Zanata login.png

  • 然后它将跳转到FedOAuth页面,你可以使用你在上一节中注册的FAS帐户和密码登录。

Fedoauth.png

  • 然后,你将被重定向到认证页面,单击“Approve(批准)”。

Fas approve.png

  • “new user(新用户)”页面会打开。

你应输入你的全名,用户名(FAS用户名)和你的电子邮件地址。 注意:请使用你的真实电子邮件地址,但不要使用你的Fedora项目别名(username@fedoraproject.org)。 完成后,单击“Save(保存)”按钮。 激活邮件将立即发送到你的邮件地址。 请在收件箱中找到邮件,然后打开邮件中显示的激活链接。 然后使用你的FAS用户名和密码登录。 下次登录时,你无需再次执行此步骤。 它只对新用户登录时是必要的。

寻找适合于你的语言团队并加入

  • 访问https://fedora.zanata.org并点击顶部的语言,然后你将看到所有可用的语言(已过期需要登陆后才可查看)。

Zanata Languages.png

  • 找到你要翻译的语言,然后单击语言编号。
  • 单击页面左侧的蓝色按钮申请加入团队。

Zanata join team.png

  • 你可以选择你想要的角色,然后单击“Send Message(发送消息)”。 附加消息是可选的。 例子中,我使用南非荷兰语作为下面的截图。

Zanata join.png

  • 团队管理员(协调员)将收到有关你请求的电子邮件通知。 只要他/她批准你的请求,你将成为团队成员。 但是,管理员(协调员)可能不会批准你的每个角色请求。 换句话说,如果你要求成为翻译,审稿人和协调员,他/她可能只会批准你担任翻译角色。

Translating

使用Zanata在线翻译

寻找你的项目


在Zanata上有三种查找翻译文件的方法:

方法一 : 项目搜索

如果你知道翻译项目的标题,可以通过项目搜索框查找它

Search projects.png

然后选择合适的项目来查看可用的翻译版本。

Versions.png

方法二 : 项目主页

单击位于页面顶部的“Projects(项目)”链接,访问“Projects(项目)”页面上的所有项目。 通过单击列表字段名中的箭头,可以按名称,创建日期或当前活动状态对项目表进行排序。

Projects.png

单击项目名称以查看可用于翻译的版本。

方法三 : 用户仪表盘(控制台)

你也可以从用户仪表盘(控制台)访问你的翻译项目。

Dashboard2.png

“Activity(活动)”部分列出了你的所有最新翻译。 如果要查找最近翻译的项目,请通过该列表信息查找项目的名称。 你可以通过单击列表信息中的相关链接文字来访问,文档信息,版本信息或整个项目。

Your activity.png

开始翻译


找到并选择项目后,将打开以下编辑器:

Editor.png

1. Search(搜索 )

直接在搜索框中输入相关名称或选择筛选来进行搜索。 例如,如果你只想显示自己修改的字符串,请选择“last-modified-by”并输入你的用户名。

Filter terms.png

2. String details(文字简介)

允许你查看特定源文本的详细信息,包括注释。

3. Filtering(筛选)

字符串可以按状态筛选:Incomplete, Complete and Invalid(未完成,完成和无效)(包含警告或错误)。 例如,要显示所有未翻译(未完成),草稿和无效的字符,请选中“Incomplete(未完成)”框。 仅显示特定类型的未完成符串,请选中相应的框,例如 Fuzzy(草稿)。

Incomplete2.png


4. Copy message from source language(从源语言复制消息)

当源文本包含标签,数字或产品名称时应与需要翻译的语言保持一致,此功能非常有用。

5. Profile icon(个人资料图标)

单击此图标可注销或访问仪表盘。 仪表盘的右上角显示当前日/周/月翻译的单词/消息/文档的数量。 仪表盘的底部显示你的活动状态,即你最后翻译的文件的时间和位置。

6. Document list(文档列表)

单击返回此项目的文档列表

7. Editor(编辑器)

This button allows you to revert to the editor from any other page you are in, e.g. from the Project-wide Search & Replace page.

8. Project-wide Search & Replace(整个项目的搜索与替换)

使用此选项可搜索并替换整个文件中的具体词或短句。 操作如下: 在搜索框中输入一个词,设置搜索筛选“search target(搜索目标)”,并检查“Case sensitive(区分大小写)”的情况(如果适用)。 在第二个文本框中,输入你要使用的词语。 然后选中“Select all(全选)”或选择要应用此更改的文字,然后单击“Replace(替换)”更改。

9. Available Keyboard Shortcuts(键盘快捷键)

在文本编辑器页面中,单击此按钮可查看所有可用快捷键的列表。

10. Notification(通知)

单击此按钮可查看最新通知,包括每个已修改文字的日期,行号,ID号。

11. Chat room(群聊)

使用此功能可与其他翻译人员进行交流

12. Options(设置)

此功能允许你修改自定义修改默认选项。 例如,选中“Enter key saves immediately(立即输入密钥保存)”框以使用Enter键保存字符串。

Options.png


13. Validation options(验证设置)

此页面允许你选择不同的验证设置:

- HTML/XML tags:html/xml标签是检查源文本和目标文本之间是否一致。

- Java variables:检查 java style ({x}) 变量是否一致.

- Leading/trailing newline (\n)(行首、行尾的换行符): 检查行首和行尾随换行符是否一致 (\n).

- Positional printf (XSI extension): 检查位于printf style (%n$x) 变量是否一致.

- Tab characters (\t)(制表符):检查源文件与目标是否具有相同数量的制表符。

- XML entity reference: 检查整个XML的标记是否完整。

14. Save as translated(保存为已翻译)

保存可以通过单击此图标,或者单击旁边的文字,在或者按Ctrl + Enter或仅按Enter键(如果在编辑器选项中选中“Enter key saves immediately(立即保存输入键)”)来完成保存(参见10.)。

15. Save as fuzzy(保存为草稿)

你可以使用此按钮将当前文字保存为草稿,并设置它需要进一步的工作。

16. Cancel(取消)

如果要取消更改,请使用此按钮。

17. History(历史记录)

此按钮将跳转到翻译历史页面,你可以:

- 发表评论

- 查看此特定文字的翻译历史记录,包括修改日期和用户名

- 比较不同的版本,只需点击“Compare(比较)”,查看你要比较的两个字符,然后单击“Compare vers. X and X”选项查看比较。

Translation history.png

Translation history 2.png

Translation history 3.png

18. Translation memory(翻译历史库)

Translation Memory(TM)是一种搜索与当前所选源字符串相等(100%)或类似(<100%)的翻译的工具。 Matches can be copied to the translation text box and used as-is or modified before saving. To copy TM matches to the selected text box, click the “Copy” button, or use Ctrl+Alt+1 to Ctrl+Alt+4 keyboard shortcuts to copy the first to fourth match in the list. 你还可以通过在TM文本框中输入并单击“Search”来搜索TM以查找其它短句。

19. Glossary(词汇表)

If a glossary has been uploaded for your language, each word in the currently selected row will be searched for a glossary entry.

离线翻译

有两种方法可以让你离线翻译:

方法一: Zanata-cli


1. 安装 zanata-cli

访问 http://zanata.org/help/

在 “Cli” - 选择 “Installing the client ”

你可以通过两种方式安装客户端:

  • 使用 DNF 安装Fedora 22及更高版本或使用 YUM安装,如果你使用旧版本运行以下命令:
sudo dnf install zanata-client
sudo yum install zanata-client
  • 或使用Ivy安装:

点击“Zanata Ivy Client on github(github上的Zanata Ivy客户端)” 链接

根据你使用的系统(Fedora,RHEL或其他系统)运行相应的命令

安装Ivy后,单击zanata-cli文件。

Zanata.cli.png

将可执行文件的内容复制并粘贴到文本编辑器中,并另存为“zanata-cli”。

2. 配置客户端

配置客户端需要两个操作:

2.1 配置用户:

首先在 ~/.config/ 中使用首选文本编辑器创建或打开“zanata.ini”。

2个步骤:

2.1.1. 创建API密钥

在Zanata帐户中,转到信息中心,然后点击“Settings(设置)”。

Dashboard-settings.png

然后选择客户端

Client.png

如果你没有,请生成API密钥。

2.1.2. 将标记为“Configuration [zanata.ini]”的文本框的内容复制到先前创建的zanata.ini文件中并保存该文件。

2.2 配置项目:

将项目版本配置添加到项目目录,navigate to your translation project in Zanata,,例如: Fedora安装指南 - f20 - 选择你的语言环境 - 在右上角,单击箭头并选择“Download config file(下载配置文件)”

Download config file.png

将zanata.xml文件保存在首选位置。

3. 将文件下载到你的计算机

在命令行中运行以下命令前,make sure you are in the directory containing the zanata.xml file.

运行:

zanata-cli pull -s src -t trans -l <language code> --pull-type both

源文件和已翻译文件将创建到目录中的src(源)和trans(已翻译)文件中。

你现在可以使用首选编辑器打开文件并翻译项目。

4. 将文件上传到Zanata

将已翻译的文件推送回Zanata,请运行以下命令:

zanata-cli push -s src -t trans -l <language code> --push-type trans

你的翻译现已被推送Zanata,并且TM已根据你的更改进行了更新。

方法二:通过用户界面

登陆 https://translate.zanata.org/

搜索你的项目,例如 Fedora安装指南。

选择你的语言

要下载整个项目,请单击页面右上角的箭头(“sort(排序)”旁边),然后单击“Download All (zip)(全部下载)”。

Projet entier.png

仅下载一个文件,请单击文件名左侧的箭头,然后选择“Download Translated [.po].(下载已翻译的)”。

Download translated.png

将文件保存到首选位置。

翻译文件。

完成后,将文件上传到Zanata,选择“Upload translation(上传翻译)”。

注意:虽然可以下载整个项目,但只能通过文件,通过单击文件名左侧的箭头,然后选择“Upload translation(上传翻译)”来上传。

校对

相对翻译人员来说很难在翻译的文字内找到拼写错误或轻微错误。 校对非常重要。 一般来说,校对仅涉及翻译的文字内容。 然而,PO文件通过L10n和i18n工作流程发挥了重要作用。 因此,翻译人员应在翻译过程中保持PO文件的有效性,以便其他翻译和维护人员可以正确地使用它们。

PO文件校对

Zanata提供的在线翻译编辑器具有检查每个字符串的校对功能。 如果你更喜欢在线翻译,此功能对你有所帮助。 校对选项位于在线编辑器的右侧。 它提供了几种验证方法。

Zanata validation options.png

在此示例中,结束标记

</command>

被写为

</comd>

,编辑器会发出警告,表示可能存在错误标签(</command>)。 当你使用在线翻译期间显示这样的警告时,最好再仔细检查你的翻译。

Zanata proofreading error.png

如果你希望离线翻译,应始终在提交前检查文件的有效性。 执行此操作的命令是:

msgfmt -cvo /dev/null po_file_to_check.po

确保没有错误信息。

翻译校对

验证工具仅用于检查与编码语言相关的东西,变量或某些内容的有效性。 你不能指望它检查你真正翻译的文字内容。 例如,我错误地将英文单词“He”翻译成中文“它”(右边是“他”),验证工具不会警告你存在错误。 你的目标和责任是毫无错误地进行翻译。 阅读你翻译的内容是检查错误的好习惯。

使用自动检查排版工具

Depending on your language, the verification of the compliance to some typographic rules may be difficult to do without the help of a specialized tool. This is specially the case with the various types of spaces that are not visible. A tool (which is still in an early development stage) is available and it is described in the L10N/Typo Purification of po Files page.

创建翻译文档(书)

为了更容易地进行校对,通常在最终的上下文中看到翻译的消息。 请参考 如何在Zanata上的翻译文件构建翻译的文档

测试

事实上,/usr/share/locale/your_LOCALE/LC_MESSAGES/ 目录是系统组件和软件的大多数本地化文件所在地。 所以一般说来,如果你想测试软件或者系统组件的翻译,最简单的方法是:

  • 首先备份原始文件:
    sudo cp /usr/share/locale/your_LOCALE/LC_MESSAGES/example.mo /usr/share/locale/your_LOCALE/LC_MESSAGES/example.mo.old
  • 将新 mo 文件放到该目录里:
    sudo msgfmt -o new_example.po /usr/share/locale/your_LOCALE/LC_MESSAGES/new_example.mo
  • 运行要测试的软件或系统组件或命令。

(我们打算做一个新的演示。这里有一个旧演示。)

下面两小节将介绍两种更高级的测试方法。

使用固定链接 (permalinks)

使用 Zanata 翻译平台的一大好处是能够仅用几条命令从一个固定链接拉取翻译,并安装到系统里。

要获取固定链接:

  • 访问翻译项目
  • 选择目标版本,如果有若干版本的话
  • 选择语言
  • 点击导航栏里的 Documents (YOUR_LOCALE) 链接
  • 复制 actions 栏的固定链接 (.po)

有了固定链接后,你可以在你的系统上通过运行如下命令测试翻译:

Note.png
提示
这个例子里我们 locale 选择 'ca',测试组件选择 anaconda。
su -c 'mv /usr/share/locale/ca/LC_MESSAGES/anaconda.mo /user/share/locale/ca/LC_MESSAGES/anaconda.mo.old; \
msgfmt <(curl -s https://fedora.zanata.org/rest/file/translation/anaconda/f23-branch/ca/po?docId=po%2Fanaconda &> /dev/stdout)\
 -o /usr/share/locale/ca/LC_MESSAGES/anaconda.mo'

使用固定链接和 fedpkg 构建 rpm

有时候不太容易 msgfmt po 文件。我们应该构建一个包含翻译的 rpm 包进行测试。下面是一个例子:

su -c ‘dnf install -y fedpkg fedora-packager rpmdevtools’
fedpkg clone -a -B sssd
cd sssd/f23
su -c 'dnf builddep -y sssd.spec'
fedpkg prep
export version=1.13.0
cp -rp sssd-$version sssd-${version}p
curl -s https://fedora.zanata.org/rest/file/translation/sssd/master/ca/po?docId=po%2Fsssd > sssd-${version}p/po/ca.po
curl -s https://fedora.zanata.org/rest/file/translation/sssd/master/ca/po?docId=src%2Fman%2Fpo%2Fsssd-docs > sssd-${version}p/src/man/po/ca.po
diff -urN sssd-$version sssd-${version}p > my.patch

编辑 sssd.spec 文件添加补丁(首先是文件顶部的 Patch999: my.patch;第二步是 %prep 小节紧随 %setup -q%patch999 -p1。如果文件里有 for p in %patches ; do 的话不需要第二步):

...
### Patches ###
Patch9999: my.patch
...

...
%prep
...
%setup -q
%patch9999 -p1
...

构建并安装打了补丁的 rpm:

fedpkg local
su -c 'dnf install --nogpgcheck */*.rpm'

常见问题 (FAQ)

如下是关于本地化项目的常见问题解答。

应该翻译哪个分支 (branch)?

  • 'master' 或开发中的 Fedora 版本对应的 'Fxx' 分支是优先翻译的分支。
  • 已发布的 Fedora 版本对应的 'Fxx' 分支最好不要翻译。很可能会浪费你的时间。因为开发者通常不会拉取翻译并重新打包已发布的版本(“不回头看”)。但是,有些维护者会支持本地化工作并自行拉取新翻译。如果有特定原因需要更新软件包(例如影响可操作性或者功能),那是值得报 bug 强迫维护者更新翻译的。
  • 'RHEL' 分支,可以忽视,因为很可能红帽翻译者会照顾的。不过这并不意味着不要翻译。如果你愿意翻译,你的贡献总是受欢迎的。

致谢

如下成员贡献了本文档(的英文版):

值得一提的是本文档的部分内容直接或间接源自旧的针对 Transifex 平台的 Fedora 本地化指南,所以我们这里也对旧版指南的作者表示感谢。