[PHPTAL] i18n - question

Anniyka Wandersmann anniyka at wandersmann.net
Fri Nov 10 17:43:06 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Hello, I do have the following till now, but I only got "Welcome" instead 
of "Herzlich Willkommen". I tried a lot, but till now, nothing. Any idea?

http://www.wandersmann.net/sadtec

index.html
- -----------------<snip>----------------------
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; 
URL=http://www.wandersmann.net/sadtec/links/index.php"/>
</head>
<body>
Weiterleitung:<a 
href="http://www.wandersmann.net/sadtec/links/index.php">Hier
klicken</a>
</body>
</html>
- -----------------</snip>----------------------

conflink.php
- -----------------<snip>----------------------
define ('LANG_PATH',
'/long/absolute/path/to/lang/');
- -----------------</snip>----------------------

- -----------------<snip>----------------------
>ls -l links
insgesamt 0
lrwxrwxrwx 1 wandersmann webuser  9 2006-11-10 13:33 admin.php -> index.php
lrwxrwxrwx 1 wandersmann webuser 13 2006-11-10 13:34 index.php -> ../sadtec.php
- -----------------<snip>----------------------

Do not wonder, it will be explained in length in a few days, only the i18n 
is left now ...

out of sadtec.php:
- -----------------<snip>----------------------
require_once ('conflink.php');
include_once (CONFIG_PATH . '/config.php');
// Starting TAL
require_once ('PHPTAL.php');
require_once ('PHPTAL/GetTextTranslator.php');
    $tr = new PHPTAL_GetTextTranslator();
    // set language to use for this session (first valid language will
    // be used)
    $tr->setLanguage('de_DE');
    // register gettext domain to use
    $tr->addDomain('sadtec', '../' . LANG_PATH);
    // specify current domain
    $tr->useDomain('sadtec');
    $template = new PHPTAL('../' . TEMPLATES_PATH . TEMPLATE . '/index.xhtml');
    include_once          ('../' . TEMPLATES_PATH . TEMPLATE . '/header.php' );
    // tell PHPTAL to use our translator
    $template->setTranslator($tr);
- -----------------</snip>----------------------

- -----------------<snip>----------------------
>find lang/
lang/
lang/de
lang/de/LC_MESSAGES
lang/de/LC_MESSAGES/sadtec.mo
lang/de/LC_MESSAGES/sadtec.po
- -----------------</snip>----------------------

lang/de/LC_MESSAGES/sadtec.po
- -----------------<snip>----------------------
>less sadtec.po
msgid "Welcome\n"
msgstr "Herzlich Willkommen\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
- -----------------</snip>----------------------
Well, I also tried to put this two empty msgXX in front and this msgXX at 
the bottom of the file as I rote it out of the documentation.

index.xhtml
- -----------------<snip>----------------------
<span i18n:translate="">
  Welcome
</span>
- -----------------</snip>----------------------

Thanks,
Anniyka

- -- 
\                      Anniyka Wandersmann :: Technische Leiterin
 \                             Parkstr. 20 :: Phone:  +49-911-25569449
  \                        90409 Nuremberg :: Mobile: +49-163-8766206
   \                               Germany :: Fax:    +49-911-8173374
    \    /\     http://www.wandersmann.net :: email: info at wandersmann.net
     \  /  \  ____________________________________________________________
      \/    \/ A N D E R S M A N N . N E T :: wir gehen fuer sie  ...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFVKwg0UZdMosWNssRApDQAKDgChFenKOICXChERf8Q/Kmi2yJTQCgmkcN
QVUcg4hJHfwbm+DzCkwMTFg=
=89TQ
-----END PGP SIGNATURE-----



More information about the PHPTAL mailing list