* [Bluez-devel] [PATCH] Support translations in bluez-utils
@ 2008-05-21 12:57 Michael Terry
2008-05-21 14:31 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Michael Terry @ 2008-05-21 12:57 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 1156 bytes --]
Hello!
I am attaching a patch and some files that all together allow gettext
translations for bluez-utils. I'd appreciate a review/commit.
The particular strings motivating this patch were the service names in
hcid/dbus-service.c. There may be other good candidates for
translation, but I only marked those few strings.
I noted there was an audio/audio.service file which would also be a
candidate for translation, but I didn't see it being used anywhere? I
can provide a further patch for that if it's used.
Files:
bluez-utils-po.diff
gi18n.h (add as eglib/glib/gi18n.h - this is a simplified copy from
glib; it goes in the redundant glib subdirectory to match glib's include
layout)
Makevars (add as po/Makevars - this is like a config file for gettext)
POTFILES.in (add as po/POTFILES.in - this lists any files to scan for
marked strings)
Also, you'll need to add a blank LINGUAS file in the po directory in
which to add language codes as they come in.
Finally, you should add a blank ChangeLog file in the po directory for
translators (or whoever cvs commits) to note new/updated translations.
Thank you!
-mt
[-- Attachment #1.1.2: gi18n.h --]
[-- Type: text/x-chdr, Size: 1235 bytes --]
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __G_I18N_H__
#define __G_I18N_H__
/*#include <glib/gstrfuncs.h>*/
#include <libintl.h>
#define _(String) gettext (String)
/*#define Q_(String) g_dpgettext (NULL, String, 0)*/
#define N_(String) (String)
/*#define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1)*/
#endif /* __G_I18N_H__ */
[-- Attachment #1.1.3: Makevars --]
[-- Type: text/plain, Size: 1858 bytes --]
# Makefile variables for PO directory in any package using GNU gettext.
# Usually the message domain is the same as the package name.
DOMAIN = bluez-utils
# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
# package. (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.) Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Marcel Holtmann
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS = bluez-devel@lists.sf.net
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
[-- Attachment #1.1.4: POTFILES.in --]
[-- Type: text/plain, Size: 21 bytes --]
hcid/dbus-service.c
[-- Attachment #1.1.5: bluez-utils-po.diff --]
[-- Type: text/x-patch, Size: 1871 bytes --]
Index: Makefile.am
===================================================================
RCS file: /cvsroot/bluez/utils/Makefile.am,v
retrieving revision 1.42
diff -r1.42 Makefile.am
5c5,9
< cups test scripts
---
> cups test scripts po
>
> ACLOCAL_AMFLAGS = -I m4
>
> EXTRA_DIST = config.rpath
Index: bootstrap
===================================================================
RCS file: /cvsroot/bluez/utils/bootstrap,v
retrieving revision 1.7
diff -r1.7 bootstrap
3a4
> autopoint --force && \
Index: configure.in
===================================================================
RCS file: /cvsroot/bluez/utils/configure.in,v
retrieving revision 1.142
diff -r1.142 configure.in
4c4,5
< AM_INIT_AUTOMAKE(bluez-utils, 3.31)
---
> PACKAGE=bluez-utils
> AM_INIT_AUTOMAKE($PACKAGE, 3.31)
38a40,45
> GETTEXT_PACKAGE=$PACKAGE
> AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name])
> AC_SUBST(GETTEXT_PACKAGE)
> AM_GNU_GETTEXT([external])
> AM_GNU_GETTEXT_VERSION([0.17])
>
62a70
> po/Makefile.in
Index: eglib/Makefile.am
===================================================================
RCS file: /cvsroot/bluez/utils/eglib/Makefile.am,v
retrieving revision 1.3
diff -r1.3 Makefile.am
1d0
<
5a5
> EXTRA_DIST = glib/gi18n.h
Index: hcid/dbus-service.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-service.c,v
retrieving revision 1.156
diff -r1.156 dbus-service.c
44a45
> #include <glib/gi18n.h>
586c587
< name = "Input service";
---
> name = _("Input service");
588c589
< name = "Audio service";
---
> name = _("Audio service");
590c591
< name = "Network service";
---
> name = _("Network service");
592c593
< name = "Serial service";
---
> name = _("Serial service");
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 230 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-devel] [PATCH] Support translations in bluez-utils
2008-05-21 12:57 [Bluez-devel] [PATCH] Support translations in bluez-utils Michael Terry
@ 2008-05-21 14:31 ` Marcel Holtmann
2008-05-21 14:38 ` Michael Terry
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2008-05-21 14:31 UTC (permalink / raw)
To: BlueZ development
Hi Michael,
> I am attaching a patch and some files that all together allow gettext
> translations for bluez-utils. I'd appreciate a review/commit.
>
> The particular strings motivating this patch were the service names in
> hcid/dbus-service.c. There may be other good candidates for
> translation, but I only marked those few strings.
actually this is going away in the near future. The logic to provide a
service friendly name will be done in bluez-gnome and the bluez-utils
will only export a service identifier.
In addition I also think that translation for system level functionality
is useless :)
Regards
Marcel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-devel] [PATCH] Support translations in bluez-utils
2008-05-21 14:31 ` Marcel Holtmann
@ 2008-05-21 14:38 ` Michael Terry
0 siblings, 0 replies; 3+ messages in thread
From: Michael Terry @ 2008-05-21 14:38 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1.1: Type: text/plain, Size: 556 bytes --]
On Wed, 2008-05-21 at 16:31 +0200, Marcel Holtmann wrote:
> actually this is going away in the near future. The logic to provide a
> service friendly name will be done in bluez-gnome and the bluez-utils
> will only export a service identifier.
Aha. Good.
> In addition I also think that translation for system level functionality
> is useless :)
Well, these strings were being presented to the user, so it's just as
useful as any other translation, eh? But if the strings are moving to
bluez-gnome, that's just as good.
Thanks,
-mt
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 230 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-21 14:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 12:57 [Bluez-devel] [PATCH] Support translations in bluez-utils Michael Terry
2008-05-21 14:31 ` Marcel Holtmann
2008-05-21 14:38 ` Michael Terry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).