GNOME Bugzilla – Bug 710487
Standard folder names are not shown in Russian locale
Last modified: 2018-09-08 23:29:15 UTC
Created attachment 257682 [details]
There are some 'invalid glyph' characters instead.
Additionally, their tooltip shows some mumbo-jumbo in %-encoded format.
How to reproduce exactly, click by click?
What is the exact locale (output of the command "locale" in a terminal window)?
Which version of xdg-user-dirs is installed?
???? Just open home folder, it's right there.
xdg-user-dirs in 0.14
Места, Корзина, etc. all shown correctly for me in Fedora and nautilus 3.8.
Which distribution is this about? Did you file a ticket in the bugtracker of your distribution?
Created attachment 257805 [details]
I tried with Fedora/3.8.2, same effect.
Is this bug still happening?
Nautilus now uses GtkPlacesSidebar instead of it's own sidebar.
Yes, it still happens in 3.26.4.
What is the output of the following two commands:
Also, what is the output of this command?
I think I may have reproduced this bug by running the following command:
> LANG=ru_RU G_FILENAME_ENCODING=@locale nautilus
My locale is "pt_PT.UTF-8", and the localization of the "Music" folder in has a non-ascii character ("ú"): "Música".
When running the above command, nautilus Home folder view will display "MУКsica", which is correct given the filename encoding. But the sidebar still displays "Música", which is wrong. However, the tooltip actually displays "/home/antonio/MУКsica".
(My /etc/xdg/user-dirs.conf file has filename_encoding=UTF-8, and I don't have a ~/.config/user-dirs.conf file.)
OK, I was able to reproduce the bug exactly as reported.
### Steps to reproduce:
1) Have a ~/.config/user-dirs.conf text file with the following content:
2) Quit nautilus with this command:
> nautilus -q
3) Run this command to update user-dirs.dirs to ru_RU.KOI8-R:
> LANG=ru_RU.koi8r xdg-user-dirs-gtk-update
3.1) In the dialog, choose the second action (which confirms updating the folder names)
4) Launch nautilus in Russian:
> LANG=ru_RU.koi8r nautilus
The terminal output displays repeated messages like this:
> (nautilus:22474): Pango-WARNING **: 22:36:12.412: Invalid UTF-8 string passed to pango_layout_set_text()
The XDG folders in the sidebar are displayed with invalid character, as originally described. The tooltips also show %-encoded IRIs.
Everywhere else in nautilus interface, the XDG folders have their name correctly displayed for this encoding (ex. the music folder is "Музыка").
Different from the screenshot in attachment 257682 [details] is that "Recent", "Home", "Trash" etc. are all properly translated. This may be because I have gone with "LANG=ru_RU.koi8r" instead of "LANG=ru_RU.koi8u". I did it this because of this warning:
> (nautilus:22986): Gtk-WARNING **: 22:46:15.855: Locale not supported by C library.
> Using the fallback 'C' locale.
KOI8-U differs from KOI8-R by only 8 characters, so it should not make a difference for the purpose of this bug.
From reading the source code of gtk/gtkplacessidebar.c, I've noticed that, for the built-in xdg-user-dirs location (except Desktop), we get the name from g_file_get_basename().
According to the docs:
> The base name is a byte string (not UTF-8). It has no defined encoding
But then we proceed to use that label in UI anyway (assuming that it is UTF-8). I'm not sure but this may be the problem.
About the tooltip, we get it with g_file_get_parse_name(), which, as documented, may return a IRI, which may explain the "mumbo-jumbo in %-encoded format." as originally reported.
In any case, this bug is not specific to nautilus but is present in any use of GtkPlacesSidebar. So, I will create a new issue in GitLab before closing here.
@Urmas, in any case, please confirm if /etc/xdg/user-dirs.conf or ~/.config/user-dirs.conf in your system contain the line filename_encoding=koi8u
Reported to Gtk+ as https://gitlab.gnome.org/GNOME/gtk/issues/1322
Let's continue tracking this there.