After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 589652 - Add internationalization
Add internationalization
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-07-24 22:13 UTC by Colin Walters
Modified: 2009-08-14 21:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add internationalization (12.56 KB, patch)
2009-07-24 22:13 UTC, Colin Walters
none Details | Review
Add internationalization (2.70 KB, patch)
2009-07-27 20:14 UTC, Colin Walters
reviewed Details | Review
Add calls to gettext for human-visible strings (9.01 KB, patch)
2009-07-27 20:14 UTC, Colin Walters
reviewed Details | Review
Add test fr translation (4.03 KB, patch)
2009-07-27 20:14 UTC, Colin Walters
reviewed Details | Review
Add localization (2.64 KB, patch)
2009-07-27 21:36 UTC, Colin Walters
none Details | Review

Description Colin Walters 2009-07-24 22:13:23 UTC
Infrastructure for internationalization; hook up intltool, create po/
and po/POTFILES.in.  We need to call bindtextdomain/bind_textdomain_codeset.

Add some initial calls to dgettext.  Note that we need to use it
instead of plain gettext since our messages aren't in the default
translation domain (mutter), because we're a plugin.
Comment 1 Colin Walters 2009-07-24 22:13:27 UTC
Created attachment 139185 [details] [review]
Add internationalization
Comment 2 Dan Winship 2009-07-25 13:47:25 UTC
(In reply to comment #0)
> Add some initial calls to dgettext.  Note that we need to use it
> instead of plain gettext since our messages aren't in the default
> translation domain (mutter), because we're a plugin.

Hm... we could take advantage of javascript's dynamicness here...

const Gettext = imports.gettext.textdomain("gnome-shell");

where imports.gettext.textdomain() would be:

function(domain) {
    return { gettext: function(string) { return dgettext(domain, string); },
             ngettext: ...
};

Comment 3 Colin Walters 2009-07-27 20:14:16 UTC
Created attachment 139318 [details] [review]
Add internationalization

Infrastructure for internationalization; hook up intltool, create po/
and po/POTFILES.in.  We need to call bindtextdomain/bind_textdomain_codeset.
Comment 4 Colin Walters 2009-07-27 20:14:25 UTC
Created attachment 139319 [details] [review]
Add calls to gettext for human-visible strings

Add some initial calls to gettext; can't be sure I got them all,
but it should be the vast majority.
Comment 5 Colin Walters 2009-07-27 20:14:31 UTC
Created attachment 139320 [details] [review]
Add test fr translation

Useful to verify that translation infrastructure is working.
Comment 6 Colin Walters 2009-07-27 20:15:45 UTC
Note this bug depends on the gjs changes in bug 589651
Comment 7 Owen Taylor 2009-07-27 20:20:56 UTC
It (In reply to comment #3)
> Created an attachment (id=139318) [edit]
> Add internationalization
> 
> Infrastructure for internationalization; hook up intltool, create po/
> and po/POTFILES.in.  We need to call bindtextdomain/bind_textdomain_codeset.

- It's localization not internationalization that you are adding :-)
 
- You don't seem to use intltool at all. Maybe adding intltool should wait and go along with setting up the GConf schemas for translation?

- Patch otherwise looks fine

- Have you checked 'make distcheck'?
Comment 8 Owen Taylor 2009-07-27 20:25:16 UTC
(In reply to comment #4)
> Created an attachment (id=139319) [edit]
> Add calls to gettext for human-visible strings
> 
> Add some initial calls to gettext; can't be sure I got them all,
> but it should be the vast majority.

Looks very visually clunk to scatter Gettext.gettext() all over the source code. Any reason not to follow the same conventions as with C?
Comment 9 Owen Taylor 2009-07-27 20:27:15 UTC
(In reply to comment #5)
> Created an attachment (id=139320) [edit]
> Add test fr translation
> 
> Useful to verify that translation infrastructure is working.

Looks fine.

Comment 10 Colin Walters 2009-07-27 20:39:48 UTC
(In reply to comment #8)
> (In reply to comment #4)
> > Created an attachment (id=139319) [edit]
> > Add calls to gettext for human-visible strings
> > 
> > Add some initial calls to gettext; can't be sure I got them all,
> > but it should be the vast majority.
> 
> Looks very visually clunk to scatter Gettext.gettext() all over the source
> code. Any reason not to follow the same conventions as with C?

You mean like

const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext;

?
Comment 11 Colin Walters 2009-07-27 21:36:29 UTC
Created attachment 139327 [details] [review]
Add localization

Infrastructure for localization; hook up intltool, create po/
and po/POTFILES.in.  We need to call bindtextdomain/bind_textdomain_codeset.
Comment 12 Owen Taylor 2009-07-29 21:50:28 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > (In reply to comment #4)
> > > Created an attachment (id=139319) [edit]
> > > Add calls to gettext for human-visible strings
> > > 
> > > Add some initial calls to gettext; can't be sure I got them all,
> > > but it should be the vast majority.
> > 
> > Looks very visually clunk to scatter Gettext.gettext() all over the source
> > code. Any reason not to follow the same conventions as with C?
> 
> You mean like
> 
> const Gettext = imports.gettext.domain('gnome-shell');
> const _ = Gettext.gettext;

Yeah. (Though see some discussion I added to gjs bug about whether we can put more support in the module there.)

Comment 13 Colin Walters 2009-07-30 05:30:47 UTC
I don't have a strong opinion; calling .gettext doesn't seem particularly onerous to me since we just don't have that many strings in JavaScript right now.  But I'm fine with doing _ if it appears compelling to others.
Comment 14 Colin Walters 2009-08-14 13:33:30 UTC
Pushed using _.
Comment 15 André Klapper 2009-08-14 21:10:31 UTC
Please ask on gnome-i18n@ list to get listed at
http://l10n.gnome.org/module/gnome-shell/ and also ask translators for translations.