Timwi (timwi) wrote in lj_dev,
Timwi
timwi
lj_dev

Problems with internationalisation

I tried to perform the following changes to cgi-bin/ljlib.pl in order to get some of the English strings stripped:

--- cgi-bin/ljlib.pl	Fri Aug 16 15:35:52 2002
+++ diffs/ljlib.pl	Fri Aug 16 07:27:14 2002
@@ -909,20 +909,21 @@
 
         my $alturl = BML::self_link({ 'altlogin' => 1 });
 
-        $ret .= "<tr align='left'><td colspan='2' align='left'>You are currently logged in as <b>$luser</b>.";
-        $ret .= "<br />If this is not you, <a href='$alturl'>click here</a>.\n"
+        $ret .= "<tr align='left'><td colspan='2' align='left'>";
+        $ret .= BML::ml('login.loggedin', {'user'=>$luser});
+        $ret .= "<br />" . BML::ml('login.altloginlink', {'url'=>$alturl})
             unless $opts->{'noalt'};
         $ret .= "<input type='hidden' name='user' value='$luser'>\n";
         $ret .= "<input type='hidden' name='hpassword' value='$hpass'><br />&nbsp;\n";
         $ret .= "</td></tr>\n";
     } else {
-        $ret .= "<tr align='left'><td>Username:</td><td align='left'><input type='text' name='user' size='15' maxlength='15' value='";
+        $ret .= "<tr align='left'><td>$ML{'login.username'}</td><td align='left'><input type='text' name='user' size='15' maxlength='15' value='";
         my $user = $form->{'user'};
         my $query_string = BML::get_query_string();
         unless ($user || $query_string =~ /=/) { $user=$query_string; }
         $ret .= BML::eall($user) unless ($form->{'altlogin'});
         $ret .= "' /></td></tr>\n";
-        $ret .= "<tr><td>Password:</td><td align='left'>\n";
+        $ret .= "<tr><td>$ML{'login.password'}</td><td align='left'>\n";
         my $epass = LJ::ehtml($form->{'password'});
         $ret .= "<input type='password' name='password' size='15' maxlength='30' value='$epass' />";
         $ret .= "</td></tr>\n";


But when I go to test it, the entire software completely stops working, with these messages in the Apache error log:

[Fri Aug 16 15:34:50 2002] [error] Undefined subroutine &LJ::start_request called at /c/lj/cgi-bin/Apache/LiveJournal.pm line 131.
[Fri Aug 16 15:34:50 2002] [error] Undefined subroutine &LJ::start_request called at /c/lj/cgi-bin/Apache/LiveJournal.pm line 131.
[Fri Aug 16 15:34:51 2002] [error] Can't call method "get_dbh" on an undefined value at /c/lj/cgi-bin/ljlib.pl line 164.


Any help you can offer will be most appreciated...
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 9 comments