How difficult or easy is it to find a binary for gettext 0.15 (or later)
for Windows systems?
My reason for asking is that I would like to use a feature that was only
introduced in that version to provide context for messages where the
same string appears in two different places and should be translated
differently. There's an option to add msgctx alongside msgid and this
will provide translators with some help.
One obvious place where this appears is where we have "May" as a three
character abbreviation as well as "May" as the full month name. In some
languages, those two will be different translations, so we can mark them
differently. There are other instances reported as well.
I'm not 100% sure if we can use this yet, since it's not supported by
Python's gettext modules, so I need to fake out the gettext layer, but I
think it's possible. Would be good to know if it's worth putting in the
effort.
Regards,
Malcolm
Unfortunately it has proven to be very difficult, searches I've done
in the past have always ended with a handful of rather old
binaries (some of them even buggy as the note added to i18n.txt
r9155 shows). One thing I've meaning to to for ages is to set up all
the cygwin + msys stuff necesary to be able to create a set
of gettext 0.17 win32 binaries.
What would be the time frame you envision for this? Maybe
I can try to work on this.
>
> My reason for asking is that I would like to use a feature that was only
> introduced in that version to provide context for messages where the
> same string appears in two different places and should be translated
> differently.
>
> [...]
>
> I'm not 100% sure if we can use this yet, since it's not supported by
> Python's gettext modules, so I need to fake out the gettext layer, but I
> think it's possible. Would be good to know if it's worth putting in the
> effort.
Python bug 2504 is tracking this:
http://bugs.python.org/issue2504
--
Ramiro Morales
http://rmorales.net
If your answer had been "it's easy right now to download them", I would
make this change right now so we can fix the problems in 1.1. Given that
it's not at all easy, we'll need to be a bit more gentle with the
translators in general. So I think trying to get this done in the 1.2
timeframe, making the switch to using contexts in the few places we need
them before 1.2-alpha, would be reasonable. We have enough to do in the
next month for 1.1 without adding this to the plate.
>
> >
> > My reason for asking is that I would like to use a feature that was only
> > introduced in that version to provide context for messages where the
> > same string appears in two different places and should be translated
> > differently.
> >
> > [...]
> >
> > I'm not 100% sure if we can use this yet, since it's not supported by
> > Python's gettext modules, so I need to fake out the gettext layer, but I
> > think it's possible. Would be good to know if it's worth putting in the
> > effort.
>
> Python bug 2504 is tracking this:
>
> http://bugs.python.org/issue2504
Yeah, I'd seen that. I was going to introduce something similar into
Django's translation utilities (also in pure Python). I think this is
achievable.
Thanks for the answer here. It helps flesh out my cunning plan a bit
more. Let's put this on the list for 1.2, then.
Regards,
Malcolm
How difficult or easy is it to find a binary for gettext 0.15 (or later)
for Windows systems?
Hrm unfortunately no, GNU FTP servers have, besides the latest source
distributions, win32 binaries of gettext 0.13.1:
http://ftp.gnu.org/pub/gnu/gettext/
Fortunately this doesn't matter anymore because of what you've found,
see below.
>
> Hope it helps in someway ;)
Sure it does. Thanks Marc! I've tested them in the following way:
Downloaded:
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-tools-0.17.zip
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip
and unpacked the contents of their bin/ directories to a directory
listed in my PATH environment variable.
(Just in case I also put there the GNU.Gettext.dll and charset.alias
files from the lib/ directory contained in gettext-tools-0.17.zip)
Now I can run::
C:\>xgettext --version
xgettext (GNU gettext-tools) 0.17
Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.
And the same for msgmerge, msguniq and msgfmt.
All of
python django-admin.py makemessages -l es_AR
python django-admin.py makemessages -l es_AR -d djangojs
python django-admin.py makemessages -a
python django-admin.py makemessages -a -d djangojs
python django-admin.py compilemessages -l es_AR
python django-admin.py compilemessages
run without problems, and comparing the generated .mo files with the
ones contained in the Django SVN repository shows they only differ
in the timestamp contained in the msgid "" header.
So it seems everything is working correctly. This means we can at least
rewrite the
http://docs.djangoproject.com/en/dev/topics/i18n/#gettext-on-windows
documentation section.
Thanks again!.
--
Ramiro Morales
http://rmorales.net
PS: Googling for gettext-tools-0.17.zip I see now the GNOME FTP server appears
third in the result list :(
PS2: Now I remember a survey related to this I had attempted without success in
the mailing list two years ago:
http://groups.google.com/group/Django-I18N/browse_frm/thread/bf8ba9a92dd0048a
> So it seems everything is working correctly.
Wow. Nice research Marc and thanks for testing Ramiro. I'll have a think
about whether we want to push the requirements up for 1.1 in order to
support contexts, or wait for 1.2 (in which case I'd probably make the
change as soon as 1.1.x is made into a branch and 1.2-pre is trunk).
I must admit I don't really have a good intuition as to how many people
are using Windows for translation. This list isn't a good measure as we
get a lot of contributions from people I believe aren't on this list.
However, the process does seem fairly straightforward.
Thanks, guuys.
Regards,
Malcolm