{"thread":{"id":"24916","subject":"[PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","startedAt":"2010-08-30T21:28:06Z","lastAt":"2010-08-31T22:58:07Z","messageCount":55,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano","Peter Krefting","Matthieu Moy","Jonathan Nieder","Marcin Cieslak","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":17},"messages":[{"id":"149367","messageId":"1283203703-26923-1-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":null,"subject":"[PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:06Z","receivedAt":"2010-08-30T21:28:06Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Now that Git has the infrastructure for translation in next I'm going\nto start submitting patches to make the main porcelain translatable.\n\nThis series starts that work, and fixes and also fixes up some of the\ninfrastructure (like the bug discussed in \"Odd encoding issue with\nUTF-8 + gettext yields ? on non-ASCII\"), and adds tests to make sure\nit's all working.\n\nWith it applied git-init is the one and only utility of the porcelain\nthat's translatable. The series includes a translation of it into\nIcelandic and Polish.\n\nI think it's ready to be applied. I tested it on Solaris, FreeBSD and\nDebian. But there's almost definitely something I'm missing in a\nseries this big, so it's an RFC.\n\nMarcin Cieślak (1):\n  po/pl.po: add Polish translation\n\nÆvar Arnfjörð Bjarmason (16):\n  Makefile: A variable for options used by xgettext(1) calls\n  Makefile: provide a --msgid-bugs-address to xgettext(1)\n  Makefile: tell xgettext(1) that our source is in UTF-8\n  builtin.h: Include gettext.h\n  gettext: make the simple parts of git-init localizable\n  gettext: localize the main git-init message\n  gettext.c: work around us not using setlocale(LC_CTYPE, \"\")\n  gettext tests: test if $VERSION exists before using it\n  gettext tests: update test/is.po to match t/t0200/test.c\n  gettext tests: add detection for is_IS.ISO-8859-1 locale\n  gettext tests: test message re-encoding under Shell\n  gettext tests: test re-encoding with a UTF-8 msgid under Shell\n  gettext tests: mark a test message as not needing translation\n  po/is.po: msgmerge and add Language: header\n  po/is.po: add Icelandic translation\n  gettext tests: test message re-encoding under C\n\n Makefile                           |    7 +-\n builtin.h                          |    1 +\n builtin/init-db.c                  |   56 ++++++-----\n gettext.c                          |    6 +\n po/is.po                           |  153 ++++++++++++++++++++++++++++--\n po/pl.po                           |  187 ++++++++++++++++++++++++++++++++++++\n t/lib-gettext.sh                   |   26 +++++-\n t/t0200-gettext-basic.sh           |    4 +-\n t/t0200/test.c                     |   10 ++\n t/t0202/test.pl                    |    4 +-\n t/t0204-gettext-reencode-sanity.sh |   78 +++++++++++++++\n 11 files changed, 490 insertions(+), 42 deletions(-)\n create mode 100644 po/pl.po\n create mode 100755 t/t0204-gettext-reencode-sanity.sh\n\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149366","messageId":"1283203703-26923-2-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 01/17] Makefile: A variable for options used by xgettext(1) calls","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:07Z","receivedAt":"2010-08-30T21:28:07Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the Makefile code to use a variable for the options that all\nthe xgettext(1) invocations are using. This makes it more readable,\nand makes it easier to add more standard options.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 62d526a..6a5bcf5 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2008,10 +2008,11 @@ cscope:\n \t$(RM) cscope*\n \t$(FIND) . -name '*.[hcS]' -print | xargs cscope -b\n \n+XGETTEXT_OPTIONS = --add-comments\n pot:\n-\t$(XGETTEXT) --add-comments --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n-\t$(XGETTEXT) --add-comments --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n-\t$(XGETTEXT) --add-comments --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl\n+\t$(XGETTEXT) $(XGETTEXT_OPTIONS) --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n+\t$(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n+\t$(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl\n \n POFILES := $(wildcard po/*.po)\n MOFILES := $(patsubst po/%.po,share/locale/%/LC_MESSAGES/git.mo,$(POFILES))\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149379","messageId":"1283203703-26923-3-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 02/17] Makefile: provide a --msgid-bugs-address to xgettext(1)","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:08Z","receivedAt":"2010-08-30T21:28:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the invocations of xgettext to use the --msgid-bugs-address\noption. This has the effect of adding a Report-Msgid-Bugs-To header to\nthe git.pot and the derived *.po files. Doing so is recommended by the\ngettext manual.\n\nIf this isn't added the Report-Msgid-Bugs-To header already in\npo/is.po and other PO files will be removed by msgmerge(1).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6a5bcf5..4b46579 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2008,7 +2008,7 @@ cscope:\n \t$(RM) cscope*\n \t$(FIND) . -name '*.[hcS]' -print | xargs cscope -b\n \n-XGETTEXT_OPTIONS = --add-comments\n+XGETTEXT_OPTIONS = --add-comments --msgid-bugs-address=\"Git Mailing List <git@vger.kernel.org>\"\n pot:\n \t$(XGETTEXT) $(XGETTEXT_OPTIONS) --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n \t$(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149365","messageId":"1283203703-26923-4-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 03/17] Makefile: tell xgettext(1) that our source is in UTF-8","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:09Z","receivedAt":"2010-08-30T21:28:09Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"By default xgettext(1) assumes that source code is in US-ASCII, change\nthat to UTF-8 for our case.\n\nI'm not planning to include non-ASCII in any of the main Git interface\nstrings. But this'll be used for a gettext regression test to make\nsure this works if we ever want to go this route, and to check that\nthe gettext implementation is sane in this regard.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 4b46579..9818a59 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2008,7 +2008,7 @@ cscope:\n \t$(RM) cscope*\n \t$(FIND) . -name '*.[hcS]' -print | xargs cscope -b\n \n-XGETTEXT_OPTIONS = --add-comments --msgid-bugs-address=\"Git Mailing List <git@vger.kernel.org>\"\n+XGETTEXT_OPTIONS = --add-comments --msgid-bugs-address=\"Git Mailing List <git@vger.kernel.org>\" --from-code=UTF-8\n pot:\n \t$(XGETTEXT) $(XGETTEXT_OPTIONS) --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n \t$(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149375","messageId":"1283203703-26923-5-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 04/17] builtin.h: Include gettext.h","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:10Z","receivedAt":"2010-08-30T21:28:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change builtin.h to include gettext.h. This is needed in order to\ntranslate Git's builtin commands (like git-init), which don't include\ngettext.h otherwise.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin.h |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin.h b/builtin.h\nindex ed6ee26..6cd3bd8 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -6,6 +6,7 @@\n #include \"cache.h\"\n #include \"commit.h\"\n #include \"notes.h\"\n+#include \"gettext.h\"\n \n extern const char git_version_string[];\n extern const char git_usage_string[];\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149364","messageId":"1283203703-26923-6-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:11Z","receivedAt":"2010-08-30T21:28:11Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the user visible strings in init-db.c to use gettext\nlocalizations. This only converts messages which needed to be changed\nfrom \"foo\" to _(\"foo\"), and didn't need any TRANSLATORS comments.\n\nI haven't marked the messages in init_db_usage or init_db_options for\ntranslation, since that would require additional changes in\nparse-options.c. Those can be done later.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/init-db.c |   46 +++++++++++++++++++++++-----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 0271285..9c08985 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)\n \t\t}\n \t}\n \telse if (share && adjust_shared_perm(dir))\n-\t\tdie(\"Could not make %s writable by group\", dir);\n+\t\tdie(_(\"Could not make %s writable by group\"), dir);\n }\n \n static void copy_templates_1(char *path, int baselen,\n@@ -58,25 +58,25 @@ static void copy_templates_1(char *path, int baselen,\n \t\tnamelen = strlen(de->d_name);\n \t\tif ((PATH_MAX <= baselen + namelen) ||\n \t\t    (PATH_MAX <= template_baselen + namelen))\n-\t\t\tdie(\"insanely long template name %s\", de->d_name);\n+\t\t\tdie(_(\"insanely long template name %s\"), de->d_name);\n \t\tmemcpy(path + baselen, de->d_name, namelen+1);\n \t\tmemcpy(template + template_baselen, de->d_name, namelen+1);\n \t\tif (lstat(path, &st_git)) {\n \t\t\tif (errno != ENOENT)\n-\t\t\t\tdie_errno(\"cannot stat '%s'\", path);\n+\t\t\t\tdie_errno(_(\"cannot stat '%s'\"), path);\n \t\t}\n \t\telse\n \t\t\texists = 1;\n \n \t\tif (lstat(template, &st_template))\n-\t\t\tdie_errno(\"cannot stat template '%s'\", template);\n+\t\t\tdie_errno(_(\"cannot stat template '%s'\"), template);\n \n \t\tif (S_ISDIR(st_template.st_mode)) {\n \t\t\tDIR *subdir = opendir(template);\n \t\t\tint baselen_sub = baselen + namelen;\n \t\t\tint template_baselen_sub = template_baselen + namelen;\n \t\t\tif (!subdir)\n-\t\t\t\tdie_errno(\"cannot opendir '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot opendir '%s'\"), template);\n \t\t\tpath[baselen_sub++] =\n \t\t\t\ttemplate[template_baselen_sub++] = '/';\n \t\t\tpath[baselen_sub] =\n@@ -93,20 +93,20 @@ static void copy_templates_1(char *path, int baselen,\n \t\t\tint len;\n \t\t\tlen = readlink(template, lnk, sizeof(lnk));\n \t\t\tif (len < 0)\n-\t\t\t\tdie_errno(\"cannot readlink '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot readlink '%s'\"), template);\n \t\t\tif (sizeof(lnk) <= len)\n-\t\t\t\tdie(\"insanely long symlink %s\", template);\n+\t\t\t\tdie(_(\"insanely long symlink %s\"), template);\n \t\t\tlnk[len] = 0;\n \t\t\tif (symlink(lnk, path))\n-\t\t\t\tdie_errno(\"cannot symlink '%s' '%s'\", lnk, path);\n+\t\t\t\tdie_errno(_(\"cannot symlink '%s' '%s'\"), lnk, path);\n \t\t}\n \t\telse if (S_ISREG(st_template.st_mode)) {\n \t\t\tif (copy_file(path, template, st_template.st_mode))\n-\t\t\t\tdie_errno(\"cannot copy '%s' to '%s'\", template,\n+\t\t\t\tdie_errno(_(\"cannot copy '%s' to '%s'\"), template,\n \t\t\t\t\t  path);\n \t\t}\n \t\telse\n-\t\t\terror(\"ignoring template %s\", template);\n+\t\t\terror(_(\"ignoring template %s\"), template);\n \t}\n }\n \n@@ -129,7 +129,7 @@ static void copy_templates(const char *template_dir)\n \t\treturn;\n \ttemplate_len = strlen(template_dir);\n \tif (PATH_MAX <= (template_len+strlen(\"/config\")))\n-\t\tdie(\"insanely long template path %s\", template_dir);\n+\t\tdie(_(\"insanely long template path %s\"), template_dir);\n \tstrcpy(template_path, template_dir);\n \tif (template_path[template_len-1] != '/') {\n \t\ttemplate_path[template_len++] = '/';\n@@ -137,7 +137,7 @@ static void copy_templates(const char *template_dir)\n \t}\n \tdir = opendir(template_path);\n \tif (!dir) {\n-\t\twarning(\"templates not found %s\", template_dir);\n+\t\twarning(_(\"templates not found %s\"), template_dir);\n \t\treturn;\n \t}\n \n@@ -150,8 +150,8 @@ static void copy_templates(const char *template_dir)\n \n \tif (repository_format_version &&\n \t    repository_format_version != GIT_REPO_VERSION) {\n-\t\twarning(\"not copying templates of \"\n-\t\t\t\"a wrong format version %d from '%s'\",\n+\t\twarning(_(\"not copying templates of \"\n+\t\t\t\"a wrong format version %d from '%s'\"),\n \t\t\trepository_format_version,\n \t\t\ttemplate_dir);\n \t\tclosedir(dir);\n@@ -188,7 +188,7 @@ static int create_default_files(const char *template_path)\n \tint filemode;\n \n \tif (len > sizeof(path)-50)\n-\t\tdie(\"insane git directory %s\", git_dir);\n+\t\tdie(_(\"insane git directory %s\"), git_dir);\n \tmemcpy(path, git_dir, len);\n \n \tif (len && path[len-1] != '/')\n@@ -369,7 +369,7 @@ static int guess_repository_type(const char *git_dir)\n \tif (!strcmp(\".\", git_dir))\n \t\treturn 1;\n \tif (!getcwd(cwd, sizeof(cwd)))\n-\t\tdie_errno(\"cannot tell cwd\");\n+\t\tdie_errno(_(\"cannot tell cwd\"));\n \tif (!strcmp(git_dir, cwd))\n \t\treturn 1;\n \t/*\n@@ -443,18 +443,18 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\t\t\t\terrno = EEXIST;\n \t\t\t\t\t/* fallthru */\n \t\t\t\tcase -1:\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\t\tbreak;\n \t\t\t\tdefault:\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\tshared_repository = saved;\n \t\t\t\tif (mkdir(argv[0], 0777) < 0)\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\tmkdir_tried = 1;\n \t\t\t\tgoto retry;\n \t\t\t}\n-\t\t\tdie_errno(\"cannot chdir to %s\", argv[0]);\n+\t\t\tdie_errno(_(\"cannot chdir to %s\"), argv[0]);\n \t\t}\n \t} else if (0 < argc) {\n \t\tusage(init_db_usage[0]);\n@@ -476,8 +476,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \tgit_dir = getenv(GIT_DIR_ENVIRONMENT);\n \tif ((!git_dir || is_bare_repository_cfg == 1)\n \t    && getenv(GIT_WORK_TREE_ENVIRONMENT))\n-\t\tdie(\"%s (or --work-tree=<directory>) not allowed without \"\n-\t\t    \"specifying %s (or --git-dir=<directory>)\",\n+\t\tdie(_(\"%s (or --work-tree=<directory>) not allowed without \"\n+\t\t\t  \"specifying %s (or --git-dir=<directory>)\"),\n \t\t    GIT_WORK_TREE_ENVIRONMENT,\n \t\t    GIT_DIR_ENVIRONMENT);\n \n@@ -502,10 +502,10 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\tif (!git_work_tree_cfg) {\n \t\t\tgit_work_tree_cfg = xcalloc(PATH_MAX, 1);\n \t\t\tif (!getcwd(git_work_tree_cfg, PATH_MAX))\n-\t\t\t\tdie_errno (\"Cannot access current working directory\");\n+\t\t\t\tdie_errno (_(\"Cannot access current working directory\"));\n \t\t}\n \t\tif (access(get_git_work_tree(), X_OK))\n-\t\t\tdie_errno (\"Cannot access work tree '%s'\",\n+\t\t\tdie_errno (_(\"Cannot access work tree '%s'\"),\n \t\t\t\t   get_git_work_tree());\n \t}\n \n-- \n1.7.2.2.536.g3f548\n"},{"id":"149368","messageId":"1283203703-26923-7-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 06/17] gettext: localize the main git-init message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:12Z","receivedAt":"2010-08-30T21:28:12Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the git-init \"Initialized empty Git repository\" message and its\nvariants to use gettext.\n\nThis is one of the messages that could do with splitting up, I had a\nWIP patch to do that that began like this:\n\n    const char *reinit_shared   = _(\"Reinitialized existing shared Git repository in %s\\n\");\n    const char *init_shared\t    = _(\"Initialized empty shared Git repository in %s\\n\");\n    const char *reinit_noshared = _(\"Reinitialized existing Git repository in %s\\n\");\n    const char *init_noshared   = _(\"Initialized empty Git repository in %s\\n\");\n\nBut in the first round of gettextization I'm aiming to keep code\nchanges to a minimum for ease of review.\n\nWe can solicit input from translators about which messages that use\ntoo much sprintf-ing are troublesome, and change those later.\n\nNote that the TRANSLATORS comment doesn't use the usual Git\nstyle. This is because everything from \"/* TRANSLATORS: \" to \"*/\" will\nextracted as-is xgettext(1) and presented to translators, including\nnewlines and leading \"*\"'s. There seems to be no way to change that,\nshort of patching xgettext itself.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/init-db.c |   10 +++++++---\n 1 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 9c08985..0224dee 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -348,9 +348,13 @@ int init_db(const char *template_dir, unsigned int flags)\n \tif (!(flags & INIT_DB_QUIET)) {\n \t\tconst char *git_dir = get_git_dir();\n \t\tint len = strlen(git_dir);\n-\t\tprintf(\"%s%s Git repository in %s%s\\n\",\n-\t\t       reinit ? \"Reinitialized existing\" : \"Initialized empty\",\n-\t\t       shared_repository ? \" shared\" : \"\",\n+\n+\t\t/* TRANSLATORS: The first '%s' is either \"Reinitialized\n+\t\t   existing\" or \"Initialized empty\", the second \" shared\" or\n+\t\t   \"\", and the last '%s%s' is the verbatim directory name. */\n+\t\tprintf(_(\"%s%s Git repository in %s%s\\n\"),\n+\t\t       reinit ? _(\"Reinitialized existing\") : _(\"Initialized empty\"),\n+\t\t       shared_repository ? _(\" shared\") : \"\",\n \t\t       git_dir, len && git_dir[len-1] != '/' ? \"/\" : \"\");\n \t}\n \n-- \n1.7.2.2.536.g3f548\n"},{"id":"149373","messageId":"1283203703-26923-8-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, \"\")","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:13Z","receivedAt":"2010-08-30T21:28:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the gettext setup code to arrange for messages to be emitted in\nthe user's requested encoding, but avoid setting LC_CTYPE from the\nenvironment for the whole program.\n\nIn 107880a I removed our use of setlocale(LC_CTYPE, \"\") because of a\nbug in the GNU C Library [1]. Even if it wasn't for that bug we\nwouldn't want to use LC_CTYPE at this point, because it'd require\nauditing all the code that uses C functions whose semantics are\nmodified by LC_CTYPE.\n\nBut only setting LC_MESSAGES as we do creates a problem, since we\ndeclare the encoding of our PO files[2] the gettext implementation\nwill try to recode it to the user's locale, but without LC_CTYPE it'll\nemit something like this on 'git init'\n\n    Bj? til t?ma Git lind ? /hl/agh/.git/\n\nGettext knows about the encoding of our PO file, but we haven't told\nit about the user's encoding, so all the non-US-ASCII characters get\nencoded to question marks.\n\nBut we're in luck! We can set LC_CTYPE from the environment only while\nwe call nl_langinfo and bind_textdomain_codeset. That suffices to tell\ngettext what encoding it should emit in, so it'll now say:\n\n    Bjó til tóma Git lind í /hl/agh/.git/\n\nAnd the equivalent ISO-8859-1 string will be emitted under a\nISO-8859-1 locale.\n\nWith this change way we get the advantages of setting LC_CTYPE (talk\nto the user in his language/encoding), without the drawbacks (changed\nsemantics for C functions we rely on).\n\nIn the long term we should probably see about getting that bug in\nglibc fixed, and audit our code so it won't fall apart under a non-C\nlocale.\n\n1. http://sourceware.org/bugzilla/show_bug.cgi?id=6530\n2. E.g. \"Content-Type: text/plain; charset=UTF-8\\n\" in po/is.po\n\nSuggested-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n gettext.c |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/gettext.c b/gettext.c\nindex db99742..8644098 100644\n--- a/gettext.c\n+++ b/gettext.c\n@@ -1,11 +1,13 @@\n #include \"exec_cmd.h\"\n #include <locale.h>\n #include <libintl.h>\n+#include <langinfo.h>\n #include <stdlib.h>\n \n extern void git_setup_gettext(void) {\n \tchar *podir;\n \tchar *envdir = getenv(\"GIT_TEXTDOMAINDIR\");\n+\tchar *charset;\n \n \tif (envdir) {\n \t\t(void)bindtextdomain(\"git\", envdir);\n@@ -17,5 +19,9 @@ extern void git_setup_gettext(void) {\n \t}\n \n \t(void)setlocale(LC_MESSAGES, \"\");\n+\t(void)setlocale(LC_CTYPE, \"\");\n+\tcharset = nl_langinfo(CODESET);\n+\t(void)bind_textdomain_codeset(\"git\", charset);\n+\t(void)setlocale(LC_CTYPE, \"C\");\n \t(void)textdomain(\"git\");\n }\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149369","messageId":"1283203703-26923-9-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 08/17] gettext tests: test if $VERSION exists before using it","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:14Z","receivedAt":"2010-08-30T21:28:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Versions of Locale::Messages before 1.17 didn't have a $VERSION\nvariable. This caused test failures on boxes that had this old version\ninstalled, since the warnings pragma emits warnings on STDERR, which\nfails the test.\n\nChange the test to work around this by first checking if the $VERSION\nvariable is defined before using it.\n\nReported-by: Jens Lehmann <Jens.Lehmann@web.de>\nTested-by: Jens Lehmann <Jens.Lehmann@web.de>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t0202/test.pl |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t0202/test.pl b/t/t0202/test.pl\nindex c2055fa..6b00603 100644\n--- a/t/t0202/test.pl\n+++ b/t/t0202/test.pl\n@@ -11,7 +11,9 @@ my $has_gettext_library = $Git::I18N::__HAS_LIBRARY;\n \n ok(1, \"Testing Git::I18N version $Git::I18N::VERSION with \" .\n \t ($has_gettext_library\n-\t  ? \"Locale::Messages version $Locale::Messages::VERSION\"\n+\t  ? (defined $Locale::Messages::VERSION\n+\t\t ? \"Locale::Messages version $Locale::Messages::VERSION\"\n+\t\t : \"Locale::Messages version <1.17\")\n \t  : \"NO Perl gettext library\"));\n ok(1, \"Git::I18N is located at $INC{'Git/I18N.pm'}\");\n \n-- \n1.7.2.2.536.g3f548\n"},{"id":"149381","messageId":"1283203703-26923-10-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 09/17] gettext tests: update test/is.po to match t/t0200/test.c","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:15Z","receivedAt":"2010-08-30T21:28:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change test.c to use '' quotes around \"git help COMMAND\" as git.c\ndoes. An earlier version of the gettext series didn't use '' quotes,\nbut I hadn't run msgmerge since then so I didn't spot it.\n\nFor reference, the msgmerge command:\n\n    msgmerge --backup=off -U is.po git.pot\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/is.po                 |    4 ++--\n t/t0200-gettext-basic.sh |    4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/po/is.po b/po/is.po\nindex 95739f1..2f3a220 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -10,8 +10,8 @@ msgstr \"\"\n \"Content-Transfer-Encoding: 8bit\\n\"\n \n #: t/t0200/test.c:4\n-msgid \"See git help COMMAND for more information on a specific command.\"\n-msgstr \"Sjá git help SKIPUN til að sjá hjálp fyrir tiltekna skipun.\"\n+msgid \"See 'git help COMMAND' for more information on a specific command.\"\n+msgstr \"Sjá 'git help SKIPUN' til að sjá hjálp fyrir tiltekna skipun.\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n #: t/t0200/test.c:9\ndiff --git a/t/t0200-gettext-basic.sh b/t/t0200-gettext-basic.sh\nindex 522338d..3846ea8 100755\n--- a/t/t0200-gettext-basic.sh\n+++ b/t/t0200-gettext-basic.sh\n@@ -66,10 +66,10 @@ test_expect_success GETTEXT_LOCALE 'sanity: gettext(unknown) is passed through'\n test_expect_success GETTEXT_LOCALE 'xgettext: C extraction of _() and N_() strings' '\n     printf \"TILRAUN: C tilraunastrengur\" >expect &&\n     printf \"\\n\" >>expect &&\n-    printf \"Sjá git help SKIPUN til að sjá hjálp fyrir tiltekna skipun.\" >>expect &&\n+    printf \"Sjá '\\''git help SKIPUN'\\'' til að sjá hjálp fyrir tiltekna skipun.\" >>expect &&\n     LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: A C test string\" >actual &&\n     printf \"\\n\" >>actual &&\n-    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"See git help COMMAND for more information on a specific command.\" >>actual &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"See '\\''git help COMMAND'\\'' for more information on a specific command.\" >>actual &&\n     test_cmp expect actual\n '\n \n-- \n1.7.2.2.536.g3f548\n"},{"id":"149371","messageId":"1283203703-26923-11-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 10/17] gettext tests: add detection for is_IS.ISO-8859-1 locale","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:16Z","receivedAt":"2010-08-30T21:28:16Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a GETTEXT_ISO_LOCALE prerequisite to lib-gettext.sh, it'll be set\nif we have an is_IS.ISO-8859-1 locale.\n\nThis is needed for an upcoming test that checks if our gettext library\ncan recode our UTF-8 po/is.po to is_IS.ISO-8859-1 on request.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/lib-gettext.sh |   26 +++++++++++++++++++++++---\n 1 files changed, 23 insertions(+), 3 deletions(-)\n\ndiff --git a/t/lib-gettext.sh b/t/lib-gettext.sh\nindex f0cdd3d..4570ead 100644\n--- a/t/lib-gettext.sh\n+++ b/t/lib-gettext.sh\n@@ -18,9 +18,15 @@ then\n \t\tp\n \t\tq\n \t}')\n-\t# Export it as an environmental variable so the t0202/test.pl Perl\n-\t# test can use it too\n-\texport is_IS_locale\n+\t# is_IS.ISO8859-1 on Solaris and FreeBSD, is_IS.iso88591 on Debian\n+\tis_IS_iso_locale=$(locale -a | sed -n '/^is_IS\\.[iI][sS][oO]8859-*1$/{\n+\t\tp\n+\t\tq\n+\t}')\n+\n+\t# Export them as an environmental variable so the t0202/test.pl\n+\t# Perl test can use it too\n+\texport is_IS_locale is_IS_iso_locale\n \n \tif test -n \"$is_IS_locale\" &&\n \t\ttest $GIT_INTERNAL_GETTEXT_SH_SCHEME != \"fallthrough\"\n@@ -35,6 +41,20 @@ then\n \telse\n \t\tsay \"# lib-gettext: No is_IS UTF-8 locale available\"\n \tfi\n+\n+\tif test -n \"$is_IS_iso_locale\" &&\n+\t\ttest $GIT_INTERNAL_GETTEXT_SH_SCHEME != \"fallthrough\"\n+\tthen\n+\t\t# Some of the tests need the reference Icelandic locale\n+\t\ttest_set_prereq GETTEXT_ISO_LOCALE\n+\n+\t\t# Exporting for t0202/test.pl\n+\t\tGETTEXT_ISO_LOCALE=1\n+\t\texport GETTEXT_ISO_LOCALE\n+\t\tsay \"# lib-gettext: Found '$is_IS_iso_locale' as a is_IS ISO-8859-1 locale\"\n+\telse\n+\t\tsay \"# lib-gettext: No is_IS ISO-8859-1 locale available\"\n+\tfi\n else\n \t# Only run some tests when we don't have gettext support\n \ttest_set_prereq NO_GETTEXT\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149380","messageId":"1283203703-26923-12-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 11/17] gettext tests: test message re-encoding under Shell","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:17Z","receivedAt":"2010-08-30T21:28:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Our PO files are written in UTF-8, but We're not using\nsetlocale(LC_CTYPE, \"\") so it's not a given that someone with e.g. a\nISO-8859-1 locale will get messages in ISO-8859-1, and not UTF-8.\n\nIntroduce a new test to test for this, it uses the recently added\nGETTEXT_ISO_LOCALE prerequisite.\n\nThis patch only tests the shellscript portion of our gettext\ninterface. I can't get any of these tests to fail on any of the\ngettext implementations I have around, even without the previous patch\nto gettext.c. But having exhaustive tests in this area is good\nregardless.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/is.po                           |   12 ++++++++++\n t/t0200/test.c                     |    6 +++++\n t/t0204-gettext-reencode-sanity.sh |   43 ++++++++++++++++++++++++++++++++++++\n 3 files changed, 61 insertions(+), 0 deletions(-)\n create mode 100755 t/t0204-gettext-reencode-sanity.sh\n\ndiff --git a/po/is.po b/po/is.po\nindex 2f3a220..39b63b9 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -25,6 +25,18 @@ msgid \"TEST: A C test string %s\"\n msgstr \"TILRAUN: C tilraunastrengur %s\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:15\n+#, c-format\n+msgid \"TEST: Hello World!\"\n+msgstr \"TILRAUN: Halló Heimur!\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:18\n+#, c-format\n+msgid \"TEST: Old English Runes\"\n+msgstr \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n #: t/t0200/test.sh:8\n msgid \"TEST: A Shell test string\"\n msgstr \"TILRAUN: Skeljartilraunastrengur\"\ndiff --git a/t/t0200/test.c b/t/t0200/test.c\nindex 93373b3..82682dc 100644\n--- a/t/t0200/test.c\n+++ b/t/t0200/test.c\n@@ -10,4 +10,10 @@ int main(void)\n \n \t/* TRANSLATORS: This is a test. You don't need to translate it. */\n \tprintf(_(\"TEST: A C test string %s\"), \"variable\");\n+\n+\t/* TRANSLATORS: This is a test. You don't need to translate it. */\n+\tprintf(_(\"TEST: Hello World!\"));\n+\n+\t/* TRANSLATORS: This is a test. You don't need to translate it. */\n+\tprintf(_(\"TEST: Old English Runes\"));\n }\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nnew file mode 100755\nindex 0000000..3222e37\n--- /dev/null\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -0,0 +1,43 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+#\n+\n+test_description=\"Gettext reencoding of our *.po/*.mo files works\"\n+\n+. ./lib-gettext.sh\n+\n+\n+test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic' '\n+    printf \"TILRAUN: Halló Heimur!\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: Hello World!\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes' '\n+    printf \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: Old English Runes\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic' '\n+    printf \"TILRAUN: Halló Heimur!\" | iconv -f UTF-8 -t ISO8859-1 >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Hello World!\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n+    LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English Runes\" >runes &&\n+\n+\tif grep \"^TEST: Old English Runes$\" runes\n+\tthen\n+\t\tsay \"Your system can not handle this complexity and returns the string as-is\"\n+\telse\n+\t\t# Both Solaris and GNU libintl will return this stream of\n+\t\t# question marks, so it is s probably portable enough\n+\t\tprintf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\" >runes-expect &&\n+\t\ttest_cmp runes-expect runes\n+\tfi\n+'\n+\n+test_done\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149376","messageId":"1283203703-26923-13-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 12/17] gettext tests: test re-encoding with a UTF-8 msgid under Shell","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:18Z","receivedAt":"2010-08-30T21:28:18Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"A test that tests that calling gettext on a UTF-8 msgid works, and\nthat recoding the resulting string works too.\n\nThis test uses the --from-code=UTF-8 xgettext(1) argument introduced\nin an earlier patch.\n\nThis patch only tests the shellscript portion of our gettext\ninterface. I can't get any of these tests to fail on any of the\ngettext implementations I have around, even without the previous patch\nto gettext.c. But having exhaustive tests in this area is good\nregardless.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/is.po                           |    6 ++++++\n t/t0200/test.c                     |    3 +++\n t/t0204-gettext-reencode-sanity.sh |   21 +++++++++++++++++++++\n 3 files changed, 30 insertions(+), 0 deletions(-)\n\ndiff --git a/po/is.po b/po/is.po\nindex 39b63b9..dfa3804 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -37,6 +37,12 @@ msgid \"TEST: Old English Runes\"\n msgstr \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:21\n+#, c-format\n+msgid \"TEST: ‘single’ and “double” quotes\"\n+msgstr \"TILRAUN: ‚einfaldar‘ og „tvöfaldar“ gæsalappir\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n #: t/t0200/test.sh:8\n msgid \"TEST: A Shell test string\"\n msgstr \"TILRAUN: Skeljartilraunastrengur\"\ndiff --git a/t/t0200/test.c b/t/t0200/test.c\nindex 82682dc..ff15c2f 100644\n--- a/t/t0200/test.c\n+++ b/t/t0200/test.c\n@@ -16,4 +16,7 @@ int main(void)\n \n \t/* TRANSLATORS: This is a test. You don't need to translate it. */\n \tprintf(_(\"TEST: Old English Runes\"));\n+\n+\t/* TRANSLATORS: This is a test. You don't need to translate it. */\n+\tprintf(_(\"TEST: ‘single’ and “double” quotes\"));\n }\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nindex 3222e37..1a7ea37 100755\n--- a/t/t0204-gettext-reencode-sanity.sh\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -40,4 +40,25 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT\n \tfi\n '\n \n+test_expect_success GETTEXT_LOCALE 'gettext: Fetching a UTF-8 msgid -> UTF-8' '\n+    printf \"TILRAUN: ‚einfaldar‘ og „tvöfaldar“ gæsalappir\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: ‘single’ and “double” quotes\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+# How these quotes get transliterated depends on the gettext implementation:\n+#\n+#   Debian:  ,einfaldar' og ,,tvöfaldar\" [GNU libintl]\n+#   FreeBSD: `einfaldar` og \"tvöfaldar\"  [GNU libintl]\n+#   Solaris: ?einfaldar? og ?tvöfaldar?  [Solaris libintl]\n+#\n+# Just make sure the contents are transliterated, and don't use grep -q\n+# so that these differences are emitted under --verbose for curious\n+# eyes.\n+test_expect_success GETTEXT_ISO_LOCALE 'gettext: Fetching a UTF-8 msgid -> ISO-8859-1' '\n+    LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: ‘single’ and “double” quotes\" >actual &&\n+    grep \"einfaldar\" actual &&\n+    grep \"$(echo tvöfaldar | iconv -f UTF-8 -t ISO8859-1)\" actual\n+'\n+\n test_done\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149372","messageId":"1283203703-26923-14-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 13/17] gettext tests: mark a test message as not needing translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:19Z","receivedAt":"2010-08-30T21:28:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This was the only message in t/t0200/* that didn't have a TRANSLATORS\ncomment, without it translators will waste time translating this\nneedlessly.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t0200/test.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t0200/test.c b/t/t0200/test.c\nindex ff15c2f..584d45c 100644\n--- a/t/t0200/test.c\n+++ b/t/t0200/test.c\n@@ -1,6 +1,7 @@\n /* This is a phony C program that's only here to test xgettext message extraction */\n \n const char help[] =\n+\t/* TRANSLATORS: This is a test. You don't need to translate it. */\n \tN_(\"See 'git help COMMAND' for more information on a specific command.\");\n \n int main(void)\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149374","messageId":"1283203703-26923-15-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 14/17] po/is.po: msgmerge and add Language: header","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:20Z","receivedAt":"2010-08-30T21:28:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change is.po to use the header order added by msgmerge(1), this'll\nmake subsequent diffs to it smaller and easier to manage. While I'm at\nit add a Language header indicating that the file is in\nIcelandic.\n\nWhen we add more *.po files later we should add a Language header to\nthose as well.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/is.po |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/po/is.po b/po/is.po\nindex dfa3804..3bbfb97 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -1,10 +1,12 @@\n msgid \"\"\n msgstr \"\"\n \"Project-Id-Version: Git\\n\"\n-\"PO-Revision-Date: 2010-06-05 19:06 +0000\\n\"\n-\"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n \"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"POT-Creation-Date: 2010-08-28 17:38+0000\\n\"\n+\"PO-Revision-Date: 2010-08-28 17:27+0000\\n\"\n \"Last-Translator: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\\n\"\n+\"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"Language: is\\n\"\n \"MIME-Version: 1.0\\n\"\n \"Content-Type: text/plain; charset=UTF-8\\n\"\n \"Content-Transfer-Encoding: 8bit\\n\"\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149378","messageId":"1283203703-26923-16-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 15/17] po/is.po: add Icelandic translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:21Z","receivedAt":"2010-08-30T21:28:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate the non-TEST messages added in recent patches against\ninit-db.c. This brings Icelandic translation coverage up to 100%.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/is.po |  135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----\n 1 files changed, 127 insertions(+), 8 deletions(-)\n\ndiff --git a/po/is.po b/po/is.po\nindex 3bbfb97..5a35f0a 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -2,8 +2,8 @@ msgid \"\"\n msgstr \"\"\n \"Project-Id-Version: Git\\n\"\n \"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n-\"POT-Creation-Date: 2010-08-28 17:38+0000\\n\"\n-\"PO-Revision-Date: 2010-08-28 17:27+0000\\n\"\n+\"POT-Creation-Date: 2010-08-30 18:16+0000\\n\"\n+\"PO-Revision-Date: 2010-08-28 19:25+0000\\n\"\n \"Last-Translator: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\\n\"\n \"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n \"Language: is\\n\"\n@@ -11,35 +11,154 @@ msgstr \"\"\n \"Content-Type: text/plain; charset=UTF-8\\n\"\n \"Content-Transfer-Encoding: 8bit\\n\"\n \n-#: t/t0200/test.c:4\n+#: builtin/init-db.c:34\n+#, c-format\n+msgid \"Could not make %s writable by group\"\n+msgstr \"Gat ekki gert %s skrifanlega af hóp\"\n+\n+#: builtin/init-db.c:61\n+#, c-format\n+msgid \"insanely long template name %s\"\n+msgstr \"brjálæðislega langt sniðsnafn %s\"\n+\n+#: builtin/init-db.c:66\n+#, c-format\n+msgid \"cannot stat '%s'\"\n+msgstr \"gat ekki stat-að '%s'\"\n+\n+#: builtin/init-db.c:72\n+#, c-format\n+msgid \"cannot stat template '%s'\"\n+msgstr \"gat ekki stat-að sniðið '%s'\"\n+\n+#: builtin/init-db.c:79\n+#, c-format\n+msgid \"cannot opendir '%s'\"\n+msgstr \"gat ekki opnað móppuna '%s'\"\n+\n+#: builtin/init-db.c:96\n+#, c-format\n+msgid \"cannot readlink '%s'\"\n+msgstr \"gat ekki lesið tengilinn '%s'\"\n+\n+#: builtin/init-db.c:98\n+#, c-format\n+msgid \"insanely long symlink %s\"\n+msgstr \"brjálæðislega langur tengill %s\"\n+\n+#: builtin/init-db.c:101\n+#, c-format\n+msgid \"cannot symlink '%s' '%s'\"\n+msgstr \"gat ekki búið til tengilinn '%s' '%s'\"\n+\n+#: builtin/init-db.c:105\n+#, c-format\n+msgid \"cannot copy '%s' to '%s'\"\n+msgstr \"gat ekki afritað '%s' til '%s'\"\n+\n+#: builtin/init-db.c:109\n+#, c-format\n+msgid \"ignoring template %s\"\n+msgstr \"hunsa sniðið %s\"\n+\n+#: builtin/init-db.c:132\n+#, c-format\n+msgid \"insanely long template path %s\"\n+msgstr \"brjálæðislega löng slóð á snið %s\"\n+\n+#: builtin/init-db.c:140\n+#, c-format\n+msgid \"templates not found %s\"\n+msgstr \"sniðið fannst ekki %s\"\n+\n+#: builtin/init-db.c:153\n+#, c-format\n+msgid \"not copying templates of a wrong format version %d from '%s'\"\n+msgstr \"aftira ekki sniðin vegna rangar útgáfu %d frá '%s'\"\n+\n+#: builtin/init-db.c:191\n+#, c-format\n+msgid \"insane git directory %s\"\n+msgstr \"brjálúð git mappa %s\"\n+\n+#. TRANSLATORS: The first '%s' is either \"Reinitialized\n+#. existing\" or \"Initialized empty\", the second \" shared\" or\n+#. \"\", and the last '%s%s' is the verbatim directory name.\n+#: builtin/init-db.c:355\n+#, c-format\n+msgid \"%s%s Git repository in %s%s\\n\"\n+msgstr \"%s%s Git lind í %s%s\\n\"\n+\n+#: builtin/init-db.c:356\n+msgid \"Reinitialized existing\"\n+msgstr \"Endurgerði\"\n+\n+#: builtin/init-db.c:356\n+msgid \"Initialized empty\"\n+msgstr \"Bjó til tóma\"\n+\n+#: builtin/init-db.c:357\n+msgid \" shared\"\n+msgstr \" sameiginlega\"\n+\n+#: builtin/init-db.c:376\n+msgid \"cannot tell cwd\"\n+msgstr \"finn ekki núverandi möppu\"\n+\n+#: builtin/init-db.c:450 builtin/init-db.c:457\n+#, c-format\n+msgid \"cannot mkdir %s\"\n+msgstr \"gat ekki búið til möppuna %s\"\n+\n+#: builtin/init-db.c:461\n+#, c-format\n+msgid \"cannot chdir to %s\"\n+msgstr \"get ekki farið inn í möppuna %s\"\n+\n+#: builtin/init-db.c:483\n+#, c-format\n+msgid \"%s (or --work-tree=<directory>) not allowed without specifying %s (or --git-dir=<directory>)\"\n+msgstr \"%s (eða --work-tree=<mappa>) ekki leyfilegt ásamt %s (eða --git-dir=<mappa>)\"\n+\n+#: builtin/init-db.c:509\n+msgid \"Cannot access current working directory\"\n+msgstr \"Get ekki opnað núverandi vinnumöppu\"\n+\n+#: builtin/init-db.c:512\n+#, c-format\n+msgid \"Cannot access work tree '%s'\"\n+msgstr \"Get ekki opnað vinnutré '%s'\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:5\n msgid \"See 'git help COMMAND' for more information on a specific command.\"\n msgstr \"Sjá 'git help SKIPUN' til að sjá hjálp fyrir tiltekna skipun.\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n-#: t/t0200/test.c:9\n+#: t/t0200/test.c:10\n msgid \"TEST: A C test string\"\n msgstr \"TILRAUN: C tilraunastrengur\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n-#: t/t0200/test.c:12\n+#: t/t0200/test.c:13\n #, c-format\n msgid \"TEST: A C test string %s\"\n msgstr \"TILRAUN: C tilraunastrengur %s\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n-#: t/t0200/test.c:15\n+#: t/t0200/test.c:16\n #, c-format\n msgid \"TEST: Hello World!\"\n msgstr \"TILRAUN: Halló Heimur!\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n-#: t/t0200/test.c:18\n+#: t/t0200/test.c:19\n #, c-format\n msgid \"TEST: Old English Runes\"\n msgstr \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n-#: t/t0200/test.c:21\n+#: t/t0200/test.c:22\n #, c-format\n msgid \"TEST: ‘single’ and “double” quotes\"\n msgstr \"TILRAUN: ‚einfaldar‘ og „tvöfaldar“ gæsalappir\"\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149377","messageId":"1283203703-26923-17-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 16/17] po/pl.po: add Polish translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:22Z","receivedAt":"2010-08-30T21:28:22Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Marcin Cieślak <saper@saper.info>\n\nTranslate all the translatable messages currently in Git, except for\nthe 10 TEST messages that shouldn't be translated.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Marcin Cieślak <saper@saper.info>\n---\n po/pl.po |  187 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 187 insertions(+), 0 deletions(-)\n create mode 100644 po/pl.po\n\ndiff --git a/po/pl.po b/po/pl.po\nnew file mode 100644\nindex 0000000..dfdd416\n--- /dev/null\n+++ b/po/pl.po\n@@ -0,0 +1,187 @@\n+msgid \"\"\n+msgstr \"\"\n+\"Project-Id-Version: Git\\n\"\n+\"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"POT-Creation-Date: 2010-08-30 18:16+0000\\n\"\n+\"PO-Revision-Date: 2010-08-30 17:02+0200\\n\"\n+\"Last-Translator: Marcin Cieślak <saper@saper.info>\\n\"\n+\"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"Language: pl\\n\"\n+\"MIME-Version: 1.0\\n\"\n+\"Content-Type: text/plain; charset=UTF-8\\n\"\n+\"Content-Transfer-Encoding: 8bit\\n\"\n+\"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\\n\"\n+\n+#: builtin/init-db.c:34\n+#, c-format\n+msgid \"Could not make %s writable by group\"\n+msgstr \"Nie mogę dać prawa zapisu grupie w %s\"\n+\n+#: builtin/init-db.c:61\n+#, c-format\n+msgid \"insanely long template name %s\"\n+msgstr \"beznadziejnie długa nazwa szablonu %s\"\n+\n+#: builtin/init-db.c:66\n+#, c-format\n+msgid \"cannot stat '%s'\"\n+msgstr \"nie mogę tknąć '%s'\"\n+\n+#: builtin/init-db.c:72\n+#, c-format\n+msgid \"cannot stat template '%s'\"\n+msgstr \"nie mogę tknąć szablonu '%s'\"\n+\n+#: builtin/init-db.c:79\n+#, c-format\n+msgid \"cannot opendir '%s'\"\n+msgstr \"nie mogę otworzyć katalogu '%s'\"\n+\n+#: builtin/init-db.c:96\n+#, c-format\n+msgid \"cannot readlink '%s'\"\n+msgstr \"readlink nie zadziałało dla '%s'\"\n+\n+#: builtin/init-db.c:98\n+#, c-format\n+msgid \"insanely long symlink %s\"\n+msgstr \"beznadziejnie długi link symboliczny %s\"\n+\n+#: builtin/init-db.c:101\n+#, c-format\n+msgid \"cannot symlink '%s' '%s'\"\n+msgstr \"nie mogę założyć symbolicznego link z '%s' do '%s'\"\n+\n+#: builtin/init-db.c:105\n+#, c-format\n+msgid \"cannot copy '%s' to '%s'\"\n+msgstr \"nie mogę skopiować '%s' to '%s'\"\n+\n+#: builtin/init-db.c:109\n+#, c-format\n+msgid \"ignoring template %s\"\n+msgstr \"pomijam szablon %s\"\n+\n+#: builtin/init-db.c:132\n+#, c-format\n+msgid \"insanely long template path %s\"\n+msgstr \"beznadziejnie długa śieżka do wzorca %s\"\n+\n+#: builtin/init-db.c:140\n+#, c-format\n+msgid \"templates not found %s\"\n+msgstr \"nie znaleziono szablonów %s\"\n+\n+#: builtin/init-db.c:153\n+#, c-format\n+msgid \"not copying templates of a wrong format version %d from '%s'\"\n+msgstr \"nie będę kopiować szablonów oznaczonych niewłaściwym numerem wersji %d z '%s'\"\n+\n+#: builtin/init-db.c:191\n+#, c-format\n+msgid \"insane git directory %s\"\n+msgstr \"beznadziejny katalog gita %s\"\n+\n+#. TRANSLATORS: The first '%s' is either \"Reinitialized\n+#. existing\" or \"Initialized empty\", the second \" shared\" or\n+#. \"\", and the last '%s%s' is the verbatim directory name.\n+#: builtin/init-db.c:355\n+#, c-format\n+msgid \"%s%s Git repository in %s%s\\n\"\n+msgstr \"%s%s repozytorium Gita w %s%s\\n\"\n+\n+#: builtin/init-db.c:356\n+msgid \"Reinitialized existing\"\n+msgstr \"Ponownie zainicjowałem istniejące\"\n+\n+#: builtin/init-db.c:356\n+msgid \"Initialized empty\"\n+msgstr \"Utworzyłem puste\"\n+\n+#: builtin/init-db.c:357\n+msgid \" shared\"\n+msgstr \" współdzielone\"\n+\n+#: builtin/init-db.c:376\n+msgid \"cannot tell cwd\"\n+msgstr \"nie wiem w którym katalogu jestem\"\n+\n+#: builtin/init-db.c:450 builtin/init-db.c:457\n+#, c-format\n+msgid \"cannot mkdir %s\"\n+msgstr \"nie mogę utworzyć katalogu %s\"\n+\n+#: builtin/init-db.c:461\n+#, c-format\n+msgid \"cannot chdir to %s\"\n+msgstr \"nie mogę wejść do katalogu %s\"\n+\n+#: builtin/init-db.c:483\n+#, c-format\n+msgid \"%s (or --work-tree=<directory>) not allowed without specifying %s (or --git-dir=<directory>)\"\n+msgstr \"nie można użyć %s (or --work-tree=<katalog>) bez podania %s (or --git-dir=<katalog>)\"\n+\n+#: builtin/init-db.c:509\n+msgid \"Cannot access current working directory\"\n+msgstr \"Nie mogę dobrać się do bieżącego katalogu\"\n+\n+#: builtin/init-db.c:512\n+#, c-format\n+msgid \"Cannot access work tree '%s'\"\n+msgstr \"Nie mogę dostać się do drzewa roboczego '%s'\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:5\n+msgid \"See 'git help COMMAND' for more information on a specific command.\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:10\n+msgid \"TEST: A C test string\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:13\n+#, c-format\n+msgid \"TEST: A C test string %s\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:16\n+#, c-format\n+msgid \"TEST: Hello World!\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:19\n+#, c-format\n+msgid \"TEST: Old English Runes\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.c:22\n+#, c-format\n+msgid \"TEST: ‘single’ and “double” quotes\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.sh:8\n+msgid \"TEST: A Shell test string\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.sh:11\n+#, sh-format\n+msgid \"TEST: A Shell test $variable\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.perl:8\n+msgid \"TEST: A Perl test string\"\n+msgstr \"\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#: t/t0200/test.perl:11\n+#, perl-format\n+msgid \"TEST: A Perl test variable %s\"\n+msgstr \"\"\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149370","messageId":"1283203703-26923-18-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 17/17] gettext tests: test message re-encoding under C","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-30T21:28:23Z","receivedAt":"2010-08-30T21:28:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add tests for message re-encoding under C. Unlike the Shell tests\nthese tests will break under GNU libintl if the recent patch to\ngettext.c is reverted. So this serves as a regression test for that\nissue.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t0204-gettext-reencode-sanity.sh |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nindex 1a7ea37..189af90 100755\n--- a/t/t0204-gettext-reencode-sanity.sh\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -61,4 +61,18 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Fetching a UTF-8 msgid -> ISO-8\n     grep \"$(echo tvöfaldar | iconv -f UTF-8 -t ISO8859-1)\" actual\n '\n \n+test_expect_success GETTEXT_LOCALE 'gettext.c: git init UTF-8 -> UTF-8' '\n+    printf \"Bjó til tóma Git lind\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" git init repo >actual &&\n+    test_when_finished \"rm -rf repo\" &&\n+    grep \"^$(cat expect) \" actual\n+'\n+\n+test_expect_success GETTEXT_ISO_LOCALE 'gettext.c: git init UTF-8 -> ISO-8859-1' '\n+    printf \"Bjó til tóma Git lind\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" git init repo >actual &&\n+    test_when_finished \"rm -rf repo\" &&\n+    grep \"^$(cat expect | iconv -f UTF-8 -t ISO8859-1) \" actual\n+'\n+\n test_done\n-- \n1.7.2.2.536.g3f548\n"},{"id":"149382","messageId":"7v39tveq0j.fsf@alter.siamese.dyndns.org","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-08-30T21:42:36Z","receivedAt":"2010-08-30T21:42:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> Now that Git has the infrastructure for translation in next I'm going\n> to start submitting patches to make the main porcelain translatable.\n>\n> This series starts that work, and fixes and also fixes up some of the\n> infrastructure (like the bug discussed in \"Odd encoding issue with\n> UTF-8 + gettext yields ? on non-ASCII\"), and adds tests to make sure\n> it's all working.\n>\n> With it applied git-init is the one and only utility of the porcelain\n> that's translatable. The series includes a translation of it into\n> Icelandic and Polish.\n>\n> I think it's ready to be applied. I tested it on Solaris, FreeBSD and\n> Debian. But there's almost definitely something I'm missing in a\n> series this big, so it's an RFC.\n\nThanks; will queue them.\n\nI however strongly suspect that we would be better off first kicking the\nearlier parts of i18n topic out of 'next' back to 'pu', as I am hoping\nthat we can declare feature freeze for 1.7.3 by the end of this week at\nthe latest, and you can never tell if we got the \"infrastructure\" right\nwithout playing with a real \"user of the infrastructure\" like this 17\npatch series, which means that the part of i18n topic that is already in\n'next' cannot be part of 1.7.3 --- it is way premature.\n\nIt was somewhat unfortunate and sad that your \"test\" series depended on a\nfew patches from the i18n series, which means it is now taken hostage to\nthe latter.  I'd rather want to have the \"test\" series in the 1.7.3, and\nwe need to think about a way to untangle the two topics.\n"},{"id":"149403","messageId":"1283245326-26108-1-git-send-email-avarab@gmail.com","threadId":"24916","inReplyTo":"7v39tveq0j.fsf@alter.siamese.dyndns.org","subject":"[PATCH] gettext: Make NO_GETTEXT=YesPlease the default in releases","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T09:02:06Z","receivedAt":"2010-08-31T09:02:06Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the Git build process so that gettext is no longer built by\ndefault as part of Git releases, and include a loud warning to\ndownstream distributors in INSTALL saying that they shouldn't enable\nit.\n\nWe're still working out the details of the gettext infrastructure and\ncurrently only a small portion of Git can be translated, so it's\npremature to enable it by default.\n\nHowever it's painful for everyone if the source changes needed for\ngettext can't be made in pu without conflicting with other series that\napply to maint/master/next.\n\nWhen gettext is disabled the whole functionality basically boils down\nto this macro definition (or Shell and Perl equivalents) and a few\nskipping tests:\n\n    #define _(s) (s)\n\nSo it's a lot less to get right than if we were enabling it by\ndefault.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nOn Mon, Aug 30, 2010 at 21:42, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> Now that Git has the infrastructure for translation in next I'm going\n>> to start submitting patches to make the main porcelain translatable.\n>>\n>> This series starts that work, and fixes and also fixes up some of the\n>> infrastructure (like the bug discussed in \"Odd encoding issue with\n>> UTF-8 + gettext yields ? on non-ASCII\"), and adds tests to make sure\n>> it's all working.\n>>\n>> With it applied git-init is the one and only utility of the porcelain\n>> that's translatable. The series includes a translation of it into\n>> Icelandic and Polish.\n>>\n>> I think it's ready to be applied. I tested it on Solaris, FreeBSD and\n>> Debian. But there's almost definitely something I'm missing in a\n>> series this big, so it's an RFC.\n>\n> Thanks; will queue them.\n\nThanks!\n\n> I however strongly suspect that we would be better off first kicking the\n> earlier parts of i18n topic out of 'next' back to 'pu', as I am hoping\n> that we can declare feature freeze for 1.7.3 by the end of this week at\n> the latest, and you can never tell if we got the \"infrastructure\" right\n> without playing with a real \"user of the infrastructure\" like this 17\n> patch series, which means that the part of i18n topic that is already in\n> 'next' cannot be part of 1.7.3 --- it is way premature.\n\nI definitely agree that it's premature at this point, if for no other\nreason than that I'll never be able to make most of the main-porcelain\ntranslatable by the end of the week.\n\nHowever, there's another way to do this. Simply disable it by default\nin releases. Which this patch implements.\n\nI considered the possibility that we might want to disable it in\nselect branches when I wrote it, so it's easy to do so. And IMO a\nbetter option due to the reasons cited in the commit message attached\nto the PATCH.\n\n> It was somewhat unfortunate and sad that your \"test\" series depended on a\n> few patches from the i18n series, which means it is now taken hostage to\n> the latter.  I'd rather want to have the \"test\" series in the 1.7.3, and\n> we need to think about a way to untangle the two topics.\n\nYeah I wasn't very careful about keeping the bits already in pu\nseparate. Untangling them shouldn't be that hard though, but hopefully\nwith this patch we won't have to go that route.\n\n INSTALL      |   17 +++++++++++++++--\n Makefile     |    4 ++++\n configure.ac |    2 +-\n 3 files changed, 20 insertions(+), 3 deletions(-)\n\ndiff --git a/INSTALL b/INSTALL\nindex e4e7506..aa477e2 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -93,8 +93,21 @@ Issues of note:\n \t  history graphically, and in git-gui.  If you don't want gitk or\n \t  git-gui, you can use NO_TCLTK.\n \n-\t- A gettext library is used by default for localizing Git. The\n-\t  primary target is GNU libintl, but the Solaris gettext\n+\t- Git includes EXPERIMENTAL support for localization with gettext\n+\t  which is currently disabled by default in official Git\n+\t  releases.\n+\n+\t  If you really want to build it you have to specify NO_GETTEXT=\n+\t  as a Makefile argument. If you're a downstream distributor\n+\t  please don't do so without consulting with the Git Mailing List\n+\t  first about the stability of this feature.\n+\n+\t  It's only being included in releases so that source messages can\n+\t  be marked for translation without resulting in painful and\n+\t  inevitable merge conflicts between Git's pu branch and the\n+\t  rest. END WARNING.\n+\n+\t  The primary target is GNU libintl, but the Solaris gettext\n \t  implementation also works.\n \n \t  We need a gettext.h on the system for C code, gettext.sh (or\ndiff --git a/Makefile b/Makefile\nindex 9818a59..bd61a5b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -272,6 +272,10 @@ ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n STRIP ?= strip\n \n+# Disable gettext by default in releases while the implementation is\n+# settling\n+NO_GETTEXT = YesPleaseForNow\n+\n # Among the variables below, these:\n #   gitexecdir\n #   template_dir\ndiff --git a/configure.ac b/configure.ac\nindex 1821d89..c9b0265 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -806,7 +806,7 @@ AC_SUBST(HAVE_PATHS_H)\n #\n # Define NO_GETTEXT if you don't have libintl.h\n AC_CHECK_HEADER([libintl.h],\n-[NO_GETTEXT=],\n+[NO_GETTEXT=HaveItButYesPlease],\n [NO_GETTEXT=YesPlease])\n AC_SUBST(NO_GETTEXT)\n #\n-- \n1.7.2.2.535.g1333f.dirty\n"},{"id":"149407","messageId":"alpine.DEB.2.00.1008311205280.28446@ds9.cixit.se","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Peter Krefting","fromEmail":"peter@softwolves.pp.se","sentAt":"2010-08-31T11:08:13Z","receivedAt":"2010-08-31T11:08:13Z","isPatch":true,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Ævar Arnfjörð Bjarmason:\n\n> With it applied git-init is the one and only utility of the porcelain \n> that's translatable. The series includes a translation of it into \n> Icelandic and Polish.\n\nVery interesting. I would like to contribute a Swedish translation as time \npermits.\n\nAny chance the translations could be co-ordinated through Translation \nProject <URL:http://translationproject.org/>? I know I suggested this, and \nwas turned down, for gitk and git-gui, but this translation is potentially \nlarger and could benefit from the co-ordinated effort.\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"149408","messageId":"AANLkTikuQZpOjddgHtpSpw-P4AeL1swsrzJzd5cE7e8F@mail.gmail.com","threadId":"24916","inReplyTo":"alpine.DEB.2.00.1008311205280.28446@ds9.cixit.se","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T11:42:38Z","receivedAt":"2010-08-31T11:42:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 11:08, Peter Krefting <peter@softwolves.pp.se> wrote:\n> Ævar Arnfjörð Bjarmason:\n>\n>> With it applied git-init is the one and only utility of the porcelain\n>> that's translatable. The series includes a translation of it into Icelandic\n>> and Polish.\n>\n> Very interesting. I would like to contribute a Swedish translation as time\n> permits.\n\nGreat!\n\n> Any chance the translations could be co-ordinated through Translation\n> Project <URL:http://translationproject.org/>? I know I suggested this, and\n> was turned down, for gitk and git-gui, but this translation is potentially\n> larger and could benefit from the co-ordinated effort.\n\nSomething like that would be welcome. Personally I'm happy with\nediting *.po files locally with Emacs's po-mode, but to get more\ntranslators we probably want a friendly web interface like that at\nsome point. Preferably with an active translation community.\n\nI meant to look at this myself at some point, but if you could help\nthat'd be great!\n\nThe only reference I could find to a previous git +\ntranslationproject.org discussion was this:\nhttp://kerneltrap.org/mailarchive/git/2008/3/14/1163164 Is that the\none you're talking about?\n\nI've used Launchpad somewhat for translating and it's friendly to\ncontributors & has an active community, but it seems to require that\nwe BSD-license our translations[1], which would be a showstopper since\nwe'd have to contact everyone who's been submitting GPL-2-only strings\nto Git for the last 5 years.\n\nTranslationproject seems to have a similar requirement[2], but they\nseem require you to send a letter to the FSF through snail mail before\nyou can contribute (maybe not, I didn't read all their docs\ncarefully). That would be a major hurdle to casual contributors.\n\n1. https://help.launchpad.net/Translations/LicensingFAQ\n2. http://translationproject.org/disclaim.txt\n"},{"id":"149409","messageId":"alpine.DEB.2.00.1008311244420.28446@ds9.cixit.se","threadId":"24916","inReplyTo":"AANLkTikuQZpOjddgHtpSpw-P4AeL1swsrzJzd5cE7e8F@mail.gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Peter Krefting","fromEmail":"peter@softwolves.pp.se","sentAt":"2010-08-31T11:48:19Z","receivedAt":"2010-08-31T11:48:19Z","isPatch":true,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Ævar Arnfjörð Bjarmason:\n\n> Something like that would be welcome. Personally I'm happy with editing \n> *.po files locally with Emacs's po-mode, but to get more translators we \n> probably want a friendly web interface like that at some point.\n\nWell, it's not a web interface for translating, currently, just for keeping \ntrack on what needs to be translated by whom (and for language teams to find \nwhat to translate). You still edit the PO files in whatever you prefer.\n\n> Preferably with an active translation community.\n\nTranslation Project is indeed very active.\n\n> http://kerneltrap.org/mailarchive/git/2008/3/14/1163164 Is that the\n> one you're talking about?\n\nYes.\n\n> Translationproject seems to have a similar requirement[2], but they seem \n> require you to send a letter to the FSF through snail mail before you can \n> contribute (maybe not, I didn't read all their docs carefully).\n\nOnly when you translate FSF software for which you need to send one of the \nletters that claim that you are handing over copyright to the FSF. That is \nnot needed in this case, and translators working on such projects do not \nneed to send one.\n\n\nFor the project side, you bascially send a POT file every now and then, \nbetween string-freeze and release, and update the PO files that come back \nfrom the project every now and then. I've been using the system from both \nsides and it's lightweight enough to be workable.\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"149410","messageId":"vpqk4n7rnvo.fsf@bauges.imag.fr","threadId":"24916","inReplyTo":"AANLkTikuQZpOjddgHtpSpw-P4AeL1swsrzJzd5cE7e8F@mail.gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-08-31T12:02:35Z","receivedAt":"2010-08-31T12:02:35Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> I've used Launchpad somewhat for translating and it's friendly to\n> contributors & has an active community, but it seems to require that\n> we BSD-license our translations[1], which would be a showstopper since\n> we'd have to contact everyone who's been submitting GPL-2-only strings\n> to Git for the last 5 years.\n\nI don't think so:\n\n,----[ https://help.launchpad.net/Translations/LicensingFAQ ]\n| I have no problem with BSD myself, but I also uploaded translations\n| from upstream. What do I do?\n| \n| As long as the uploads were marked as translations that were published\n| elsewhere, they fall under a separate copyright regime: those imports\n| will retain their original copyright license. The BSD licence only\n| applies to translations that are (as far as the system knows) original\n| to Launchpad.\n`----\n\nSo, my understanding is: Git's code, and strings, would remain what\nthey are, but things contributed _through launchpad_ would be BSD.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"149412","messageId":"AANLkTikAT7AE_7Ln1fCaSQN5Ankm0BusZRBmNrHpPx7N@mail.gmail.com","threadId":"24916","inReplyTo":"vpqk4n7rnvo.fsf@bauges.imag.fr","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T12:43:48Z","receivedAt":"2010-08-31T12:43:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 12:02, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Ęvar Arnfjörš Bjarmason <avarab@gmail.com> writes:\n>\n>> I've used Launchpad somewhat for translating and it's friendly to\n>> contributors & has an active community, but it seems to require that\n>> we BSD-license our translations[1], which would be a showstopper since\n>> we'd have to contact everyone who's been submitting GPL-2-only strings\n>> to Git for the last 5 years.\n>\n> I don't think so:\n>\n> ,----[ https://help.launchpad.net/Translations/LicensingFAQ ]\n> | I have no problem with BSD myself, but I also uploaded translations\n> | from upstream. What do I do?\n> |\n> | As long as the uploads were marked as translations that were published\n> | elsewhere, they fall under a separate copyright regime: those imports\n> | will retain their original copyright license. The BSD licence only\n> | applies to translations that are (as far as the system knows) original\n> | to Launchpad.\n> `----\n>\n> So, my understanding is: Git's code, and strings, would remain what\n> they are, but things contributed _through launchpad_ would be BSD.\n\nAh yes. It seems as if Git's strings and derived works would be marked\nGPL-2. That sounds good. Like I said I hadn't looked in any of this in\ndetail, or the legal issues involved.\n\nAnyway, the main issue with Launchpad that I've had as a\nuser/translator is getting translations back out of the system. To\ndownload a *.po file you have to log in and submit a request for a\n*.po file download. Sometimes it can take hours for you to get a mail\nback.\n\nDownloading a large amount of translations through this system in\nLaunchpad would be very painful. But maybe they have a better API now\nthat we could use.\n"},{"id":"149421","messageId":"20100831145158.GD2315@burratino","threadId":"24916","inReplyTo":"1283203703-26923-2-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 01/17] Makefile: A variable for options used by xgettext(1) calls","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T14:51:58Z","receivedAt":"2010-08-31T14:51:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> +++ b/Makefile\n> @@ -2008,10 +2008,11 @@ cscope:\n>  \t$(RM) cscope*\n>  \t$(FIND) . -name '*.[hcS]' -print | xargs cscope -b\n>  \n> +XGETTEXT_OPTIONS = --add-comments\n>  pot:\n> -\t$(XGETTEXT) --add-comments --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n> -\t$(XGETTEXT) --add-comments --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n> -\t$(XGETTEXT) --add-comments --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl\n> +\t$(XGETTEXT) $(XGETTEXT_OPTIONS) --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n> +\t$(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n> +\t$(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl\n\nThe long lines are a bit scary. :)\n\nMaybe more of it could be pulled out into variables.  As a\nside-effect, users could override some settings from the command line.\nMaybe something like this?\n\n LOCALIZED_C = $(C_OBJ:o=c) t/t0200/test.c\n LOCALIZED_SH = $(SCRIPT_SH) t/t0200/test.sh\n LOCALIZED_PERL = $(SCRIPT_PERL) t/t0200/test.perl\n\n XGETTEXT_OPTIONS = --add-comments\n XGETTEXT_OPTIONS_C = $(XGETTEXT_OPTIONS) -k_ -kN_ -LC\n XGETTEXT_OPTIONS_SH = $(XGETTEXT_OPTIONS) -LShell\n XGETTEXT_OPTIONS_PERL = $(XGETTEXT_OPTIONS) -k__ -LPerl\n\n po/git.pot:\n\trm -f $@+\n\t$(XGETTEXT) -o$@+ $(XGETTEXT_OPTIONS_C) $(LOCALIZED_C)\n\t$(XGETTEXT) -j -o$@+ $(XGETTEXT_OPTIONS_SH) $(LOCALIZED_SH)\n\t$(XGETTEXT) -j -o$@+ $(XGETTEXT_OPTIONS_PERL) $(LOCALIZED_PERL)\n\tmv $@+ $@\n"},{"id":"149422","messageId":"20100831150301.GE2315@burratino","threadId":"24916","inReplyTo":"1283203703-26923-6-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:03:01Z","receivedAt":"2010-08-31T15:03:01Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/init-db.c\n> +++ b/builtin/init-db.c\n> @@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)\n>  \t\t}\n>  \t}\n>  \telse if (share && adjust_shared_perm(dir))\n> -\t\tdie(\"Could not make %s writable by group\", dir);\n> +\t\tdie(_(\"Could not make %s writable by group\"), dir);\n\nSensible.\n\nI wonder if die() should not just be taught to automatically look up\ntranslations for its format string (could gettext handle that?).\n\nAlthough we try not to change plumbing error messages without good\nreason, details of error messages change often enough that imvho\nscripts should not be relying on them.\n\n> -\t\t\t\tdie_errno(\"cannot stat '%s'\", path);\n> +\t\t\t\tdie_errno(_(\"cannot stat '%s'\"), path);\n\nWill strerror() cope correctly without LC_CTYPE set up?  (Not part\nof this series, just something I was reminded of.)\n"},{"id":"149424","messageId":"20100831151044.GF2315@burratino","threadId":"24916","inReplyTo":"1283203703-26923-7-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 06/17] gettext: localize the main git-init message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:10:44Z","receivedAt":"2010-08-31T15:10:44Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Note that the TRANSLATORS comment doesn't use the usual Git\n> style. This is because everything from \"/* TRANSLATORS: \" to \"*/\" will\n> extracted as-is xgettext(1) and presented to translators, including\n> newlines and leading \"*\"'s.\n\nHow would it cope with the following?\n\n\t/* TRANSLATORS:\n\t * The first '%s' is either \"Reinitialized existing\" or\n\t * \"Initialized empty\", the second \" shared\" or \"\", and\n\t * the last '%s%s' is the verbatim directory name.\n\t */\n\nThe leading column of stars makes it easier to distinguish code\nfrom comments.  (Plus I am not too happy to read code with two\ninconsistent comment styles used.)\n"},{"id":"149426","messageId":"20100831151800.GG2315@burratino","threadId":"24916","inReplyTo":"1283203703-26923-8-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, \"\")","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:18:01Z","receivedAt":"2010-08-31T15:18:01Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> In 107880a I removed our use of setlocale(LC_CTYPE, \"\") because of a\n> bug in the GNU C Library [1]\n\nFuture readers might benefit from a reminder that it is vsnprintf that\nis broken.\n\nAside, not about this patch: glibc printf can be very convenient for\ntranslators, because of format strings like \"%4$s\".  Do other common\nplatforms like FreeBSD and Mingw have something similar?\n\n> --- a/gettext.c\n> +++ b/gettext.c\n> @@ -17,5 +19,9 @@ extern void git_setup_gettext(void) {\n>  \t}\n>  \n>  \t(void)setlocale(LC_MESSAGES, \"\");\n> +\t(void)setlocale(LC_CTYPE, \"\");\n> +\tcharset = nl_langinfo(CODESET);\n> +\t(void)bind_textdomain_codeset(\"git\", charset);\n> +\t(void)setlocale(LC_CTYPE, \"C\");\n\nFor the curious: we cannot use\n\n\tsetlocale(LC_CTYPE, \"\");\n\tcharset = nl_langinfo(CODESET);\n\tsetlocale(LC_CTYPE, \"C\");\n\tbind_textdomain_codeset(\"git\", charset);\n\nbecause nl_langinfo returns a pointer to a static buffer that might\nbe wiped out by setlocale() iirc.\n\nThanks.\n"},{"id":"149427","messageId":"20100831152959.GH2315@burratino","threadId":"24916","inReplyTo":"1283203703-26923-16-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 15/17] po/is.po: add Icelandic translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:29:59Z","receivedAt":"2010-08-31T15:29:59Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/po/is.po\n> +++ b/po/is.po\n> @@ -11,35 +11,154 @@ msgstr \"\"\n>  \"Content-Type: text/plain; charset=UTF-8\\n\"\n>  \"Content-Transfer-Encoding: 8bit\\n\"\n>  \n> -#: t/t0200/test.c:4\n> +#: builtin/init-db.c:34\n\nIs there a diff driver that will ignore these --add-location lines?\n\nAlternatively, would it be possible to get msgmerge and xgettext to\nprovide the filenames without the line numbers?  My experience is\nthat most translation diffs are very hard to read because about 80%\nnoise. :(\n\nAside from that, this looks good and sane (well, the English part\nI can read does).\n"},{"id":"149428","messageId":"20100831153214.GI2315@burratino","threadId":"24916","inReplyTo":"1283203703-26923-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:32:14Z","receivedAt":"2010-08-31T15:32:14Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Now that Git has the infrastructure for translation in next I'm going\n> to start submitting patches to make the main porcelain translatable.\n\nI've written some comments on specific patches; the rest looks good\nto me.\n\nThanks for moving this forward.\n"},{"id":"149429","messageId":"AANLkTikd7mc4DjTVaKip_WFqVdezE13ZbL+Vmfqd8yCu@mail.gmail.com","threadId":"24916","inReplyTo":"20100831150301.GE2315@burratino","subject":"Re: [PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T15:37:19Z","receivedAt":"2010-08-31T15:37:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 15:03, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> --- a/builtin/init-db.c\n>> +++ b/builtin/init-db.c\n>> @@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)\n>>               }\n>>       }\n>>       else if (share && adjust_shared_perm(dir))\n>> -             die(\"Could not make %s writable by group\", dir);\n>> +             die(_(\"Could not make %s writable by group\"), dir);\n>\n> Sensible.\n>\n> I wonder if die() should not just be taught to automatically look up\n> translations for its format string (could gettext handle that?).\n\nIt's always a two step process. First you have to mark the messages\nfor translation, then you have to call gettext() (or _())on them to\nmake a lookup in the message catalog.\n\nThe only way that could work is if I taught xgettext to extract\nstrings passed to die(), but then managing the false positives would\nprobably be more effort than just marking them manually, and it would\nbe a big load on the translators:\n\n    $ ack 'die\\(\"(.*?)\"' --output '$1' *[ch] builtin/*[ch] | sort -u | wc -l\n    1153\n\n> Although we try not to change plumbing error messages without good\n> reason, details of error messages change often enough that imvho\n> scripts should not be relying on them.\n>\n>> -                             die_errno(\"cannot stat '%s'\", path);\n>> +                             die_errno(_(\"cannot stat '%s'\"), path);\n>\n> Will strerror() cope correctly without LC_CTYPE set up?  (Not part\n> of this series, just something I was reminded of.)\n\nMy GNU/Linux strerror(3) claims to use LC_MESSAGES, but I didn't test\nit.\n"},{"id":"149430","messageId":"alpine.BSF.2.00.1008311534390.12745@x.fncre.vasb","threadId":"24916","inReplyTo":"20100831151800.GG2315@burratino","subject":"Re: [PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, \"\")","fromName":"Marcin Cieslak","fromEmail":"saper@saper.info","sentAt":"2010-08-31T15:37:47Z","receivedAt":"2010-08-31T15:37:47Z","isPatch":true,"sender":{"key":"saper@saper.info","avatar":"https://gravatar.com/avatar/8313a958c439a2d52eb2ee4cfcfa64018cefce5400d70dba51f38867f9ce7d36?d=mp&s=160"},"body":"On Tue, 31 Aug 2010, Jonathan Nieder wrote:\n\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> In 107880a I removed our use of setlocale(LC_CTYPE, \"\") because of a\n>> bug in the GNU C Library [1]\n>\n> Future readers might benefit from a reminder that it is vsnprintf that\n> is broken.\n>\n> Aside, not about this patch: glibc printf can be very convenient for\n> translators, because of format strings like \"%4$s\".  Do other common\n> platforms like FreeBSD and Mingw have something similar?\n\nSpeaking for FreeBSD:\n\n% svn log -r21674 printf.3 \n------------------------------------------------------------------------\nr21674 | jkh | 1997-01-14 08:31:39 +0100 (wto) | 8 linii\n\nThe following patch to lib/libc/stdio implements positional arguments in\na manner consistent with other implementations.  Its done in a way that\nadds only a tiny amount of overhead when positional arguments are not used.\nI also have a test program to go with this, but don't know where it belongs\nin the tree.\n\nSubmitted-By: Bill Fenner <fenner@FreeBSD.ORG>\n\n------------------------------------------------------------------------\n\nSolaris 9 has it, too.\n\n--Marcin"},{"id":"149431","messageId":"AANLkTimVGJugnxFzk9Vy2BOZiH=PXWmNs108qs1oSwdy@mail.gmail.com","threadId":"24916","inReplyTo":"20100831151044.GF2315@burratino","subject":"Re: [PATCH/RFC 06/17] gettext: localize the main git-init message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T15:39:19Z","receivedAt":"2010-08-31T15:39:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 15:10, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Note that the TRANSLATORS comment doesn't use the usual Git\n>> style. This is because everything from \"/* TRANSLATORS: \" to \"*/\" will\n>> extracted as-is xgettext(1) and presented to translators, including\n>> newlines and leading \"*\"'s.\n>\n> How would it cope with the following?\n>\n>        /* TRANSLATORS:\n>         * The first '%s' is either \"Reinitialized existing\" or\n>         * \"Initialized empty\", the second \" shared\" or \"\", and\n>         * the last '%s%s' is the verbatim directory name.\n>         */\n>\n> The leading column of stars makes it easier to distinguish code\n> from comments.  (Plus I am not too happy to read code with two\n> inconsistent comment styles used.)\n\nAs I was (trying) to get across in the the commit message it'll make\nthe *'s part of the message. I.e.:\n\n    TRANSLATORS: * The first '%s' is either \"Reinitialized existing\"\n    or * \"Initialized empty\", the second \" shared\" or \"\", and * the\n    last '%s%s' is the verbatim directory name.\n"},{"id":"149432","messageId":"20100831154446.GJ2315@burratino","threadId":"24916","inReplyTo":"AANLkTikd7mc4DjTVaKip_WFqVdezE13ZbL+Vmfqd8yCu@mail.gmail.com","subject":"Re: [PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:44:46Z","receivedAt":"2010-08-31T15:44:46Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> The only way that could work is if I taught xgettext to extract\n> strings passed to die(), but then managing the false positives would\n> probably be more effort than just marking them manually, and it would\n> be a big load on the translators:\n> \n>     $ ack 'die\\(\"(.*?)\"' --output '$1' *[ch] builtin/*[ch] | sort -u | wc -l\n>     1153\n\nTo pursue this a little further: would there be any false positives?\n\nWe could avoid overwhelming translators by waiting until a file has\nbeen fulling gettextized before allowing xgettext to scavenge it\n(i.e., temporarily using a hard-coded list of files in the xgettext\ninvocation).\n\n>> Will strerror() cope correctly without LC_CTYPE set up?  (Not part\n>> of this series, just something I was reminded of.)\n>\n> My GNU/Linux strerror(3) claims to use LC_MESSAGES, but I didn't test\n> it.\n\nSounds like no, then.\n\n$ cat foo.c\n#include <stdio.h>\n#include <locale.h>\n#include <errno.h>\n\nint main(void)\n{\n        setlocale(LC_ALL, \"\");\n        setlocale(LC_CTYPE, \"C\");\n        errno = ENODEV;\n        perror(\"test\");\n        return 0;\n}\n$ make foo\ncc     foo.c   -o foo\n$ ./foo\ntest: No such device\n$ LANG=de_DE.UTF-8 ./foo \ntest: Kein passendes Ger?t gefunden\n"},{"id":"149433","messageId":"20100831154836.GK2315@burratino","threadId":"24916","inReplyTo":"AANLkTimVGJugnxFzk9Vy2BOZiH=PXWmNs108qs1oSwdy@mail.gmail.com","subject":"Re: [PATCH/RFC 06/17] gettext: localize the main git-init message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:48:36Z","receivedAt":"2010-08-31T15:48:36Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n>> Ævar Arnfjörð Bjarmason wrote:\n\n>>> This is because everything from \"/* TRANSLATORS: \" to \"*/\" will\n>>> extracted as-is xgettext(1) and presented to translators, including\n>>> newlines and leading \"*\"'s.\n[...]\n> As I was (trying) to get across in the the commit message it'll make\n> the *'s part of the message. I.e.:\n> \n>     TRANSLATORS: * The first '%s' is either \"Reinitialized existing\"\n>     or * \"Initialized empty\", the second \" shared\" or \"\", and * the\n>     last '%s%s' is the verbatim directory name.\n\nAh, so you meant \"not including newlines but including leading '*''s\".\n\nHmm, this is annoying.  Searching existing projects, it seems that\na lot of people are just not using the TRANSLATORS: feature except\nfor one-line comments.\n\nThanks for the explanation.\n"},{"id":"149434","messageId":"20100831154924.GL2315@burratino","threadId":"24916","inReplyTo":"alpine.BSF.2.00.1008311534390.12745@x.fncre.vasb","subject":"Re: [PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, \"\")","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T15:49:24Z","receivedAt":"2010-08-31T15:49:24Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Marcin Cieslak wrote:\n\n> Speaking for FreeBSD:\n> \n> % svn log -r21674 printf.3 ------------------------------------------------------------------------\n> r21674 | jkh | 1997-01-14 08:31:39 +0100 (wto) | 8 linii\n> \n> The following patch to lib/libc/stdio implements positional arguments in\n> a manner consistent with other implementations.\n[...]\n> Solaris 9 has it, too.\n\nThanks for checking.  That's good to hear.\n"},{"id":"149443","messageId":"AANLkTimPndcAu7RTnzpB0LZ1bHpFC5-QxNkPPAkoD5Hc@mail.gmail.com","threadId":"24916","inReplyTo":"20100831154446.GJ2315@burratino","subject":"Re: [PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T16:05:16Z","receivedAt":"2010-08-31T16:05:16Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 15:44, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> The only way that could work is if I taught xgettext to extract\n>> strings passed to die(), but then managing the false positives would\n>> probably be more effort than just marking them manually, and it would\n>> be a big load on the translators:\n>>\n>>     $ ack 'die\\(\"(.*?)\"' --output '$1' *[ch] builtin/*[ch] | sort -u | wc -l\n>>     1153\n>\n> To pursue this a little further: would there be any false positives?\n\nMaybe I can see a few probable plumbing messages here, but probably\nnothing that's unmanagable: http://gist.github.com/559255\n\n> We could avoid overwhelming translators by waiting until a file has\n> been fulling gettextized before allowing xgettext to scavenge it\n> (i.e., temporarily using a hard-coded list of files in the xgettext\n> invocation).\n\nYeah we could go this route. But I'm a bit uneasy about it. The way\nI'm doing it now I have to manually look at every message to determine\nif it's a porcelain error or not.\n\nBut it's easier to accidentally mark something with a filelist like\nthat, or to mark a future plumbing die message that gets introduced\nafter a file has made the OK list.\n\nMaybe we should have die_plumbing() and die_porcelain() functions to\nindicate the nature of the message, although we could get the same\nthing with die() and die(_()) once I'm done.\n\n>>> Will strerror() cope correctly without LC_CTYPE set up?  (Not part\n>>> of this series, just something I was reminded of.)\n>>\n>> My GNU/Linux strerror(3) claims to use LC_MESSAGES, but I didn't test\n>> it.\n>\n> Sounds like no, then.\n>\n> $ cat foo.c\n> #include <stdio.h>\n> #include <locale.h>\n> #include <errno.h>\n>\n> int main(void)\n> {\n>        setlocale(LC_ALL, \"\");\n>        setlocale(LC_CTYPE, \"C\");\n>        errno = ENODEV;\n>        perror(\"test\");\n>        return 0;\n> }\n> $ make foo\n> cc     foo.c   -o foo\n> $ ./foo\n> test: No such device\n> $ LANG=de_DE.UTF-8 ./foo\n> test: Kein passendes Ger?t gefunden\n\nWhat about with MESSAGES instead of ALL, like we're doing?\n\n    setlocale(LC_MESSAGES, \"\");\n    setlocale(LC_CTYPE, \"C\");\n\nI don't have a box here with a localized C library to test it on.\n"},{"id":"149444","messageId":"AANLkTimrsiqCOKKQ6+GFdk8Z_A65mjFT0O2SB4PZ8Keo@mail.gmail.com","threadId":"24916","inReplyTo":"20100831153214.GI2315@burratino","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T16:05:49Z","receivedAt":"2010-08-31T16:05:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 15:32, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Now that Git has the infrastructure for translation in next I'm going\n>> to start submitting patches to make the main porcelain translatable.\n>\n> I've written some comments on specific patches; the rest looks good\n> to me.\n\nI'll try to reply to them all.\n\n> Thanks for moving this forward.\n\nAnd thanks for your continuing efforts in reviewing all of this.\n"},{"id":"149446","messageId":"20100831160957.GN2315@burratino","threadId":"24916","inReplyTo":"AANLkTimPndcAu7RTnzpB0LZ1bHpFC5-QxNkPPAkoD5Hc@mail.gmail.com","subject":"Re: [PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T16:09:57Z","receivedAt":"2010-08-31T16:09:57Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Tue, Aug 31, 2010 at 15:44, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>> int main(void)\n>> {\n>>        setlocale(LC_ALL, \"\");\n>>        setlocale(LC_CTYPE, \"C\");\n>>        errno = ENODEV;\n>>        perror(\"test\");\n>>        return 0;\n>> }\n>> $ make foo\n>> cc     foo.c   -o foo\n>> $ ./foo\n>> test: No such device\n>> $ LANG=de_DE.UTF-8 ./foo\n>> test: Kein passendes Ger?t gefunden\n>\n> What about with MESSAGES instead of ALL, like we're doing?\n> \n>     setlocale(LC_MESSAGES, \"\");\n>     setlocale(LC_CTYPE, \"C\");\n\nSame result, alas.\n"},{"id":"149449","messageId":"7vk4n6d9xs.fsf@alter.siamese.dyndns.org","threadId":"24916","inReplyTo":"AANLkTimPndcAu7RTnzpB0LZ1bHpFC5-QxNkPPAkoD5Hc@mail.gmail.com","subject":"Re: [PATCH/RFC 05/17] gettext: make the simple parts of git-init localizable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-08-31T16:27:27Z","receivedAt":"2010-08-31T16:27:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> Maybe we should have die_plumbing() and die_porcelain() functions to\n> indicate the nature of the message, although we could get the same\n> thing with die() and die(_()) once I'm done.\n\nTo me, die() vs die(_()) feels like the lessor of two evils ;-).\n\nThanks.\n"},{"id":"149450","messageId":"AANLkTim6fjMKcULn08G0NqWRhoRRv_J63KtARq6G5ZbG@mail.gmail.com","threadId":"24916","inReplyTo":"20100831145158.GD2315@burratino","subject":"Re: [PATCH/RFC 01/17] Makefile: A variable for options used by xgettext(1) calls","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T16:36:16Z","receivedAt":"2010-08-31T16:36:16Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 14:51, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> +++ b/Makefile\n>> @@ -2008,10 +2008,11 @@ cscope:\n>>       $(RM) cscope*\n>>       $(FIND) . -name '*.[hcS]' -print | xargs cscope -b\n>>\n>> +XGETTEXT_OPTIONS = --add-comments\n>>  pot:\n>> -     $(XGETTEXT) --add-comments --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n>> -     $(XGETTEXT) --add-comments --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n>> -     $(XGETTEXT) --add-comments --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl\n>> +     $(XGETTEXT) $(XGETTEXT_OPTIONS) --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n>> +     $(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n>> +     $(XGETTEXT) $(XGETTEXT_OPTIONS) --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl\n>\n> The long lines are a bit scary. :)\n>\n> Maybe more of it could be pulled out into variables.  As a\n> side-effect, users could override some settings from the command line.\n> Maybe something like this?\n>\n>  LOCALIZED_C = $(C_OBJ:o=c) t/t0200/test.c\n>  LOCALIZED_SH = $(SCRIPT_SH) t/t0200/test.sh\n>  LOCALIZED_PERL = $(SCRIPT_PERL) t/t0200/test.perl\n>\n>  XGETTEXT_OPTIONS = --add-comments\n>  XGETTEXT_OPTIONS_C = $(XGETTEXT_OPTIONS) -k_ -kN_ -LC\n>  XGETTEXT_OPTIONS_SH = $(XGETTEXT_OPTIONS) -LShell\n>  XGETTEXT_OPTIONS_PERL = $(XGETTEXT_OPTIONS) -k__ -LPerl\n>\n>  po/git.pot:\n>        rm -f $@+\n>        $(XGETTEXT) -o$@+ $(XGETTEXT_OPTIONS_C) $(LOCALIZED_C)\n>        $(XGETTEXT) -j -o$@+ $(XGETTEXT_OPTIONS_SH) $(LOCALIZED_SH)\n>        $(XGETTEXT) -j -o$@+ $(XGETTEXT_OPTIONS_PERL) $(LOCALIZED_PERL)\n>        mv $@+ $@\n\nThanks. I worked that into v2.\n"},{"id":"149453","messageId":"AANLkTi=+oGVx_T_-0T0RTqe+rV4QwQakjXUXKk8tddFL@mail.gmail.com","threadId":"24916","inReplyTo":"20100831151800.GG2315@burratino","subject":"Re: [PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, \"\")","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T16:51:47Z","receivedAt":"2010-08-31T16:51:47Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 15:18, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> In 107880a I removed our use of setlocale(LC_CTYPE, \"\") because of a\n>> bug in the GNU C Library [1]\n>\n> Future readers might benefit from a reminder that it is vsnprintf that\n> is broken.\n\nI'll work something in about that.\n\n> Aside, not about this patch: glibc printf can be very convenient for\n> translators, because of format strings like \"%4$s\".  Do other common\n> platforms like FreeBSD and Mingw have something similar?\n\nI certainly hope so. I was planning on documenting its usage,\nJohannes?\n\n>> --- a/gettext.c\n>> +++ b/gettext.c\n>> @@ -17,5 +19,9 @@ extern void git_setup_gettext(void) {\n>>       }\n>>\n>>       (void)setlocale(LC_MESSAGES, \"\");\n>> +     (void)setlocale(LC_CTYPE, \"\");\n>> +     charset = nl_langinfo(CODESET);\n>> +     (void)bind_textdomain_codeset(\"git\", charset);\n>> +     (void)setlocale(LC_CTYPE, \"C\");\n>\n> For the curious: we cannot use\n>\n>        setlocale(LC_CTYPE, \"\");\n>        charset = nl_langinfo(CODESET);\n>        setlocale(LC_CTYPE, \"C\");\n>        bind_textdomain_codeset(\"git\", charset);\n>\n> because nl_langinfo returns a pointer to a static buffer that might\n> be wiped out by setlocale() iirc.\n\nBut I'm hopefully sidestepping that issue by passing it to\nbind_textdomain_codeset() right away.\n"},{"id":"149455","messageId":"AANLkTimYETJcHuKBBRKJ0zbkRBR-K2VAXRLizFQxa-pr@mail.gmail.com","threadId":"24916","inReplyTo":"20100831152959.GH2315@burratino","subject":"Re: [PATCH/RFC 15/17] po/is.po: add Icelandic translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T17:01:40Z","receivedAt":"2010-08-31T17:01:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 15:29, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> --- a/po/is.po\n>> +++ b/po/is.po\n>> @@ -11,35 +11,154 @@ msgstr \"\"\n>>  \"Content-Type: text/plain; charset=UTF-8\\n\"\n>>  \"Content-Transfer-Encoding: 8bit\\n\"\n>>\n>> -#: t/t0200/test.c:4\n>> +#: builtin/init-db.c:34\n>\n> Is there a diff driver that will ignore these --add-location lines?\n>\n> Alternatively, would it be possible to get msgmerge and xgettext to\n> provide the filenames without the line numbers?  My experience is\n> that most translation diffs are very hard to read because about 80%\n> noise. :(\n>\n> Aside from that, this looks good and sane (well, the English part\n> I can read does).\n\nSome context, an earlier discussion on this:\nhttp://kerneltrap.org/mailarchive/git/2010/5/30/31415/thread#mid-31415\n\nRemoving them will have some negative effects. Gettext uses them for\nits message fuzzying logic, and they enable you to jump directly to a\nsource definition.\n\nI've found that it's easier to just go with the flow as far as the\ngettext tools are concerned, and they seem to really like to have\nthese line numbers in :)\n"},{"id":"149458","messageId":"AANLkTinKgOdgTpORf-NSJ1wpURw9xOkQ3rXZvmV6XtBb@mail.gmail.com","threadId":"24916","inReplyTo":"7v39tveq0j.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T17:18:51Z","receivedAt":"2010-08-31T17:18:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Aug 30, 2010 at 21:42, Junio C Hamano <gitster@pobox.com> wrote:\n\n> Thanks; will queue them.\n\nThere's a v2 available here:\nhttp://github.com/avar/git/tree/gettextize-git-mainporcelain-v2\n\nOr: git://github.com/avar/git.git gettextize-git-mainporcelain-v2\n\nIt:\n\n * contains the \"gettext: Make NO_GETTEXT=YesPlease the default in\n   releases\" patch. Please only apply that to next, not pu.\n\n * A \"Makefile: use variables and shorter lines for xgettext\" patch,\n   which implements Jonathan's suggestion of using more variables for\n   the xgettext invocation.\n\n * Elaborates on the issues facing us in the \"gettext.c: work around\n   us not using setlocale(LC_CTYPE, \"\")\" commit message, and mentions\n   the perror(3) issue.\n\nI didn't send it to the list because it's a huge series and this is a\nlittle fixup, and I rebased it to inject the Makefile patch early in\nthe series, which isn't easy to express in a v2 PATCH.\n\nThanks.\n\nI can also send it to list if you want, but I suspect this is better.\n"},{"id":"149467","messageId":"20100831180832.GQ2315@burratino","threadId":"24916","inReplyTo":"AANLkTinKgOdgTpORf-NSJ1wpURw9xOkQ3rXZvmV6XtBb@mail.gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T18:08:32Z","receivedAt":"2010-08-31T18:08:32Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Or: git://github.com/avar/git.git gettextize-git-mainporcelain-v2\n\nIs that against \"next\"?  For an RFC that's okay, but for a series\nthat will be part of a release it can be tedious to separate out\n(not all topics in \"next\" necessarily are released, and \"next\"\ntraditionally gets rewound after each release).\n\nComments on the patches:\n\n Makefile: use variables and shorter lines for xgettext\n\nThe -o<whatever> passed to cc isn't usually included in CFLAGS,\nand a part of me is similarly uncomfortable with including it in\nXGETTEXT_OPTIONS.  Isn't that parameter something that should be\npossible to change in the build system independently from the\nuser's XGETTEXT_OPTIONS preferences?\n\n gettext.c: work around us not using setlocale(LC_CTYPE, \"\")\n\nThe perror() problem shows up with strerror(), too, of course.\n(perror just made for an easier demo.)\n\n gettext: Make NO_GETTEXT=YesPlease the default in releases\n\nCopy-edits for the notes in INSTALL:\n\n> +       - Git includes EXPERIMENTAL support for localization with gettext\n> +         which is currently disabled by default in official Git\n> +         releases.\n\ns/EXPERIMENTAL/experimental/?  No need to shout.\n\nI'd also s/currently // since this will not be current after a while.\n\n> +         If you really want to build it you have to specify NO_GETTEXT=\n> +         as a Makefile argument. If you're a downstream distributor\n> +         please don't do so without consulting with the Git Mailing List\n> +         first about the stability of this feature.\n\nSimilarly I'd s/really //.  If we want to dissuade people from trying\nit out, we should probably do that with more explicit statements.\n\n> +         It's only being included in releases so that source messages can\n> +         be marked for translation without resulting in painful and\n> +         inevitable merge conflicts between Git's pu branch and the\n> +         rest. END WARNING.\n\nNot sure what this means.  Maybe:\n\n The infrastructure is only included in this release to avoid\n complications in building other work on top of it.  If you turn\n it on, expect breakage.\n\n> +         The primary target is GNU libintl, but the Solaris gettext\n>           implementation also works.\n"},{"id":"149472","messageId":"AANLkTikk8nVyvp0hTycMY9bjMub38msxrOHMMLNER_DS@mail.gmail.com","threadId":"24916","inReplyTo":"20100831180832.GQ2315@burratino","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T18:24:54Z","receivedAt":"2010-08-31T18:24:54Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 18:08, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Or: git://github.com/avar/git.git gettextize-git-mainporcelain-v2\n>\n> Is that against \"next\"?  For an RFC that's okay, but for a series\n> that will be part of a release it can be tedious to separate out\n> (not all topics in \"next\" necessarily are released, and \"next\"\n> traditionally gets rewound after each release).\n\nYes it's against next since it had the gettext series merged and next\nis about to be released isn't it? I could base it on something else if\nthat's appropriate.\n\n> Comments on the patches:\n>\n>  Makefile: use variables and shorter lines for xgettext\n>\n> The -o<whatever> passed to cc isn't usually included in CFLAGS,\n> and a part of me is similarly uncomfortable with including it in\n> XGETTEXT_OPTIONS.  Isn't that parameter something that should be\n> possible to change in the build system independently from the\n> user's XGETTEXT_OPTIONS preferences?\n\nMaybe, but it'll always be --output=po/git.pot so I saw no reason to\nseperate it. Should it be? The -o for the C compiler changes, but the\n\"make pot\" target will always write to po/git.pot.\n\n>  gettext.c: work around us not using setlocale(LC_CTYPE, \"\")\n>\n> The perror() problem shows up with strerror(), too, of course.\n> (perror just made for an easier demo.)\n\nYeah, and everything external like that, unfortunately.\n\n>  gettext: Make NO_GETTEXT=YesPlease the default in releases\n>\n> Copy-edits for the notes in INSTALL:\n>\n>> +       - Git includes EXPERIMENTAL support for localization with gettext\n>> +         which is currently disabled by default in official Git\n>> +         releases.\n>\n> s/EXPERIMENTAL/experimental/?  No need to shout.\n\nOKEY THEN!\n\n> I'd also s/currently // since this will not be current after a while.\n\nok.\n\n>> +         If you really want to build it you have to specify NO_GETTEXT=\n>> +         as a Makefile argument. If you're a downstream distributor\n>> +         please don't do so without consulting with the Git Mailing List\n>> +         first about the stability of this feature.\n>\n> Similarly I'd s/really //.  If we want to dissuade people from trying\n> it out, we should probably do that with more explicit statements.\n\nThanks.\n\n>> +         It's only being included in releases so that source messages can\n>> +         be marked for translation without resulting in painful and\n>> +         inevitable merge conflicts between Git's pu branch and the\n>> +         rest. END WARNING.\n>\n> Not sure what this means.  Maybe:\n>\n>  The infrastructure is only included in this release to avoid\n>  complications in building other work on top of it.  If you turn\n>  it on, expect breakage.\n\nYes, that's better. I've worked all these into a\ngettextize-git-mainporcelain-v3 branch at the same repository:\n\n    http://github.com/avar/git/compare/gettextize-git-mainporcelain-v2...gettextize-git-mainporcelain-v3\n\nOr: git://github.com/avar/git.git gettextize-git-mainporcelain-v3\n"},{"id":"149481","messageId":"AANLkTimGSEVLOjTLt2yntXaDfyUkj=mY46evfRx517MC@mail.gmail.com","threadId":"24916","inReplyTo":"AANLkTimYETJcHuKBBRKJ0zbkRBR-K2VAXRLizFQxa-pr@mail.gmail.com","subject":"Re: [PATCH/RFC 15/17] po/is.po: add Icelandic translation","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-08-31T19:14:37Z","receivedAt":"2010-08-31T19:14:37Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Aug 31, 2010 at 7:01 PM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Tue, Aug 31, 2010 at 15:29, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Ævar Arnfjörð Bjarmason wrote:\n>>\n>>> --- a/po/is.po\n>>> +++ b/po/is.po\n>>> @@ -11,35 +11,154 @@ msgstr \"\"\n>>>  \"Content-Type: text/plain; charset=UTF-8\\n\"\n>>>  \"Content-Transfer-Encoding: 8bit\\n\"\n>>>\n>>> -#: t/t0200/test.c:4\n>>> +#: builtin/init-db.c:34\n>>\n>> Is there a diff driver that will ignore these --add-location lines?\n>>\n>> Alternatively, would it be possible to get msgmerge and xgettext to\n>> provide the filenames without the line numbers?  My experience is\n>> that most translation diffs are very hard to read because about 80%\n>> noise. :(\n>>\n>> Aside from that, this looks good and sane (well, the English part\n>> I can read does).\n>\n> Some context, an earlier discussion on this:\n> http://kerneltrap.org/mailarchive/git/2010/5/30/31415/thread#mid-31415\n>\n\nmsgmerge and xgettext does seem to have the --no-location flag to\navoid these annotations from being generated. The documentation does\nsay \"Note that using this option makes it harder for technically\nskilled translators to understand each message's context. \", though.\nBut perhaps the annotated versions could be generated when needed and\nnever checked-in (similar to what you suggested in that e-mail)? It\nsounds to me like that would give us the best of all worlds. If it's\npossible, that is.\n"},{"id":"149486","messageId":"20100831192247.GU2315@burratino","threadId":"24916","inReplyTo":"AANLkTikk8nVyvp0hTycMY9bjMub38msxrOHMMLNER_DS@mail.gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T19:22:47Z","receivedAt":"2010-08-31T19:22:47Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Maybe, but it'll always be --output=po/git.pot so I saw no reason to\n> seperate it. Should it be?\n\nNo big deal.  I am vaguely worried about interrupted \"make\"\ninvocations.  Don't gettextized packages typically do something like this?\n\n\tremove_creation_date() {\n\t\tsed '#!/bin/sed -f\n\t\t\t/^\"POT-Creation-Date: .*\"$/!b\n\t\t\tx\n\t\t\t# Test if the hold space is empty.\n\t\t\ts/P/P/\n\t\t\tta\n\t\t\t# Yes it was empty. First occurrence. Remove the line.\n\t\t\tg\n\t\t\td\n\t\t\tbb\n\t\t\t:a\n\t\t\t# The hold space was nonempty. Following occurrences. Do nothing.\n\t\t\tx\n\t\t\t:b'\n\t}\n\t(cd po && xgettext --default-domain=git ...)\n\tset -e; \\\n\tif test -f po/git.pot &&\n\t\tremove_creation_date <po/git.pot >po/git.1po+ &&\n\t\tremove_creation_date <po/git.po >po/git.2po+ &&\n\t\tcmp po/git.1po+ po/git.2po+; \\\n\tthen \\\n\t\trm -f po/git.1po+ po/git.2po+ po/git.po; \\\n\telse \\\n\t\trm -f po/git.1po+ po/git.2po+ po/git.pot; \\\n\t\tmv po/git.po po/git.pot; \\\n\tfi\n\n> The -o for the C compiler changes, but the\n> \"make pot\" target will always write to po/git.pot.\n\nIn particular, to avoid using a partial .pot file, one might want to write to\npo/git.pot+, po/git.po, or similar and then rename it.\n\n> Or: git://github.com/avar/git.git gettextize-git-mainporcelain-v3\n\nLooks good.\n"},{"id":"149488","messageId":"AANLkTin5+Sdx3MRrERpFUD04=CSmNyPoB3zRvNxKLLpj@mail.gmail.com","threadId":"24916","inReplyTo":"AANLkTimGSEVLOjTLt2yntXaDfyUkj=mY46evfRx517MC@mail.gmail.com","subject":"Re: [PATCH/RFC 15/17] po/is.po: add Icelandic translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T19:32:05Z","receivedAt":"2010-08-31T19:32:05Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 19:14, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n> On Tue, Aug 31, 2010 at 7:01 PM, Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> On Tue, Aug 31, 2010 at 15:29, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>> Ævar Arnfjörð Bjarmason wrote:\n>>>\n>>>> --- a/po/is.po\n>>>> +++ b/po/is.po\n>>>> @@ -11,35 +11,154 @@ msgstr \"\"\n>>>>  \"Content-Type: text/plain; charset=UTF-8\\n\"\n>>>>  \"Content-Transfer-Encoding: 8bit\\n\"\n>>>>\n>>>> -#: t/t0200/test.c:4\n>>>> +#: builtin/init-db.c:34\n>>>\n>>> Is there a diff driver that will ignore these --add-location lines?\n>>>\n>>> Alternatively, would it be possible to get msgmerge and xgettext to\n>>> provide the filenames without the line numbers?  My experience is\n>>> that most translation diffs are very hard to read because about 80%\n>>> noise. :(\n>>>\n>>> Aside from that, this looks good and sane (well, the English part\n>>> I can read does).\n>>\n>> Some context, an earlier discussion on this:\n>> http://kerneltrap.org/mailarchive/git/2010/5/30/31415/thread#mid-31415\n>>\n>\n> msgmerge and xgettext does seem to have the --no-location flag to\n> avoid these annotations from being generated. The documentation does\n> say \"Note that using this option makes it harder for technically\n> skilled translators to understand each message's context. \", though.\n> But perhaps the annotated versions could be generated when needed and\n> never checked-in (similar to what you suggested in that e-mail)? It\n> sounds to me like that would give us the best of all worlds. If it's\n> possible, that is.\n\nIt's certainly possible. But each time you worked with these files\nyou'd have add the line numbers yourself to generate the context, then\ntranslate, then remove them again, then submit your patch.\n\nI just think it's overly tedious work for getting smaller diffs.\n"},{"id":"149489","messageId":"AANLkTinVFvv2J4z36zc9LAs+_-Pp2_+bYeLVxVeavWtJ@mail.gmail.com","threadId":"24916","inReplyTo":"20100831192247.GU2315@burratino","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-31T19:35:39Z","receivedAt":"2010-08-31T19:35:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Aug 31, 2010 at 19:22, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Maybe, but it'll always be --output=po/git.pot so I saw no reason to\n>> seperate it. Should it be?\n>\n> No big deal.  I am vaguely worried about interrupted \"make\"\n> invocations.  Don't gettextized packages typically do something like this?\n>\n>        remove_creation_date() {\n>                sed '#!/bin/sed -f\n>                        /^\"POT-Creation-Date: .*\"$/!b\n>                        x\n>                        # Test if the hold space is empty.\n>                        s/P/P/\n>                        ta\n>                        # Yes it was empty. First occurrence. Remove the line.\n>                        g\n>                        d\n>                        bb\n>                        :a\n>                        # The hold space was nonempty. Following occurrences. Do nothing.\n>                        x\n>                        :b'\n>        }\n>        (cd po && xgettext --default-domain=git ...)\n>        set -e; \\\n>        if test -f po/git.pot &&\n>                remove_creation_date <po/git.pot >po/git.1po+ &&\n>                remove_creation_date <po/git.po >po/git.2po+ &&\n>                cmp po/git.1po+ po/git.2po+; \\\n>        then \\\n>                rm -f po/git.1po+ po/git.2po+ po/git.po; \\\n>        else \\\n>                rm -f po/git.1po+ po/git.2po+ po/git.pot; \\\n>                mv po/git.po po/git.pot; \\\n>        fi\n>\n>> The -o for the C compiler changes, but the\n>> \"make pot\" target will always write to po/git.pot.\n>\n> In particular, to avoid using a partial .pot file, one might want to write to\n> po/git.pot+, po/git.po, or similar and then rename it.\n\nI don't know what they usually do. But that looks like a lot of work\nto work around a very rare potential edge case. \"make pot\" is only\never run manually by a translator right before msgmerge.\n\nIn the very rare case where make is interrupted and git.pot is left in\na partial state you'll notice because your msgmerge fails.\n\n>> Or: git://github.com/avar/git.git gettextize-git-mainporcelain-v3\n>\n> Looks good.\n\nThanks for checking it out.\n"},{"id":"149492","messageId":"20100831194204.GW2315@burratino","threadId":"24916","inReplyTo":"AANLkTinVFvv2J4z36zc9LAs+_-Pp2_+bYeLVxVeavWtJ@mail.gmail.com","subject":"Re: [PATCH/RFC 00/17] Begin gettextizing Git","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T19:42:04Z","receivedAt":"2010-08-31T19:42:04Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Tue, Aug 31, 2010 at 19:22, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>>        if test -f po/git.pot &&\n>>                remove_creation_date <po/git.pot >po/git.1po+ &&\n>>                remove_creation_date <po/git.po >po/git.2po+ &&\n>>                cmp po/git.1po+ po/git.2po+; \\\n>>        then \\\n>>                rm -f po/git.1po+ po/git.2po+ po/git.po; \\\n>>        else \\\n>>                rm -f po/git.1po+ po/git.2po+ po/git.pot; \\\n>>                mv po/git.po po/git.pot; \\\n>>        fi\n[...]\n> I don't know what they usually do. But that looks like a lot of work\n> to work around a very rare potential edge case.\n\nAh, to work around the interrupted build case is simpler.  grepping for\n\"mv\" in Documentation/Makefile would show some examples.\n\nThe above incantation is to avoid changing the timestamp on the .pot\nfile when it does not change.\n\n> \"make pot\" is only\n> ever run manually by a translator right before msgmerge.\n\nI don't know enough about translation workflows.  Don't people\nsometimes automatically run msgmerge at build time to get some okay\nfuzzy messages when the translation team is off on vacation?\n\n> Thanks for checking it out.\n\nThanks for doing the hard work.\n"},{"id":"149493","messageId":"AANLkTi=4U2_ascHbC77Rbrb8FGtT7hiOr0MUqfbeWztS@mail.gmail.com","threadId":"24916","inReplyTo":"AANLkTin5+Sdx3MRrERpFUD04=CSmNyPoB3zRvNxKLLpj@mail.gmail.com","subject":"Re: [PATCH/RFC 15/17] po/is.po: add Icelandic translation","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-08-31T19:49:34Z","receivedAt":"2010-08-31T19:49:34Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Aug 31, 2010 at 9:32 PM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Tue, Aug 31, 2010 at 19:14, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n>> On Tue, Aug 31, 2010 at 7:01 PM, Ævar Arnfjörð Bjarmason\n>> <avarab@gmail.com> wrote:\n>>> On Tue, Aug 31, 2010 at 15:29, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>>> Ævar Arnfjörð Bjarmason wrote:\n>>>>\n>>>>> --- a/po/is.po\n>>>>> +++ b/po/is.po\n>>>>> @@ -11,35 +11,154 @@ msgstr \"\"\n>>>>>  \"Content-Type: text/plain; charset=UTF-8\\n\"\n>>>>>  \"Content-Transfer-Encoding: 8bit\\n\"\n>>>>>\n>>>>> -#: t/t0200/test.c:4\n>>>>> +#: builtin/init-db.c:34\n>>>>\n>>>> Is there a diff driver that will ignore these --add-location lines?\n>>>>\n>>>> Alternatively, would it be possible to get msgmerge and xgettext to\n>>>> provide the filenames without the line numbers?  My experience is\n>>>> that most translation diffs are very hard to read because about 80%\n>>>> noise. :(\n>>>>\n>>>> Aside from that, this looks good and sane (well, the English part\n>>>> I can read does).\n>>>\n>>> Some context, an earlier discussion on this:\n>>> http://kerneltrap.org/mailarchive/git/2010/5/30/31415/thread#mid-31415\n>>>\n>>\n>> msgmerge and xgettext does seem to have the --no-location flag to\n>> avoid these annotations from being generated. The documentation does\n>> say \"Note that using this option makes it harder for technically\n>> skilled translators to understand each message's context. \", though.\n>> But perhaps the annotated versions could be generated when needed and\n>> never checked-in (similar to what you suggested in that e-mail)? It\n>> sounds to me like that would give us the best of all worlds. If it's\n>> possible, that is.\n>\n> It's certainly possible. But each time you worked with these files\n> you'd have add the line numbers yourself to generate the context, then\n> translate, then remove them again, then submit your patch.\n>\n> I just think it's overly tedious work for getting smaller diffs.\n>\n\nYou know, computers are pretty good at automating tedious jobs ;)\n\nI was thinking something along the lines of having po/is.po etc, and\ngenerating po/is.ann.po (or something) from these (+source) so\ntranslators can see the text in the context of the code. That is, they\nedit is.po, and generate is.ann.po when they want to see the context.\nThen we can put *.ann.po in .gitignore, and it's really just a matter\nof editing, doing \"make po/is.ann.po\", and voila.\n\nBut I dunno, I haven't been using these tools much myself.\n"},{"id":"149506","messageId":"20100831224517.GB6747@burratino","threadId":"24916","inReplyTo":"AANLkTi=+oGVx_T_-0T0RTqe+rV4QwQakjXUXKk8tddFL@mail.gmail.com","subject":"Re: [PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, \"\")","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-31T22:45:17Z","receivedAt":"2010-08-31T22:45:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Tue, Aug 31, 2010 at 15:18, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>> Aside, not about this patch: glibc printf can be very convenient for\n>> translators, because of format strings like \"%4$s\".  Do other common\n>> platforms like FreeBSD and Mingw have something similar?\n>\n> I certainly hope so. I was planning on documenting its usage,\n> Johannes?\n\nSorry, my knowledge was just outdated.  It's in posix[1] now, which\nI think means we can expect it to be in any recent libc.\n\nUnfortunately msys uses newlib 1.9.0 afaict, from 2001.  The %4$s\nsupport was introduced[2] to newlib by Eric Blake on 2007-04-25.\n\n[1] http://www.opengroup.org/onlinepubs/9699919799/functions/printf.html#tag_16_159_03\n[2] http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libc/stdio/vfprintf.c?cvsroot=src\n"},{"id":"149507","messageId":"AANLkTi=c7j+U0Btgv5TgwkRmsY-TV-iQ3RARyZxYTDvk@mail.gmail.com","threadId":"24916","inReplyTo":"20100831224517.GB6747@burratino","subject":"Re: [PATCH/RFC 07/17] gettext.c: work around us not using setlocale(LC_CTYPE, \"\")","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-08-31T22:58:07Z","receivedAt":"2010-08-31T22:58:07Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Wed, Sep 1, 2010 at 12:45 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>> On Tue, Aug 31, 2010 at 15:18, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>\n>>> Aside, not about this patch: glibc printf can be very convenient for\n>>> translators, because of format strings like \"%4$s\".  Do other common\n>>> platforms like FreeBSD and Mingw have something similar?\n>>\n>> I certainly hope so. I was planning on documenting its usage,\n>> Johannes?\n>\n> Sorry, my knowledge was just outdated.  It's in posix[1] now, which\n> I think means we can expect it to be in any recent libc.\n>\n> Unfortunately msys uses newlib 1.9.0 afaict, from 2001.  The %4$s\n> support was introduced[2] to newlib by Eric Blake on 2007-04-25.\n>\n\nGit for Windows doesn't use the MSYS-runtime for Git itself, it only\nuse the MSYS-environment to build etc. It's using MSVCRT.DLL as the\nCRT, which is even worse feature-wise.\n\nhttp://msdn.microsoft.com/en-us/library/56e442dc.aspx describes the\nformat specification fields supported, and it does not look promising.\n"}]}