# Core GIT Translations
This directory holds the translations for the core of Git. This document
describes how you can contribute to the effort of enhancing the language
coverage and maintaining the translation.
The localization (l10n) coordinator, Jiang Xin <worldhello.net@gmail.com>,
coordinates our localization effort in the l10 coordinator repository:
https://github.com/git-l10n/git-po/
The two character language translation codes are defined by ISO\_639-1, as
stated in the gettext(1) full manual, appendix A.1, Usual Language Codes.
## Contributing to an existing translation
As a contributor for a language XX, you should first check TEAMS file in
this directory to see whether a dedicated repository for your language XX
exists. Fork the dedicated repository and start to work if it exists.
Sometime, contributors may find that the translations of their Git
distributions are quite different with the translations of the
corresponding version from Git official. This is because some Git
distributions (such as from Ubuntu, etc.) have their own l10n workflow.
For this case, wrong translations should be reported and fixed through
their workflows.
## Creating a new language translation
If you are the first contributor for the language XX, please fork this
repository, prepare and/or update the translated message file "po/XX.po"
(described later), and ask the l10n coordinator to pull your work.
If there are multiple contributors for the same language, please first
coordinate among yourselves and nominate the team leader for your
language, so that the l10n coordinator only needs to interact with one
person per language.
## Core translation
The core translation is the smallest set of work that must be completed
for a new language translation. Because there are more than 5000 messages
in the template message file "po/git.pot" that need to be translated,
this is not a piece of cake for the contributor for a new language.
The core template message file which contains a small set of messages
will be generated in "po-core/core.pot" automatically by running a helper
program named "git-po-helper" (described later).
```shell
git-po-helper init --core XX.po
```
After translating the generated "po-core/XX.po", you can merge it to
"po/XX.po" using the following commands:
```shell
msgcat po-core/XX.po po/XX.po -s -o /tmp/XX.po
mv /tmp/XX.po po/XX.po
git-po-helper update XX.po
```
Edit "po/XX.po" by hand to fix "fuzzy" messages, which may have misplaced
translated messages and duplicate messages.
## Translation Process Flow
The overall data-flow looks like this:
+-------------------+ +------------------+
| Git source code | ---(1)---> | L10n coordinator |
| repository | <---(4)--- | repository |
+-------------------+ +------------------+
| ^
(2) (3)
V |
+------------------+
| Language Team XX |
+------------------+
- Translatable strings are marked in the source file.
- L10n coordinator pulls from the source (1)
- L10n coordinator updates the message template "po/git.pot"
- Language team pulls from L10n coordinator (2)
- Language team updates the message file "po/XX.po"
- L10n coordinator pulls from Language team (3)
- L10n coordinator asks the result to be pulled (4).
## Maintaining the "po/git.pot" file
(This is done by the l10n coordinator).
The "po/git.pot" file contains a message catalog extracted from Git's
sources. The l10n coordinator maintains it by adding new translations with
msginit(1), or update existing ones with msgmerge(1). In order to update
the Git sources to extract the messages from, the l10n coordinator is
expected to pull from the main git repository at strategic point in
history (e.g. when a major release and release candidates are tagged),
and then run "make pot" at the top-level directory.
Language contributors use this file to prepare translations for their
language, but they are not expected to modify it.
## Initializing a "XX.po" file
(This is done by the language teams).
If your language XX does not have translated message file "po/XX.po" yet,
you add a translation for the first time by running:
```shell
msginit --locale=XX
```
in the "po/" directory, where XX is the locale, e.g. "de", "is", "pt\_BR",
"zh\_CN", etc.
Then edit the automatically generated copyright info in your new "XX.po"
to be correct, e.g. for Icelandic:
```diff
@@ -1,6 +1,6 @@
-# Icelandic translations for PACKAGE package.
-# Copyright (C) 2010 THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
+# Icelandic translations for Git.
+# Copyright (C) 2010 Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+# This file is distributed under the same license as the Git package.
# Ævar Arnfjörð Bjarmason <avarab@gmail.com>, 2010.
```
And change references to PACKAGE VERSION in the PO Header Entry to
just "Git":
```shell
perl -pi -e 's/(?<="Project-Id-Version: )PACKAGE VERSION/Git/' XX.po
```
Once you are done testing the translation (see below), commit the result
and ask the l10n coordinator to pull from you.
## Updating a "XX.po" file
(This is done by the language teams).
If you are replacing translation strings in an existing "XX.po" file to
improve the translation, just edit the file.
If there's an existing "XX.po" file for your language, but the repository
of the l10n coordinator has newer "po/git.pot" file, you would need to first
pull from the l10n coordinator (see the beginning of this document for its
URL), and then update the existing translation by running:
```shell
msgmerge --add-location --backup=off -U XX.po git.pot
```
in the "po/" directory, where "XX.po" is the file you want to update.
Once you are done testing the translation (see below), commit the result
and ask the l10n coordinator to pull from you.
## Fuzzy translation
Fuzzy translation is a translation marked by comment "fuzzy" to let you
know that the translation is out of date because the "msgid" has been
changed. A fuzzy translation will be ignored when compiling using "msgfmt".
Fuzzy translation can be marked by hands, but for most cases they are
marked automatically when running "msgmerge" to update your "XX.po" file.
After fixing the corresponding translation, you must remove the "fuzzy"
tag in the comment.
## Testing your changes
(This is done by the language teams, after creating or updating "XX.po" file).
Before you submit your changes go back to the top-level and do:
```shell
make
```
On systems with GNU gettext (i.e. not Solaris) this will compile your
changed PO file with `msgfmt --check`, the --check option flags many
common errors, e.g. missing printf format strings, or translated
messages that deviate from the originals in whether they begin/end
with a newline or not.
## Marking strings for translation
(This is done by the core developers).
Before strings can be translated they first have to be marked for
translation.
Git uses an internationalization interface that wraps the system's
gettext library, so most of the advice in your gettext documentation
(on GNU systems `info gettext` in a terminal) applies.
General advice:
- Don't mark everything for translation, only strings which will be
read by humans (the porcelain interface) should be translated.
The output from Git's plumbing utilities will primarily be read by
programs and would break scripts under non-C locales if it was
translated. Plumbing strings should not be translated, since
they're part of Git's API.
- Adjust the strings so that they're easy to translate. Most of the
advice in `info '(gettext)Preparing Strings'` applies here.
- If something is unclear or ambiguous you can use a "TRANSLATORS"
comment
没有合适的资源?快使用搜索试试~ 我知道了~
git-2.33.1.tar.gz
需积分: 10 2 下载量 68 浏览量
2022-07-20
09:41:13
上传
评论
收藏 9.87MB GZ 举报
温馨提示
共2000个文件
sh:1124个
txt:785个
c:502个
git-2.33.1.tar.gz
资源推荐
资源详情
资源评论
收起资源包目录
git-2.33.1.tar.gz (2000个子文件)
diff.c 193KB
sequencer.c 163KB
merge-ort.c 148KB
apply.c 132KB
regexec.c 125KB
merge-recursive.c 118KB
revision.c 115KB
pack-objects.c 113KB
regcomp.c 110KB
read-cache.c 99KB
dir.c 98KB
fast-import.c 92KB
files-backend.c 86KB
config.c 86KB
blame.c 83KB
submodule--helper.c 81KB
mingw.c 75KB
unpack-trees.c 73KB
ref-filter.c 72KB
wt-status.c 72KB
commit-graph.c 68KB
http.c 67KB
remote.c 66KB
receive-pack.c 65KB
object-file.c 65KB
log.c 63KB
rebase.c 63KB
am.c 62KB
refs.c 61KB
submodule.c 59KB
fetch.c 59KB
fetch-pack.c 58KB
packfile.c 58KB
checkout.c 57KB
sha1.c 56KB
commit.c 56KB
gc.c 52KB
pretty.c 52KB
index-pack.c 51KB
http-push.c 50KB
add-patch.c 50KB
diffcore-rename.c 50KB
convert.c 49KB
grep.c 48KB
object-name.c 48KB
merge.c 48KB
remote.c 47KB
ubc_check.c 47KB
regex_internal.c 46KB
upload-pack.c 46KB
packed-backend.c 44KB
stash.c 44KB
combine-diff.c 43KB
commit.c 42KB
transport-helper.c 42KB
run-command.c 41KB
transport.c 40KB
remote-curl.c 40KB
graph.c 40KB
midx.c 40KB
clone.c 40KB
pack-bitmap.c 40KB
setup.c 39KB
path.c 38KB
notes.c 37KB
imap-send.c 37KB
connect.c 36KB
daemon.c 35KB
fast-export.c 34KB
fsck.c 34KB
update-index.c 33KB
line-log.c 33KB
blame.c 33KB
tree-walk.c 32KB
pull.c 32KB
rerere.c 32KB
grep.c 32KB
date.c 32KB
trailer.c 31KB
add-interactive.c 30KB
bisect.c 30KB
bisect--helper.c 29KB
mailinfo.c 29KB
attr.c 28KB
notes.c 28KB
log-tree.c 28KB
xdiffi.c 28KB
config.c 28KB
worktree.c 28KB
mailinfo.c 28KB
git.c 27KB
branch.c 26KB
clean.c 26KB
parse-options.c 26KB
ipc-unix-socket.c 25KB
rev-parse.c 25KB
strbuf.c 25KB
fsck.c 25KB
nedmalloc.c 25KB
commit-reach.c 24KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
Michael_lcf
- 粉丝: 2584
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功