{"thread":{"id":"23836","subject":"Re: [PATCH] WIP: begin to translate git with gettext","startedAt":"2010-05-18T10:57:24Z","lastAt":"2010-05-18T16:47:09Z","messageCount":3,"participants":["Ævar Arnfjörð Bjarmason","Jeff Epler"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"141860","messageId":"AANLkTikK9LAd_pwTwB56Vpq19i00X5apy6qT-ZOpnLEp@mail.gmail.com","threadId":"23836","inReplyTo":"20100517160208.GA20842@unpythonic.net","subject":"Re: [PATCH] WIP: begin to translate git with gettext","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-18T10:57:24Z","receivedAt":"2010-05-18T10:57:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, May 17, 2010 at 16:02, Jeff Epler <jepler@unpythonic.net> wrote:\n> Signed-off-by: Jeff Epler <jepler@unpythonic.net>\n> ---\n> While I'm certain that there are a lot of things to object to in this\n> patch, it shows 90% of what is needed to use gettext to translate\n> the portions of git written in c, without involving undesired gnu\n> infrastructure such as automake.\n>\n> Makefile adds necessary rules for generating git.pot and for building\n> and installing compiled message catalogs (.mo) from text message\n> catalogs (.po).  It also adds a gettext support header and source file.\n>\n> Minimal changes are made to git to use the requested LC_CTYPE and\n> LC_MESSAGES, and some messages for 'git status' are marked for\n> translation.\n>\n> When I provided a gibberish translation of a message:\n> #: wt-status.c:87\n> msgid \"# Changed but not updated:\"\n> msgstr \"# Changes not blah blah blah\"\n>\n> running 'git status' used the translation:\n> $ git status\n> # On branch master\n> # Your branch is ahead of 'origin/master' by 1 commit.\n> #\n> # Changes not blah blah blah\n> ...\n>\n> I ran with 'make install' and prefix set in config.mak.  It didn't seem\n> to work when running from the source directory, and it may or may not\n> work with runtime prefix.\n\nThanks a lot for this patch.\n\nI'm having some trouble getting it to work though. I did:\n\n    make pot\n\nThat made the po/git.pot file with all the relevant messages. Then I\nmade a po/is.po in poedit which has stuff like:\n\n    #: wt-status.c:598\n    msgid \"On branch \"\n    msgstr \"A greininni \"\n\n    #: wt-status.c:605\n    msgid \"Not currently on any branch.\"\n    msgstr \"Ekki á grænni grein.\n\nI did:\n\n    make prefix=/usr all\n    sudo make prefix=/usr install\n\nBut any invocation of my new git-status (I uninstalled my system git\nfirst) with either LC_ALL, LC_MESSAGES or LC_CTYPE set to is, is_IS or\nis_IS.UTF-8 doest't yield the desired results:\n\n    $ strings /usr/share/locale/is/LC_MESSAGES/git.mo |grep grein\n    nni grein.\n    A greininni\n\nit doesn't seem to spot the file:\n\n    $ strace git status 2>&1|grep locale\n    open(\"/usr/lib/locale/locale-archive\", O_RDONLY|O_LARGEFILE) = -1\nENOENT (No such file or directory)\n    open(\"/usr/share/locale/locale.alias\", O_RDONLY) = 3\n    open(\"/usr/lib/locale/is/LC_MESSAGES\", O_RDONLY) = -1 ENOENT (No\nsuch file or directory)\n    open(\"/usr/share/locale-langpack/is/LC_MESSAGES\", O_RDONLY) = 3\n    open(\"/usr/share/locale-langpack/is/LC_MESSAGES/SYS_LC_MESSAGES\",\nO_RDONLY) = -1 ENOENT (No such file or directory)\n    open(\"/usr/lib/locale/is/LC_CTYPE\", O_RDONLY) = -1 ENOENT (No such\nfile or directory)\n    open(\"/usr/share/locale-langpack/is/LC_CTYPE\", O_RDONLY) = -1\nENOENT (No such file or directory)\n    open(\"share/locale/\",\nO_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 5\n    open(\"share/locale/.gitignore\", O_RDONLY|O_LARGEFILE) = -1 ENOENT\n(No such file or directory)\n    open(\"share/locale/is/\",\nO_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 6\n    open(\"share/locale/is/.gitignore\", O_RDONLY|O_LARGEFILE) = -1\nENOENT (No such file or directory)\n    open(\"share/locale/is/LC_MESSAGES/\",\nO_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 7\n    open(\"share/locale/is/LC_MESSAGES/.gitignore\",\nO_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)\n\nAnd the UI remains untranslated.\n\nI'm probably doing something very silly. I'd appreciate some help if\nyou can spot what it is, if I can get this working I can start\nsubmitting some i18n patches.\n"},{"id":"141866","messageId":"20100518160708.GB20842@unpythonic.net","threadId":"23836","inReplyTo":"AANLkTikK9LAd_pwTwB56Vpq19i00X5apy6qT-ZOpnLEp@mail.gmail.com","subject":"Re: [PATCH] WIP: begin to translate git with gettext","fromName":"Jeff Epler","fromEmail":"jepler@unpythonic.net","sentAt":"2010-05-18T16:07:08Z","receivedAt":"2010-05-18T16:07:08Z","isPatch":true,"sender":{"key":"jepler@unpythonic.net","avatar":"https://avatars.githubusercontent.com/u/1517291?v=4"},"body":"Is it possible that you don't have is_IS language support?  On Ubuntu\nthis comes from a package like language-pack-is-base.\n\nI tried your po entries in a file named po/is.po, and it didn't work.\nWhen I installed language-pack-is-base, it did.\n\n$ unset LANGUAGE LC_MESSAGES; export LANG=is_IS.UTF-8\n$ /usr/local/jepler/git/bin/git status | head -1\n# A greininni master\n\nComparing the bad strace with the good, and excluding ENOENT opens, it's\nthe presence of the is_IS language pack that is the first difference.\n@@ -1,4 +1,8 @@\n open(\"/usr/share/locale/locale.alias\", O_RDONLY) = 3\n+open(\"/usr/lib/locale/is_IS.utf8/LC_MESSAGES\", O_RDONLY) = 3\n+open(\"/usr/lib/locale/is_IS.utf8/LC_MESSAGES/SYS_LC_MESSAGES\", O_RDONLY) = 3\n+open(\"/usr/lib/locale/is_IS.utf8/LC_CTYPE\", O_RDONLY) = 3\n open(\"share/locale/\", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 14\n open(\"share/locale/is/\", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 15\n open(\"share/locale/is/LC_MESSAGES/\", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 16\n+open(\"/usr/local/jepler/git/share/locale/is/LC_MESSAGES/git.mo\", O_RDONLY) = 12\n\nJeff\n"},{"id":"141869","messageId":"AANLkTilRMHuYFTaMv3p3XN2v2MVN-txOKKo7csvo9-iA@mail.gmail.com","threadId":"23836","inReplyTo":"20100518160708.GB20842@unpythonic.net","subject":"Re: [PATCH] WIP: begin to translate git with gettext","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-18T16:47:09Z","receivedAt":"2010-05-18T16:47:09Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, May 18, 2010 at 16:07, Jeff Epler <jepler@unpythonic.net> wrote:\n> Is it possible that you don't have is_IS language support?  On Ubuntu\n> this comes from a package like language-pack-is-base.\n>\n> I tried your po entries in a file named po/is.po, and it didn't work.\n> When I installed language-pack-is-base, it did.\n>\n> $ unset LANGUAGE LC_MESSAGES; export LANG=is_IS.UTF-8\n> $ /usr/local/jepler/git/bin/git status | head -1\n> # A greininni master\n\nYes, my system's settings were broken. Thanks, it works now.\n"}]}