[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: adduser 3.112+nmu2: Please update the PO translation for the package adduser



Le 06/11/2010 11:01, Yuri Kozlov a écrit :

> With helping debian-russian@ I made a patch for adduser.
> I test it with UTF8 and KOI8-R encodings.
> Please check it with fr_FR.

Works fine! Thanks again! You're welcome to submit your patch in a bug
against adduser. Since it's a l10n issue and the patch is not too
invasive, it should be accepted by the RT (submitting the bug will help
to convince the RT).

I just removed the “VERSION” change and kept the same indentation than
the original code (attached).

I'll ask for translation update with another +10days deadline today.

Regards

David

--- adduser-3.112+nmu1/adduser	2010-11-06 09:23:48.000000000 +0300
+++ /usr/sbin/adduser	2010-11-06 15:17:55.000000000 +0300
@@ -66,18 +66,25 @@
     }
     eval {
 	require I18N::Langinfo;
-	import I18N::Langinfo qw(langinfo YESEXPR NOEXPR);
+	import I18N::Langinfo qw(langinfo CODESET YESEXPR NOEXPR);
     };
     if ($@) {
 	*langinfo = sub { return shift; };
 	*YESEXPR  = sub { "^[yY]" };
 	*NOEXPR   = sub { "^[nN]" };
+	*CODESET  = sub { "" };
+    }
+    eval {
+	use Encode qw(decode);
+    };
+    if ($@) {
+	*decode = sub { shift; return shift; };
     }
 }
 
 setlocale(LC_MESSAGES, "");
 textdomain("adduser");
-my $yesexpr = langinfo(YESEXPR());
+my $yesexpr = decode(langinfo(CODESET()), langinfo(YESEXPR()));
 
 my %config;			# configuration hash
 
@@ -531,7 +538,7 @@
     create_homedir (1); # copy skeleton data
 
     # useradd without -p has left the account disabled (password string is '!')
-    my $yesexpr = langinfo(YESEXPR());
+    my $yesexpr = decode(langinfo(CODESET()), langinfo(YESEXPR()));
     if ($ask_passwd) {
 	for (;;) {
           my $passwd = &which('passwd');
@@ -554,6 +561,7 @@
 	    # expression will be checked to find positive answer.
 	    print (gtx("Try again? [y/N] "));
 	    chop ($answer=<STDIN>);
+	    $answer = decode(langinfo(CODESET()), $answer);
 	    last if ($answer !~ m/$yesexpr/o);
 	  }
 	  else {
@@ -571,7 +579,7 @@
 	&ch_gecos($new_gecos);
     }
     else {
-	my $noexpr = langinfo(NOEXPR());
+	my $noexpr = decode(langinfo(CODESET()), langinfo(NOEXPR()));
 	for (;;) {
            my $chfn = &which('chfn');
 	    &systemcall($chfn, $new_name);
@@ -580,6 +588,7 @@
 	    # expression will be checked to find positive answer.
 	    print (gtx("Is the information correct? [Y/n] "));
 	    chop (my $answer=<STDIN>);
+	    $answer = decode(langinfo(CODESET()), $answer);
 	    last if ($answer !~ m/$noexpr/o);
 	}
     }

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: