[Phpmyadmin-devel] [phpMyAdmin] Re: Multi-language support

Loïc loic-div at ifrance.com
Sun May 6 13:45:52 CEST 2001


Hi All!

This is a reply to a message from Korakot but maybe this
thread could be interesting for all developpers.

>I agree with you about 3 more variable
>maybe
>$strCharSet
>$strFontFace
>$strTextDirection

OK. For the $strCharSet we should just specify that it
must be member of a family like 'sans-serif'.
And what about $strFontSize (with a value such as 'x-
medium')?

>We could accept these values from Translation Patch.
>(and we could use them from phpMyChat, right?)

Yes: except the Font face, we could easilly set ourself the
other settings (already got them in phpMyChat).

>>- headers that should be handled by php rather than
>>'meta' tags. These headers are cache instruction and
>>charset definition;

>Please explain into more detail, so that I could
>understand what you mean.

Well, inside the 'header.inc.php3' instead of the exsting
meta tags we should use:
  $now = gmdate('D, d M Y H:i:s') . ' GMT';
  header('Expires: ' . $now);
  header('Last-Modified: ' . $now);
  header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
  header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
  header('Pragma: no-cache'); // HTTP/1.0

 // Defines the charset to be used
 header('Content-Type: text/html; charset=' . $strCharSet);

This way you don't need to:
1) send headers to the browser...
2) ... that will have to send these values back to the
server...
3) ...so the later may decide what to do.

An other problem is that phpMyAdmin do not send any
DTD at the beginning of generadted HTML pages. This
do not fit the W3C standards and may be the reason of
many problems (at least with IE5 for Mac).

>>Lastly we should use an external stylesheet that is
>>called by each of the scripts (it would be easier to
>>customize phpMyAdmin this way). This stylesheet may
>>be a php file so we can pass et least one parameter to it
>>by url: the font face to use.

>I agree that we should use external style sheet.
>But not sure if making it a php file itself a good
>idea.

How can the take into account the font face else? The
only alternative I can image is... to have one external
stylesheet per language! Not sure it's a very good
solution ;)

>Let's consult the dev-list.

Here we are

>Lastly I'd like to discuss about select_lang.inc.php3
>drop this line.
>if (!function_exists('pmaLangDetect')) {

I've added it because under certain circumstances (can't
remenber when, unfortunatly) the 'select_lang.inc.php3'
script is called twice during the parsing related to one
action.

>rename pmaLangDetect to lang_detect
>drop $notFound and use break to go out of while loop
>use variable $http_lang or something short to store
>intermediate value... make it easier to read code.

Ok, not a problem. We just need to clearly define the
coding standards we have to use before I made this
changes.

>In general, the old code is much easier to read and
>understand.

Right but the former have some annoying limits:
1) it was really difficult to choose between dialects. This
is not really a problem for 'fr' and 'fr-ch' for example (sorry Olivier ;)),
but it is one for 'zh and zh-tw' as I've been told, or for different spanish
dialects (same words
with different meanings, or words specific to one dialect
...);
2) the language detection I suggest in the current version
is the result of a digest of about 300 different HTTP_ACCEPT_LANGUAGE and
HTTP_USER_AGENT headers
sent by browsers. Some fits to the RFC specifications,
other not (or not exactly), but each of these 300 headers are taken into
account. I'm afraid the "old" version don't work with all
of them ;)

BTW, this reflect only my state of mind of course.

Regards,

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif






More information about the Developers mailing list