Page 1 of 1

The buildSelect function has a minor bug

Posted: Tue Nov 15, 2005 11:48 pm
by KorayPeksayar
Hello again,

The buildSelect function has a minor bug that prohibits translations to be displayed correctly:

Code: Select all

<option value="<?= $content_value ?>"<?php if ( $value == $content_value ) { echo " selected"; } ?>><?= htmlentities($content_text) ?></option>
line in zm_funcs.php formats the input from all db and translation entries to have proper HTML entities.

However, used with no parms forces the input to be in iso-8859-1 encoding only.

Instead I used:

Code: Select all

<option value="<?= $content_value ?>"<?php if ( $value == $content_value ) { echo " selected"; } ?>><?= htmlentities($content_text,ENT_QUOTES,$charset) ?></option>
which allows the code to convert both single and double quotes in $content_text to proper HTM entities and also be aware of the translation charset.

The variable $charset is in the zm_lang_tr_tr.php, which is the translation file for Turkish. I have also included these in the file's beginning:

Code: Select all

$charset="utf-8";
header( "Content-Type: text/html; $charset" );
setlocale( LC_ALL, "tr_TR.$charset" ); //All locale settings 4.3.0 and after
setlocale( LC_CTYPE, "tr_TR.$charset" ); //Character class settings 4.3.0 and after
setlocale( LC_TIME, "tr_TR.$charset" ); //Date and time formatting 4.3.0 and after
htmlentities() supports a couple of charsets so please check http://www.php.net/htmlentities for details.

Regards,
Koray

Posted: Wed Nov 16, 2005 12:10 am
by zoneminder
Thanks. It may be worth keeping all of these issues in one thread so I can keep track of them. Otherwise some may be lost if they are just single posts that fade into the past. The htmlentities function is used in several places so it may be easier to just stick it inside a locale sensitive wrapper.

Phil

Re: The buildSelect function has a minor bug

Posted: Mon Dec 11, 2006 9:33 am
by tkalfaoglu
Koray: Do you still have the Turkish translation of Zoneminder?
If so, could you upload it somewhere?

Thanks!
-turgut