views:

180

answers:

2

Hi,

I am using smarty gettext plugin to internationalize smarty templates on windows. But when I run the command tsmarty2c.php c file is created but the strings are not in the file.C file is empty.

I am using PHP 5.2.9 and smarty gettext plug in version is v 1.1.Any help is appreciated.

+1  A: 

It prints C code on stdout.

You have to use it like that:

./tsmarty2c.php «template_file» > smarty.c
vartec
I am using the cmd and in the folder which has tsmarty2c.php.SO i am giving command as "tsmarty2c.php C:\wamp\www\smarty\templates\index.tpl > index.c". So the file is created in the directory but it is empty.
AvidProgrammer
you have PHP CLI associated with .php extension?
vartec
no. I am running php files using the (Apache)WAMP server.
AvidProgrammer
You need to install PHP CLI to execute tsmarty2c.php
vartec
I am now able to generate the C file and the PO,MO file. But smarty is not picking from the MO files. But string in php files are getting translated.Am I missing something.
AvidProgrammer
Procedure I followed is Generate C file,PO and MO files.code is as below$language_code = 'de_AT'; putenv("LANG=$language_code");setlocale(LC_ALL, $language_code); $domain = 'index'; bindtextdomain($domain, './locale');textdomain($domain);bind_textdomain_codeset($domain,'UTF-8');
AvidProgrammer
A: 

I have the same problem too.