QRM國際化程式設計

2021-06-01 20:20:37 字數 787 閱讀 5202

1.  確定qrm的web介面所在目錄,(預設在/var/www/html/openqrm)

2.  進入web根目錄:

[root@hd openqrm]# pwd

/var/www/html/openqrm

[root@hd openqrm]# mkdir -p locale/zh_cn/lc_messages/

[root@hd openqrm]# cat base/include/setlan.php

<?php

define('package','openqrm');       // define *.mo file

putenv('lang=zh_cn');

setlocale(lc_all, 'zh_cn');

bindtextdomain(package, '/var/www/html/openqrm/locale');

bind_textdomain_codeset(package, 'utf-8');

textdomain(package);

?>

4. 所有php檔案包含這個檔案

base/menu.php

base/index.php

base/configure.php

<?php require_once "include/gettext.php"; ?>

5. 替換所有文字內容

"hello world!"   到   <?php  _("hello world"); ?>

6. 編輯

7. 編譯

wxWidgets 國際化程式設計

一 編譯工具 工欲善其事 必先利其器,想要實現國際化程式設計,必須具備gettext軟體,可以去http sourceforge.net projects gettext 二 生成mo檔案 此工作在wxwidgets提供的internat例子中都已經詳細說明,下面簡單敘述一下 先建立目錄,目錄名要用...

qt國際化程式設計

下面說一下qt國際化程式設計的操作步驟 1 編寫源 2 在 pro檔案中新增translations ts 有多少中語言就新增多少個ts檔案。3 執行lupdate pro 生成ts檔案。lupdate會根據源 中的內容提取出待翻譯的字段,然後生成ts檔案,ts檔案是xml格式的。4 用qt lin...

Qt 國際化程式設計

qstring locale qlocale system name qtranslator translator translator.load qstring arrowpad locale 面說一下qt國際化程式設計的操作步驟 1 編寫源 2 在 pro檔案中新增translations ts...