#31 Czech translation

closed-accepted
nobody
None
5
2013-01-21
2012-02-28
Petr Písař
No

Hello,

I have finally finished translating quota tools into Czech language. Gzipped Czech PO catalogue with latests messages from git master HEAD is attached.

I found various obstacles in quota internationalization. If you are interested how to improve it, read the TODO and FIXME comments in the file.

Discussion

  • Jan Kara
    Jan Kara
    2012-02-29

    Thanks. I've added the file and also fixed some of the issues with messages which were easier to fix.

    Regarding your plural questions - is there a standard way how to solve this?
    There are two duplicated messages - is that a problem?
    Also I'm not sure what should be done with the fact that printf counts bytes and not characters... Maybe I could internationalize the format string.

     
  • Petr Písař
    Petr Písař
    2012-03-01

    Gettext can handle plural forms for a single counter using ngettext(3) function. I'm not sure whether you need adding the function name to xgettext -k explicitly. There is no standard short-cut macro like _() for gettext(). Common practice is call ngetext() directly.

    Duplicated message is not a problem itself. However if you unified the three messages, translators would need to translate it only once.

    Counting bytes by printf() is ugly. Standard library does not provide an easy variant of printf(3) to measure text width correctly. However it provides functions combining them enables programmer to implement it. There is important fact that counting characters is not enough. You need count columns on the terminal because some characters are invisible (e.g. word joiner) and some characters occupy more columns (e.g. CJK symbols). The functions are wcwidth(3) and mbrtowc(3). You can see how I use them at
    <http://repo.or.cz/w/shigofumi.git/blob/HEAD:/src/utils.c> in functions localewidth() or fnprintf().

    Localizing formate string could be another option but I think there is non-trivial problem when switching from UTF-8 to ISO-8859-* encoding. Then number of bytes of translated message differ, but this is nothing a translator could solve because this is done at run-time. Also glibc translitarates some characters in this case (e.g. … → ... or „ → ,,).

     
  • Petr Písař
    Petr Písař
    2012-03-01

    I saw how you fixed the type2name(). Unfortunately this is not enough.

    If you call _(type2name(type)), then it results e.g. into gettext("user"), however the "user" string does not present in catalog of translations because the string is not found by xgettext because it's not denoted by a symbol recognized by xgettext:

    #define INITQFNAMES { \ "user", /* USRQUOTA */ \ "group", /* GRPQUOTA */ \ "undefined", \ }

    Static string i18n is done so:

    #define N_(x) (x)
    #define INITQFNAMES { \ N_("user"), /* USRQUOTA */ \ N_("group"), /* GRPQUOTA */ \ N_("undefined"), \ }
    printf("%s", _(type2name(1)));

    and running xgettext -k_ -kN_.

    And actually this is still problematic for some languages. E.g flexive languages like Czech require different translations for different cases or numbers which cannot be solved by this gluing words (e,g "Could not set %s quota"). However I understand it's hard problem and it's not worth complicating quota code.

     
  • Jan Kara
    Jan Kara
    2012-03-01

    Thanks for info. I've fixed the type2name() localization I think. I'll have a look at the plurals sometime later.

    Regarding printf - well, but then easy and obvious printf is converted to a sequence of commands whose only purpose is to print a single line where each word begins on a given column. That doesn't sound too attractive. But I think in this particular case, I can just make that printf a single string padded with spaces as needed and translators can deal with it. As you say there are possible problems with locale but in this particular case I can hardly imagine someone would use something else than standard letters + accents and these should result in a fixed number of columns used regardless of locale.

     
  • Petr Písař
    Petr Písař
    2012-09-10

    I've updated Czech translation for quota-tools 4.01. I've circumvented the "%s quota file" by translating it as "kvótový soubor pro třídu %s", where %s is user/group/undefined, translated as uživatel/skupina/neurčeno. And that, I think, is sufficient.

     
  • Jan Kara
    Jan Kara
    2013-01-21

    Somehow I think I missed the update of the translation. Updated now.

     


Anonymous


Cancel   Add attachments