shadow-maint / shadow

Upstream shadow tree
Other
300 stars 230 forks source link

pwck - Lost in translation. #490

Open jospezial opened 2 years ago

jospezial commented 2 years ago

locale LANG=de_DE.utf8 LC_CTYPE="de_DE.utf8" LC_NUMERIC="de_DE.utf8" LC_TIME="de_DE.utf8" LC_COLLATE="de_DE.utf8" LC_MONETARY="de_DE.utf8" LC_MESSAGES="de_DE.utf8" LC_PAPER="de_DE.utf8" LC_NAME="de_DE.utf8" LC_ADDRESS="de_DE.utf8" LC_TELEPHONE="de_DE.utf8" LC_MEASUREMENT="de_DE.utf8" LC_IDENTIFICATION="de_DE.utf8" LC_ALL=

pwck manpage is half english, half german. pwck output question is german but "j" for "ja" (yes) does not work. Have to answer the german question with "y".

Kein passender Passwortdatei-Eintrag in /etc/shadow
Benutzer »portage« zu /etc/shadow hinzufügen? j
Benutzer »games«: Verzeichnis »/usr/games« existiert nicht.
pwck: Keine Änderungen

Kein passender Passwortdatei-Eintrag in /etc/shadow
Benutzer »portage« zu /etc/shadow hinzufügen? y
Benutzer »games«: Verzeichnis »/usr/games« existiert nicht.
pwck: Die Dateien wurden aktualisiert.
jubalh commented 1 year ago

This is due to the fact that rpmatch() in libmisc/yesno.c checks directly for y and Y: https://github.com/shadow-maint/shadow/blob/35e91daba0c42df264ab2abca72f7546b549e586/libmisc/yesno.c#L79

I'm not sure whether such single chars can be translated? We could change the text to look like: Benutzer »portage« zu /etc/shadow hinzufügen? (y/n) ? So people are aware that they need to press the y in call languages?

vapier commented 1 year ago

yes, it can be translated. glibc has a bunch.

https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/rpmatch.c;h=91e3eeb8f88283e3ddfabaecead71f227dc584c7;hb=a704fd9a133bfb10510e18702f48a6a9c88dbbd5#l53

https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/locales/ja_JP;h=c727997b6b1508af775286b4c588617289af53cf;hb=a704fd9a133bfb10510e18702f48a6a9c88dbbd5#l14881