Multilanguage for (INPUT) Modules

Gesperrt
alessandro
Beiträge: 53
Registriert: Fr 14. Nov 2003, 10:08
Wohnort: Switzerland
Kontaktdaten:

Multilanguage for (INPUT) Modules

Beitrag von alessandro »

Hi, does someone has an idea how to add on (INPUT) modules multilanguage?

Here an example:
At the end there is "Angezeigte Länge in Zeichen" that is in german, how can I put multilangue to these kind of sentences?

Thanks
Alessandro

[code]
/**
* Artikelliste mit I1,H1,T1
*
* Erstellt eine Liste mit allen Artikel bis
* auf den Startartikel.
*
* INPUT
*
* Author Jan Lengowski
* Copyright four for business AG
*/

// selected category
$selected = "CMS_VALUE[0]";

echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">
<tr valign=\"top\">
<td>Kategorie wählen:</td>
<td>
<select name=\"CMS_VAR[0]\">";
if($selected!="0" && $selected!=""){
echo"<option value=\"0\">--- kein ---</option>";

}else{
echo"<option selected=\"selected\" value=\"0\">--- kein ---</option>";
}

// fetch all categorys
$query = "SELECT A.idcat, A.level, C.name FROM ".$cfg["tab"]["cat_tree"]." AS A, ".
$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat=B.idcat ".
"AND B.idcat=C.idcat AND C.idlang='$lang' AND B.idclient='$client' ".
"AND C.visible=1 ORDER BY A.idtree";
// execute query
$db->query($query);

// loop result and build the options
while ($db->next_record()) {

// indent spacer
$spaces = "|";

// how many levels
$levels = $db->f("level");

for ($i = 0; $i < $levels; $i ++) {
// add 2 spaces for every level
$spaces = $spaces . "--";

} // end for

$spaces .= ">";


if ($selected == $db->f("idcat")) {
// selected category
echo "<option selected=\"selected\" value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";

} else {
// category
echo "<option value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";

} // end if

} // end while

echo " </select>";

echo " </td>
</tr>
<tr>
<td>Überschrift</td>
<td><input type=\"text\" name=\"CMS_VAR[2]\" value=\"CMS_VALUE[2]\"></td>
</tr>
<tr>
<td>Angezeigte Länge in Zeichen</td>
<td><input type=\"text\" name=\"CMS_VAR[3]\" value=\"CMS_VALUE[3]\"></td>
</tr>

</table>";
[/code]
Alessandro Marrarosa
Dipl. Wirtschaftsinformatiker HF
The Swiss Post
Information Technology Services
CH-6501 Bellinzona
timo
Beiträge: 6284
Registriert: Do 15. Mai 2003, 18:32
Wohnort: Da findet ihr mich nie!
Kontaktdaten:

Beitrag von timo »

there's no way to do that yet, we'll implement language dependant strings for 4.5.0
alessandro
Beiträge: 53
Registriert: Fr 14. Nov 2003, 10:08
Wohnort: Switzerland
Kontaktdaten:

Beitrag von alessandro »

But actually when I log in to the backend how is detected the language?
All backend labels and texts how are displayed for a specific language?

Bye
Alessandro
Alessandro Marrarosa
Dipl. Wirtschaftsinformatiker HF
The Swiss Post
Information Technology Services
CH-6501 Bellinzona
timo
Beiträge: 6284
Registriert: Do 15. Mai 2003, 18:32
Wohnort: Da findet ihr mich nie!
Kontaktdaten:

Beitrag von timo »

this is done via i18n, but can't be used easily for modules (except if you touch these files every time)
alessandro
Beiträge: 53
Registriert: Fr 14. Nov 2003, 10:08
Wohnort: Switzerland
Kontaktdaten:

Beitrag von alessandro »

Hi timo,
could you check here and told me if was what you where saying using i18n?

I also creted in the "contenido.po" file the rights texts.

I now that if I have to upgrade contenido I have to pay attention to these file (right?:-)).

Bye
Alessandro

[code]/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : Mailkontakt
* Author : agon
* Copyright : Contenido - four for business
* Created : 05-11-2003
* Modified : 05-11-2003
************************************************/

echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">
<tr>
<td>i18n(\"Addressee name\"):</td>
<td><input type=\"text\" name=\"CMS_VAR[8]\" value=\"CMS_VALUE[8]\" size=70></td>
</tr>
<tr>
<td>i18n(\"Addressee email\"):</td>
<td><input type=\"text\" name=\"CMS_VAR[9]\" value=\"CMS_VALUE[9]\" size=70></td>
</tr>
<tr>
<td colspan=2>i18n(\"Note in the two input fields a same number of addressees and email addresses; separate the entries in each case with commas\").</td>
</tr>
</table>";[/code]
Alessandro Marrarosa
Dipl. Wirtschaftsinformatiker HF
The Swiss Post
Information Technology Services
CH-6501 Bellinzona
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence »

wrong way:

Code: Alles auswählen

echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\"> 
<tr> 
<td>i18n(\"Addressee name\"):</td> ";
right way:

Code: Alles auswählen

echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\"> 
<tr> 
<td>".i18n("Addressee name").":</td>";
alessandro
Beiträge: 53
Registriert: Fr 14. Nov 2003, 10:08
Wohnort: Switzerland
Kontaktdaten:

Beitrag von alessandro »

Hi emergence,
which is the difference? The first doesen't give errors...
Bye
Alessandro
Alessandro Marrarosa
Dipl. Wirtschaftsinformatiker HF
The Swiss Post
Information Technology Services
CH-6501 Bellinzona
Gesperrt