我在 PHP 中使用了“GNU gettext”,它通过使用 poedit 做得很好我能够提取 PO 文件格式
但是当我在我的 HTML“脚本”标签中为我的 javascript 尝试同样的事情时,我没有更多地工作,我看不到任何 javascript 支持。
poedit 支持几乎所有语言,除了 javascript 或者我正在这样做 任何人都可以以错误的方式提供 javascript 的工作示例?!我使用 poedit 跟踪了近 20 种语言的所有示例,除 javascript 外,所有示例均有效
来自 GNU gettext 的所有工作示例
gettext-0.19.7.tar.gz
http://ftp.gnu.org/gnu/gettext/
gettext-0.19.7\gettext-tools\examples
这是 php 示例,我需要为 javascript 做同样的事情
#!@PHP@ -q
<?
// Example for use of GNU gettext.
// This file is in the public domain.
//
// Source code of the PHP program.
setlocale (LC_ALL, "");
textdomain ("hello-php");
bindtextdomain ("hello-php", "@localedir@");
echo _("Hello, world!");
echo "\n";
echo printf (_("This program is running as process number %d."),posix_getpid());
echo "\n";
?>