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 649203 - startup and gettext stuff
startup and gettext stuff
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: 2011-05-02 16:11 UTC by Dan Winship
Modified: 2011-05-16 19:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
run-js-test: link to libgnome-shell.la (2.47 KB, patch)
2011-05-02 16:11 UTC, Dan Winship
committed Details | Review
environment: move more init stuff here from main.js (7.85 KB, patch)
2011-05-02 16:11 UTC, Dan Winship
committed Details | Review
environment: put gettext stuff into global environment (18.53 KB, patch)
2011-05-02 16:11 UTC, Dan Winship
committed Details | Review
main: make "gnome-shell" the default gettext domain (1.32 KB, patch)
2011-05-02 16:11 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2011-05-02 16:11:00 UTC
or "call textdomain(), and associated yak shaving"

the last patch depends on bug 649202, since otherwise mutter will call
textdomain() after we do
Comment 1 Dan Winship 2011-05-02 16:11:03 UTC
Created attachment 187046 [details] [review]
run-js-test: link to libgnome-shell.la

The tests were broken again, because since Shell-0.1.gir now has
'shared-library="libgnome-shell.so"', the references to Shell.PerfLog
ended up pulling in libgnome-shell in addition to the copy of
shell-perf-log.c that libjs-test was built with.

Fix all this hopefully forever by just making run-js-test link to
libgnome-shell.
Comment 2 Dan Winship 2011-05-02 16:11:06 UTC
Created attachment 187047 [details] [review]
environment: move more init stuff here from main.js

Move some more environment-initializationy stuff from main.js to
environment.js, and be more careful about not importing shell JS
modules until after the environment has been fully patched.

Change gnome-shell-plugin to call Environment.init() before
Main.start(); this means that Environment.init() now runs before any
shell JS modules (besides environment itself) have been imported.

Make run-js-test create a ShellGlobal and use its js_context, so that
the shell_global_set_property_mutable() stuff in Environment.init()
will work correctly in tests as well.
Comment 3 Dan Winship 2011-05-02 16:11:09 UTC
Created attachment 187048 [details] [review]
environment: put gettext stuff into global environment

Rather than defining _() as a local function in every module, put it
into the global environment (along with C_() and ngettext()).
Comment 4 Dan Winship 2011-05-02 16:11:12 UTC
Created attachment 187049 [details] [review]
main: make "gnome-shell" the default gettext domain

Since libmutter uses dgettext(), we can take over the default domain
Comment 5 Dan Winship 2011-05-16 10:42:05 UTC
poke
Comment 6 Colin Walters 2011-05-16 17:15:52 UTC
Review of attachment 187046 [details] [review]:

Looks OK.
Comment 7 Colin Walters 2011-05-16 17:19:30 UTC
Review of attachment 187047 [details] [review]:

This looks good.
Comment 8 Colin Walters 2011-05-16 17:20:37 UTC
Review of attachment 187048 [details] [review]:

Looks like a useful cleanup.

::: js/ui/environment.js
@@ +80,3 @@
     // Set the default direction for St widgets (this needs to be done before any use of St)
     if (Gettext_gtk30.gettext('default:LTR') == 'default:RTL') {
         St.Widget.set_default_direction(St.TextDirection.RTL);

Unrelated, but is this really the official way to do things?  Seems like it'd be a lot saner to have GTK+ export a function for this.
Comment 9 Colin Walters 2011-05-16 17:21:06 UTC
Review of attachment 187049 [details] [review]:

Looks fine.
Comment 10 Dan Winship 2011-05-16 18:50:43 UTC
(In reply to comment #8)
>      if (Gettext_gtk30.gettext('default:LTR') == 'default:RTL') {
>          St.Widget.set_default_direction(St.TextDirection.RTL);
> 
> Unrelated, but is this really the official way to do things?  Seems like it'd
> be a lot saner to have GTK+ export a function for this.

Well, I think gtk is implicitly assuming that other toolkits aren't going to be piggybacking off its configuration. But anyway, you're right, we can just call gtk_widget_get_default_direction().
Comment 11 Dan Winship 2011-05-16 19:03:03 UTC
pushed along with a switch to Gtk.Widget.get_default_direction()

Attachment 187046 [details] pushed as 0e42de9 - run-js-test: link to libgnome-shell.la
Attachment 187047 [details] pushed as 7921954 - environment: move more init stuff here from main.js
Attachment 187048 [details] pushed as 898b2b9 - environment: put gettext stuff into global environment
Attachment 187049 [details] pushed as 4bfc3ba - main: make "gnome-shell" the default gettext domain