[pacman-dev] [patch] extra newlines in package install reason
Newlines were included in both setting the string variable and in the printf, remove the extra ones. Signed-off-by: Dan McGee <dpmcgee@gmail.com> --- pacman-lib.orig/src/pacman/package.c 2007-01-21 17:42:14.000000000 -0500 +++ pacman-lib/src/pacman/package.c 2007-01-21 17:40:50.000000000 -0500 @@ -49,13 +49,13 @@ void dump_pkg_full(pmpkg_t *pkg, int lev switch((long)alpm_pkg_get_reason(pkg)) { case PM_PKG_REASON_EXPLICIT: - reason = _("Explicitly installed\n"); + reason = _("Explicitly installed"); break; case PM_PKG_REASON_DEPEND: - reason = _("Installed as a dependency for another package\n"); + reason = _("Installed as a dependency for another package"); break; default: - reason = _("Unknown\n"); + reason = _("Unknown"); break; }
On Sun, Jan 21, 2007 at 05:51:51PM -0500, Dan McGee wrote:
Newlines were included in both setting the string variable and in the printf, remove the extra ones.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
--- pacman-lib.orig/src/pacman/package.c 2007-01-21 17:42:14.000000000 -0500 +++ pacman-lib/src/pacman/package.c 2007-01-21 17:40:50.000000000 -0500 @@ -49,13 +49,13 @@ void dump_pkg_full(pmpkg_t *pkg, int lev
switch((long)alpm_pkg_get_reason(pkg)) { case PM_PKG_REASON_EXPLICIT: - reason = _("Explicitly installed\n"); + reason = _("Explicitly installed"); break; case PM_PKG_REASON_DEPEND: - reason = _("Installed as a dependency for another package\n"); + reason = _("Installed as a dependency for another package"); break; default: - reason = _("Unknown\n"); + reason = _("Unknown"); break; }
The po files needs to be updated too. Many msgids are already out of sync. Jürgen
On 1/21/07, Jürgen Hötzel <juergen@hoetzel.info> wrote:
The po files needs to be updated too. Many msgids are already out of sync.
Jürgen
I'm not completely familiar with how po files work, but I am guessing they are out of date and/or missing translations. Depending on our eventual release, we should send out some requests to people for any translations they can help us with. Before this point, we should set ourselves a deadline for changing text output in pacman. I believe this was mentioned in another email by Aaron, but moving the logging out of the backend would have another advantage- it allow us to not need translation in the library. I guess there could be more text in the backend that I'm not sure about, but I haven't looked closely enough. I'm sure we could generate some interest on the forums for translations to multiple languages if we give enough advance notice. -Dan
I'm not completely familiar with how po files work, but I am guessing they are out of date and/or missing translations. Depending on our eventual release, we should send out some requests to people for any translations they can help us with.
Launchpad.net has a pretty neat system for translations, maybe use something like they have. Would simplify teamwork on the translations at least :) -- Mvh Kristian Klette «Programs for sale: Fast, Reliable, Cheap: choose two.»
On Sun, Jan 21, 2007 at 07:17:02PM -0500, Dan McGee <dpmcgee@gmail.com> wrote:
I'm not completely familiar with how po files work
http://www.gnu.org/software/gettext/manual/gettext.html time for RTFM ;) udv / greetings, VMiklos -- Developer of Frugalware Linux, to make things frugal - http://frugalware.org
On 1/22/07, VMiklos <vmiklos@frugalware.org> wrote:
http://www.gnu.org/software/gettext/manual/gettext.html
time for RTFM ;)
I found it yesterday and the manual still confuses me. :) Is there no make target to update the po files? I figured automake would build one in, but I guess I'm wrong; I couldn't find it yesterday. -Dan
On 1/22/07, Dan McGee <dpmcgee@gmail.com> wrote:
I found it yesterday and the manual still confuses me. :) Is there no make target to update the po files? I figured automake would build one in, but I guess I'm wrong; I couldn't find it yesterday.
Yeah, it took me a tad to get my head around the concepts too - perhaps it has to do with being a native en_US speaker and not having to deal with huge amounts of translations. Basically, xgettext finds the strings it needs (I don't know precisely if it scans for _("foo") or not, or just grabs all strings - that's probably in the docs somewhere), and spits them out to a file (pacman.pot for the src/pacman/po dir). This file is then copied to some LANG.po and translations are added. The _("foo") macro which is part of util.h (in src/pacman) calls gettext with the the translation "domain", which appears to be "pacman": pacman.c: bindtextdomain("pacman", "/usr/share/locale"); This just does the lookup based on the user's locale. So. Anytime you add a new string, change a string, or do something of that nature, it should: a) be surrounded by the _() macro, so it's translatable b) need a translation, or the translation fixed. Now, for the record, I'm not really sure about the significance of po4a. All I know is it's supposed to "aid in maintaining translations" - it adds some sort of convenience layer on top, but as I said, I don't know any other language passably enough to translate, so have no experience with this side of things.
On 1/22/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 1/22/07, Dan McGee <dpmcgee@gmail.com> wrote:
I found it yesterday and the manual still confuses me. :) Is there no make target to update the po files? I figured automake would build one in, but I guess I'm wrong; I couldn't find it yesterday.
Yeah, it took me a tad to get my head around the concepts too - perhaps it has to do with being a native en_US speaker and not having to deal with huge amounts of translations.
Basically, xgettext finds the strings it needs (I don't know precisely if it scans for _("foo") or not, or just grabs all strings - that's probably in the docs somewhere), and spits them out to a file (pacman.pot for the src/pacman/po dir). This file is then copied to some LANG.po and translations are added.
I think if you add the option --keyword=_ to xgettext, it does what we expect. Also, it seems like there is a file listing in POTFILES.in of some sort, although just doing a *.c selector should work... msgmerge allows you to update existing po files and keep the original translations if they still apply.
The _("foo") macro which is part of util.h (in src/pacman) calls gettext with the the translation "domain", which appears to be "pacman": pacman.c: bindtextdomain("pacman", "/usr/share/locale"); This just does the lookup based on the user's locale.
So. Anytime you add a new string, change a string, or do something of that nature, it should: a) be surrounded by the _() macro, so it's translatable b) need a translation, or the translation fixed.
Now, for the record, I'm not really sure about the significance of po4a. All I know is it's supposed to "aid in maintaining translations" - it adds some sort of convenience layer on top, but as I said, I don't know any other language passably enough to translate, so have no experience with this side of things.
I think po4a is mainly for docs- e.g. the man pages.
participants (5)
-
Aaron Griffin
-
Dan McGee
-
Jürgen Hötzel
-
Kristian Klette
-
VMiklos