GNOME Bugzilla – Bug 649203
startup and gettext stuff
Last modified: 2011-05-16 19:03:13 UTC
or "call textdomain(), and associated yak shaving" the last patch depends on bug 649202, since otherwise mutter will call textdomain() after we do
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.
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.
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()).
Created attachment 187049 [details] [review] main: make "gnome-shell" the default gettext domain Since libmutter uses dgettext(), we can take over the default domain
poke
Review of attachment 187046 [details] [review]: Looks OK.
Review of attachment 187047 [details] [review]: This looks good.
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.
Review of attachment 187049 [details] [review]: Looks fine.
(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().
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