How-To: Change Default Language

From CPWiki

Jump to: navigation, search

First, our thanks to Juan R. Pozo by his scripts on [modules and scripts] repository.


To make another language than english be Cpanel default language on new account, we'll use Pozo DefLang script.

Changing default Language on new accounts

First, check if /scripts/postwwwacctuser exists:

ls /scripts/postwwwacctuser

If an error like

ls: /scripts/postwwwacctuser: No suck file or directory

do appear, go ahead. Else, make copies and stop here if you do not know anything about PERL scripting.


If not exists, go ahead:

cd /scripts
wget http://html.conclase.net/cp/scripts/deflang.perl.txt
chown root.root deflang.perl.txt

Edit deflang.perl.txt according your needs. Only change

my $deflang = "español";

To your language, like:

my $deflang = "portugues";

Remember to use same filename as you use on WHM Language section. You DO need to have this language on your CPanel.

Now, let's active deflang:

mv deflang.perl.txt postwwwacctuser


How to change current users to your language

Change portugues above to your language name.

cd /var/cpanel/users
perl -pi -e 's/LANG=english/LANG=portugues/g' *

Remember to have this language.

This script will not work allways, since, sometimes on /var/cpanel/users/* there aren't a LANG=english line.

Personal tools