Polishing stuff - gnome-filesystem package

David Zeuthen davidz at redhat.com
Sun Feb 18 17:53:40 UTC 2007


On Sun, 2007-02-18 at 12:34 -0500, David Zeuthen wrote:
> On Sun, 2007-02-18 at 12:27 -0500, Matthias Clasen wrote:
> > On Sun, 2007-02-18 at 12:19 -0500, Ray Strode wrote:
> > > Hi,
> > > > So someone last week brought forward the idea of a gnome-filesystem
> > > > package that put files in /etc/skel. This package would provide
> > > >
> > > >  /etc/skel/Documents
> > > >            Downloads
> > > >            Music
> > > >            Pictures
> > > >            Public
> > > >   
> > > It should also own common other gnome directories like 
> > > /usr/share/gnome/help,
> > > etc. and include a .gtk-bookmarks file, too, so these premade folders 
> > > make it into the file chooser.
> > 
> > Slight problem is that we have no framework for translatable bookmarks. 
> > Nautilus and GTK+ just assume that the bookmarks are in the preferred
> > language. 
> 
> Well, if problem 3. is solved in gnome-vfs, e.g.
> 
>  char *gnome_vfs_get_localized_name_for_folder (const char *path)
> 
> the I'm not sure it's hard to fix the gnome-vfs back-end of the
> filechooser. Wouldn't that work? Or are GTK+ bookmarks used elsewhere
> too? 

I mean, you'd just do, just before rendering the localized name,

        static char *
        bookmark_get_localized_name (Bookmark *b)
        {
                char *ret;
        
        	if (strcmp (b->name, g_basename (b->path) == 0)) {
                    char *l;
                    l = gnome_vfs_get_localized_name_for_folder (b->path);
                    if (l != NULL) {
                         ret = g_strdup (g_basename (l));
                         g_free (l);
                         goto out;
                    }
                    g_free (l);
                }
                ret = g_stdup (b->name);            
        out:
                return ret;
        }
        
but perhaps that's a bit ugly and too magic. The big problem here is
that people can edit the name of bookmarks. If they do that, well, all
bets are off and people are on their own.

(We should be able to handle name editing too though - e.g. if I'm in a
Danish locale and change the bookmark name to 'Billeder' then the
bookmark editor is smart about things and sets it to 'Pictures' since
'Billeder' is the danish translation for 'Pictures'. I'm not sure it's
worth the trouble though; if people wants to change the name of a
bookmark we probably should respect it even in other locales.)

      David





More information about the Fedora-desktop-list mailing list