Actions
Bug #2252
opengettext should search in several directories
Status:
In Progress
Priority:
High
Assignee:
-
Category:
-
Start date:
2012-03-07
Due date:
% Done:
70%
Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:
Description
Most programmes ship message catalogs in directories named after language code, without country code or encoding (e. g. ru, but not ru_RU or ru_RU.UTF-8). But locale is set with full specification (ru_RU.UTF-8). Currently Illumos' libc searchs only in ru_RU.UTF-8, and fails, cause there are no message catalogs there. Thus programmes always speak english.
Instead, it should trim language specification (ru_RU.UTF-8 -> ru_RU -> ru) until message catalog is found. Just like glibc on Linux:
Linux:
# strace chmod --help ... open("/usr/share/locale/ru_RU.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/ru_RU.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/ru_RU/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/ru.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/ru.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/ru/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3 ...
Illumos:
# truss /usr/gnu/bin/chmod --help ... sysconfig(_CONFIG_PAGESIZE) = 4096 open("/usr/gnu/share/locale/ru_RU.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) Err#2 ENOENT ioctl(1, TCGETA, 0x08046B40) = 0 ...
Files
Actions