Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c文件不是从tsmarty2c.php命令生成的_Php_Internationalization_Smarty_Gettext - Fatal编程技术网

c文件不是从tsmarty2c.php命令生成的

c文件不是从tsmarty2c.php命令生成的,php,internationalization,smarty,gettext,Php,Internationalization,Smarty,Gettext,我正在使用smarty gettext插件在windows上国际化smarty模板。 但是当我运行命令tsmarty2c.php时,会创建一个c文件,但文件中没有字符串。c文件为空 我使用的是PHP5.2.9,smarty gettext插件版本是V1.1。非常感谢您的帮助。它在标准输出上打印C代码 你必须这样使用它: ./tsmarty2c.php «template_file» > smarty.c 我使用的是cmd,文件夹中有tsmarty2c.php。所以我给出的命令是“tsma

我正在使用smarty gettext插件在windows上国际化smarty模板。 但是当我运行命令tsmarty2c.php时,会创建一个c文件,但文件中没有字符串。c文件为空


我使用的是PHP5.2.9,smarty gettext插件版本是V1.1。非常感谢您的帮助。

它在标准输出上打印C代码

你必须这样使用它:

./tsmarty2c.php «template_file» > smarty.c

我使用的是cmd,文件夹中有tsmarty2c.php。所以我给出的命令是“tsmarty2c.php C:\wamp\www\smarty\templates\index.tpl>index.C”。因此,该文件是在目录中创建的,但它是空的。您有与.PHP扩展名关联的PHP CLI吗?您需要安装PHP CLI以执行tsmarty2c.phpI。现在,我可以生成C文件和PO,MO文件了。但是smarty没有从MO文件中挑选。但php文件中的字符串正在被翻译。我是否遗漏了什么。我遵循的过程是生成C文件、PO和MO文件。代码如下$language_code='de_AT';putenv(“LANG=$language_code”);setlocale(LC_ALL,$language_code)$域='索引';bindtextdomain($domain,'./locale');textdomain($domain);bind_textdomain_代码集($domain,'UTF-8');