Jump to content

Xavier - PHP Login Script & User Management Admin Panel ->translation


Recommended Posts

I am using this login-script, but i am not able to translate the errormessages.
f.e.
 

function register($subuser, $subpass, $subconf_pass, $subemail, $subconf_email, $subfirstname, $sublastname, $subkennel, $subdog, $subidentify){
      global $database, $form, $mailer;  //The database, form and mailer object
      $token = $this->generateRandStr(16);	
      $config = $database->getConfigs();
      /* Username error checking */
      $field = "user";  //Use field name for username
      if(!$subuser || strlen($subuser = trim($subuser)) == 0){
         $form->setError($field, "*Username not entered");
      }

i have languages files, fetched via url. In this file there are the translations.

I tried
 

$form->setError($field, $username_already_used); //nothing is shown

$form->setError($field, "."$username_already_used"."); //Parse error: syntax error, unexpected '$username_already_used' (T_VARIABLE) in /www/htdocs/w00fa8ed/include/session.php on line 299

$form->setError($field, "*".$username_already_used."*");//only shown **

$form->setError($field, $$username_already_used);//nothing is shown

$form->setError($field, "* Username not entered x {$username_already_used} xx");//* Username not entered x xx

any ideas?

 

19 minutes ago, Tanja said:

i have languages files, fetched via url.

if by that you mean you are requiring a .php language definition file using a URL, that won't work, since only the output (echo/print) from that file will be required. you must use a disk filesystem path/filename to require the file.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.