Ticket #122 (closed enhancement: fixed)

Opened 5 years ago

Last modified 20 months ago

add proper i18n/l10n/gettext support to avahi

Reported by: lennart Owned by: tedp
Milestone: Avahi 0.6.26 Component: avahi-core
Keywords: Cc: uws@…, takao.fujiwara@…, Raven

Description

the stdb stuff already has that and the rest needs that as well.

Attachments

avahi-xx-g11n-i18n-ui-head.diff (23.2 kB) - added by fujiwara 4 years ago.
Updated the patch.
0001-Add-localization-support-to-avahi-ui-and-avahi-disco.patch (13.3 kB) - added by tedp 3 years ago.
Updated patch against git master
avahi-xx-g11n-i18n-ui-head.2.diff (13.1 kB) - added by fujiwara 3 years ago.
Patch for avahi-python/avahi-discover/Makefile.am, avahi-python/avahi-discover/avahi-discover.desktop.in.in, avahi-python/avahi-discover/avahi-discover.in, avahi-ui/avahi-ui.c, po/POTFILES.in, po/POTFILES.skip
avahi-xx-g11n-i18n-ui-head.3.diff (3.8 kB) - added by fujiwara 3 years ago.
Patch for avahi-python/avahi-discover/Makefile.am, avahi-python/avahi-discover/avahi-discover.py, po/POTFILES.in, po/POTFILES.skip

Change History

Changed 5 years ago by uws

  • cc uws@… added

Changed 5 years ago by uws

Are you planning to use the glib facilities for this?

Changed 5 years ago by uws

If so, add this to configure.ac:

# i18n GETTEXT_PACKAGE=avahi AC_SUBST([GETTEXT_PACKAGE]) AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package]) AM_GLIB_GNU_GETTEXT IT_PROG_INTLTOOL([0.35.0])

And add po/Makefile.in to AC_CONFIG_FILES.

Now create a po/ directory, and populate po/POTFILES.in and po/POTFILES.skip, e.g. POTFILES.in may list these files:

avahi-ui/avahi-ui.c avahi-ui/bssh.c

Now you have to include propert gettext stuff in the source files. I don't know how that works for libraries from the top of my head.

Changed 5 years ago by uws

(repost with better formatting)

If so, add this to configure.ac:

# i18n
GETTEXT_PACKAGE=avahi
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package])
AM_GLIB_GNU_GETTEXT
IT_PROG_INTLTOOL([0.35.0])

And add po/Makefile.in to AC_CONFIG_FILES.

Now create a po/ directory, and populate po/POTFILES.in and po/POTFILES.skip, e.g. POTFILES.in may list these files:

avahi-ui/avahi-ui.c
avahi-ui/bssh.c

Now you have to include propert gettext stuff in the source files. I don't know how that works for libraries from the top of my head.

Changed 5 years ago by lennart

  • status changed from new to assigned

Thanks, it is indeed very likely that I will use GNOME's intltool for this.

Changed 4 years ago by fujiwara

  • cc takao.fujiwara@… added

I attached the patch.

Could you review it?

intltoolize -c -f --automake
aclocal
autoheader
autoconf
automake -c -f -a
./configure $FLAGS

Changed 4 years ago by uws

Looks good. What about using

  -e s!\@LOCALEDIR\@!$(datadir)/locale! \

in Makefile.am and then using @LOCALEDIR@ in the Python file?

Changed 4 years ago by uws

Oh, and I think you should use IT_PROG_INTLTOOL instead of AC_PROG_INTLTOOL (not sure though).

Changed 4 years ago by uws

Btw, shouldn't there be any bindtextdomain stuff in the C code?

Changed 4 years ago by fujiwara

Updated the patch.

Changed 4 years ago by fujiwara

Thanks for the comments. I updated the patch.

in Makefile.am and then using @LOCALEDIR@ in the Python file?

Yes, I think it looks better.

Oh, and I think you should use IT_PROG_INTLTOOL instead of AC_PROG_INTLTOOL (not sure though).

Yes, you're right. Sorry, I forgot it.

Btw, shouldn't there be any bindtextdomain stuff in the C code?

I'm not sure what you mean. Do you see any problems in bssh bindtextdomain stuff?

Changed 4 years ago by fujiwara

Hi,

Could you integrate the patch?

Changed 4 years ago by Raven

  • cc Raven added

Changed 4 years ago by tedp

  • owner changed from lennart to tedp
  • status changed from assigned to new

I'll take care of this, probably next weekend.

Changed 4 years ago by tedp

  • status changed from new to assigned

Changed 3 years ago by fujiwara

what is the status?

Changed 3 years ago by tedp

Sorry, I forgot about this. I will try to do it this week.

Feel free to ping me if I forget again.

Changed 3 years ago by tedp

Updated patch against git master

Changed 3 years ago by fujiwara

Patch for avahi-python/avahi-discover/Makefile.am, avahi-python/avahi-discover/avahi-discover.desktop.in.in, avahi-python/avahi-discover/avahi-discover.in, avahi-ui/avahi-ui.c, po/POTFILES.in, po/POTFILES.skip

Changed 3 years ago by fujiwara

OK, I added the latest patch, please integrate it into the trunk.

Thanks.

Changed 3 years ago by fujiwara

I renamed avahi-discover.in to avahi-discover.py so that intltool can detect the file.
% cd po
% intltool-update -m

Changed 3 years ago by lennart

OK, I have now merged tedp's latest patch. I must admit that I don't fully understand all this i18n stuff. However, I trust tedp enough to merge his patch without understanding it. fujiwara, tedp: could you two please work together and rebase fujiwara's latest patch on the stuff that is not in git master and review the patch while doing so? I'll then merge that as well.

Changed 3 years ago by lennart

The commis is r4e0e2fd btw.

Changed 3 years ago by fujiwara

Patch for avahi-python/avahi-discover/Makefile.am, avahi-python/avahi-discover/avahi-discover.py, po/POTFILES.in, po/POTFILES.skip

Changed 3 years ago by fujiwara

The integrated patch is not completed yet.
I attached the left patch.

Please integrate my patch simply.

I must admit that I don't fully understand all this i18n stuff. However, I trust tedp enough to merge his patch without understanding it.

I'm expert in this area.

I replaced avahi-discover.in with avahi-discover.py so that intltool-update detects it.

Changed 20 months ago by lennart

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone set to Avahi 0.6.26

I have now commited fujiwara's patch (or at least an updated version). Thanks!

Note: See TracTickets for help on using tickets.