difficult_password.php can be translated (LANG)

Version 1.51


The script: /usr/local/directadmin/scripts/difficult_password.php previously couldn't be translated: it's output was what was shown. This changes creates a new internal language pack at: /usr/local/directadmin/data/skins/enhanced/lang/en/internal/difficult_password.txt which can be translated into new languages. The number codes in the .txt file are directly linked to the exit code of the script. So exit code 0 (success) lines up with: 0=Password OK etc.. Note that 1= uses %d characters, so this is the only special case where DA passes the integers into the translation class, so #1 must contain that string, eg: 1=Password is too short (%d). Use at least %d characters the >2 don't matter, and you can add more if you want if you create a custom difficult_password.php file with higher exit codes. If any codes are missing from the internal/difficult_password.txt, then scripts output is used instead. But if the .txt for your language is completely missing, as per other internal/*.txt files, it will revert to the default langauge, usually the en folder. ----- Also, there will be an environmental variable: language=en which should show the User's current language, in case you'd instead want to control the scripts output for items not included in the internal/difficult_password.txt.

Interested to try DirectAdmin? Get a 30-day Free Trial!