automatic language detection

Discussion in 'Installation/Configuration' started by vistree, Nov 29, 2006.

  1. vistree

    vistree Member

    Hi group,
    is there a way to set the ISPConfig-language automatically depending on a users OS-Settings? As I have german and english speaken customers I want to offer them ISPConfig in there prefered language.

    2 thoughts:
    !. getting the language from OS-settings (may only work with Windows?)
    2. 2 different Login-pages (different port or different login-php)

    Has anyone solved such a scenario?
    Is it possible to copy the/a login script / folder and modifying the settings?

    Thanx
    Kai
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You may use your own login form, as long as you do not rename the input fields.
     
  3. vistree

    vistree Member

    thank you Till for the fast reply,
    I tried to copy the login.php in /home/admispconfig/ispconfig/web
    to login_en.php
    changing for example "Hier k├Ânnen Sie sich einloggen:" to "On this site you can login:" the sentence does not appeare anymore on the login_en.php page. And if I logout the original login.php is loaded instead of the new login_en.php

    Have you additonal informations for me?

    Thanx again
    Kai
     
  4. sjau

    sjau Local Meanie Moderator

    You can get the language from the browser but not the language of the system... browser and system may have different languages...
     
  5. vistree

    vistree Member

    @sjau
    thank you - yes, that could do the job. Still the question open, how to set ISPConfig to multilanguage-Login/Logoff-Screen.

    Kai
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can try to get the language from the browser of the user and then change line 31 in the web/login.php file to load the language file for the browser language and not the language that is defined in the configuration $go_info["server"]["lang"]
     
  7. vistree

    vistree Member

    Yes I see - but does this not only effect the pages after login? What about the login-screen itself (which is also opened by the logoff.php).
    If I try to edit the german messages - these are not any more displayed after refresh ...

    Kai
     
  8. vistree

    vistree Member

    Forget this last post! As I am no programer, I did not get Tills hint on time
    I think, that is the solution. I did not know, that there is content in /login/lib/lang/xx.lng to replace the messages on the login-screen.

    Thank you again - will post the solution when I got it ;-)
    Kai
    --- original post ---
    Yes I see - but does this not only effect the pages after login? What about the login-screen itself (which is also opened by the logoff.php).
    If I try to edit the german messages - these are not any more displayed after refresh ...

    Kai
     
  9. sjau

    sjau Local Meanie Moderator

    You could set a cookie with the language preference...
     
  10. vistree

    vistree Member

    fist solution

    As promised before I send a first solution for the login.php-language.
    A college of me, edited the original login-script in a way, that the browser-language is used to select the language of the login-screen:

    This works fine for us - but we did not test it alot - so please use it on own risk. I think, we will include an additional language selection field later where the browser-language is the default, but where users can deside to change it to there prefered one.

    Hope it helps others

    Kai
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Looks ok. I recommend to check that $langs[1] is really a string containing just 2 chars an that the file "login/lib/lang/".$go_info["server"]["lang"].".lng" exists. Otherwise you might get errors when you try to include a non existing file or you might get vulnerable for remote inclusion attacks in case the HTTP_ACCEPT_LANGUAGE header is faked.
     
  12. vistree

    vistree Member

    Hello Till, thank you again for the hints - we will include and post again.

    Kai
     

Share This Page