How to create a new language ?

julianovenecui

New Member
Hello MLM Community.
I need to include portugues language, for subscription pages and e-mails sent to users. (Perhaps all that a final user can see).

So I created a "pt" folder with the txt files in portugues inside "templates". But I'm not sure what else I have to do.

Any ideas ?

Thank you.
 

stanbusk

Administrator
Staff member
This is part of the work indeed. Now you have to open the 'lm_strings.php' file and translate all the text used by MLM. For example first entry:
Code:
$kErr_missingparam_cmd = array(
	'en' => htmlentities( 'Error - You forgot to provide the command parameter', $enc_quotes, $enc_charset ),
	'fr' => htmlentities( 'Erreur - Vous n\'avez pas spécifié la commande à exécuter', $enc_quotes, $enc_charset ),
	'de' => htmlentities( 'Fehler - Sie haben vergessen, den Parameter für den Befehl anzugeben', $enc_quotes, $enc_charset ),
	'es' => htmlentities( 'Error - No ha especificado el comando a ejecutar', $enc_quotes, $enc_charset ),
	'it' => htmlentities( 'Errore - non hai fornito un parametro di comando', $enc_quotes, $enc_charset ),
	'nl' => htmlentities( 'Fout - Je bent vergeten de opdracht parameter te geven', $enc_quotes, $enc_charset ),
	'cz' => htmlentities( 'Chyba - zapomněli jste zadat jeden z příkazových parametrů.', $enc_quotes, $enc_charset )
 );
should look like this:
Code:
$kErr_missingparam_cmd = array(
	'en' => htmlentities( 'Error - You forgot to provide the command parameter', $enc_quotes, $enc_charset ),
	'fr' => htmlentities( 'Erreur - Vous n\'avez pas spécifié la commande à exécuter', $enc_quotes, $enc_charset ),
	'de' => htmlentities( 'Fehler - Sie haben vergessen, den Parameter für den Befehl anzugeben', $enc_quotes, $enc_charset ),
	'es' => htmlentities( 'Error - No ha especificado el comando a ejecutar', $enc_quotes, $enc_charset ),
	'it' => htmlentities( 'Errore - non hai fornito un parametro di comando', $enc_quotes, $enc_charset ),
	'nl' => htmlentities( 'Fout - Je bent vergeten de opdracht parameter te geven', $enc_quotes, $enc_charset ),
	'cz' => htmlentities( 'Chyba - zapomněli jste zadat jeden z příkazových parametrů.', $enc_quotes, $enc_charset ),
	'pt' => htmlentities( 'THE_PORTUGUESE_TRANSLATION_HERE', $enc_quotes, $enc_charset )
 );
Don't forget to escape any ' you have in your strings, ' should replaced by \'
 

julianovenecui

New Member
Thank you Stanbusk.
Now, I must change the language.

So, All I need to do is define $defaults_language to "pt"; in lm_setting.php ? Or this works just for the first installation?

And setting this "pt" value, does the script include "...template>pt" txt files for e-mail confirmation ?
 

julianovenecui

New Member
stanbusk said:
Yes, set the default language and it will be sued everywhere, including templates.

Well... after setting the default language, everything continues in English. (Forms, administrative pages, e-mail confirmations...)

Same result changing existing languages like "es" or "it".

I don't know if this can affect the result, but I did a manual MLM installation...

Something is missing... :(
 

stanbusk

Administrator
Staff member
Have you added your languages to the available language list? It is line 54:

$languages = array( 'en', 'fr', 'de', 'es', 'it', 'nl', 'cz' );

replace it with:

$languages = array( 'en', 'fr', 'de', 'es', 'it', 'nl', 'cz', 'pt' );
 

julianovenecui

New Member
stanbusk said:
Have you added your languages to the available language list? It is line 54:

$languages = array( 'en', 'fr', 'de', 'es', 'it', 'nl', 'cz' );

replace it with:

$languages = array( 'en', 'fr', 'de', 'es', 'it', 'nl', 'cz', 'pt' );

Thank you stanbusk

I added my "pt" language list in lm.php, and now it's working in portugues !

I noted that after this setup, the first attempt still worked in English.

Subscribe forms in the html folder must be translated manually ?
 
Top