On Fri, 2 May 2008 12:12:58 -0500 David Jensen <david567@xxxxxxxxxxxxxx> wrote: > The string is treated as ascii in e2_filelist.c. Should it be > really enclosed _()? Attached a new patch, maybe it makes it all translatable. David Jensen
--- emelfm2-0.4/src/filesystem/e2_fs.c 2008-02-18 18:22:09.000000000 -0600 +++ emelfm2-0.4.new/src/filesystem/e2_fs.c 2008-05-02 13:03:47.000000000 -0500 @@ -2792,43 +2792,39 @@ */ void e2_fs_get_perm_string (gchar *buf, gint len, mode_t mode) { - gchar *perm_sets[8]; - perm_sets[0] = _("---"); - perm_sets[1] = _("--x"); - perm_sets[2] = _("-w-"); - perm_sets[3] = _("-wx"); - perm_sets[4] = _("r--"); - perm_sets[5] = _("r-x"); - perm_sets[6] = _("rw-"); - perm_sets[7] = _("rwx"); - - gint u, g, o; - u = (mode & S_IRWXU) >> 6; - g = (mode & S_IRWXG) >> 3; - o = (mode & S_IRWXO); + g_snprintf (buf, len, _("-rwxrwxrwx")); + + gint mask = 1; + gint i; + for (i = 9; i > 1; --i) { + if (!(mode & mask)) + buf[i] = buf[0]; + mask = mask << 1; + } - g_snprintf (buf, len, "-%s%s%s", perm_sets[u], perm_sets[g], perm_sets[o]); //_I( FIXME the things below do not suppport translation !! + gchar *ftypes = _("ldbcfs"); if (S_ISLNK(mode)) - buf[0] = 'l'; + buf[0] = ftypes[0]; else if (S_ISDIR(mode)) - buf[0] = 'd'; + buf[0] = ftypes[1]; else if (S_ISBLK(mode)) - buf[0] = 'b'; + buf[0] = ftypes[2]; else if (S_ISCHR(mode)) - buf[0] = 'c'; + buf[0] = ftypes[3]; else if (S_ISFIFO(mode)) - buf[0] = 'f'; + buf[0] = ftypes[4]; else if (S_ISSOCK(mode)) - buf[0] = 's'; + buf[0] = ftypes[5]; + gchar *fbits = _("TtSs"); if (mode & S_ISVTX) - buf[9] = (buf[9] == '-') ? 'T' : 't'; + buf[9] = (buf[9] == '-') ? fbits[0] : fbits[1]; if (mode & S_ISGID) - buf[6] = (buf[6] == '-') ? 'S' : 's'; + buf[6] = (buf[6] == '-') ? fbits[2] : fbits[3]; if (mode & S_ISUID) - buf[3] = (buf[3] == '-') ? 'S' : 's'; + buf[3] = (buf[3] == '-') ? fbits[2] : fbits[3]; } /** @brief display error message @a msg, with current system error description