Make the new layout available for i18n pages

Pavel Franc franc at penguin.cz
Sat Mar 1 23:58:32 UTC 2003


Hi,
I know that you are busy improving kde.org pages but please don't
forget about i18n. It's really shame that the new page
design can't be use on non English pages without extra work.

There were already mentioned some idea about "auto detecting user agent
language", but I strongly disagree with it. My UA is using Czech by
default but I want to see English pages on www.kde.org and Czech pages
on czechia.kde.org. IMHO it's hardly practicable to translate all pages 
from kde.org (or other site) and keep them up to date. Moreover, there 
will always be some extra stuff on international pages.

So, use the simple i18n () function instead (as it was mentioned either).

As a web master of czechia.kde.org I tried to use the new layout
translating the PHP scrips directly. And here is a short summarization
about what should be done to make my life easier:


1) Introduce i10n() function ...

2) include_once ("$site_root/media/$locale.inc");
    setlocale(LC_ALL, $locale);

There will be media directory at the site root and $locale will be set 
by the page itself or by some site_name.inc

3) Make following changes


function.inc
----------
kde_news_dot() &  kde_news_apps()
   - use strftime() instead of date()
   - include "extra disclaimer" after dot news. Though it will be empty 
by default.
   - use i10n() for all texts



footer.inc
----------
"Search" - test for variable $site_search. If set use
            include_once ($site_root/media/search.inc);
            instead of default search box.

"Hotspot" - test for variable $site_hotspot. If set use
             include_once ($site_root/media/hotspot);
             instead of default hotspot.

"footer"  - test for variable $site_footer. If set use
             include_once ($site_root/media/footer.inc);
             instead of default footer note.


"menu_right" - test for variable $site_menu_right. If set use
             include_once ($site_root/media/menu_right.inc);
             instead of default menu_right.inc.


header.inc
----------
"encoding"  - test for variable $encoding. If set use
               $encoding instead of "ISO-8859-1" in

    print '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n";

    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"

"lang" - use $locale instead of "en" in

   <html xmlns="http://www.w3.org/1999/xhtml" lang="en">

"location" - test for variable $site_location. If set use
             include_once ($site_root/media/location.inc);
             instead of default

   <td valign="middle" align="right" id="location">
   <form action="/media/switch.php" method="post">
   <span class="invisible"><label for="location">Language:


use i10n() for all texts


class_menu.inc
--------------
use htmlspecialchars() instead of htmlentitie()



Thanks for assistance

Pavel Franc











More information about the kde-www mailing list