2010-08-20 90 views
1

我爲我的多語言網站使用zend_translate類(ini適配器)。如何解決一些關鍵字的zend_translate問題?

但是當我在我的語言文件中使用某些關鍵字時,它會產生錯誤。例如(是的,沒有關鍵字)。

這會產生錯誤

樣本語言文件條目:

是=母語是

沒有=母語沒有

我如何解決這個問題?

thx提前。

+0

我不明白你的問題。嘗試改寫它或發佈你的代碼,因爲它是我無法幫助你。但是我使用了Zend_Translate。 – Iznogood 2010-08-20 18:26:59

+0

你收到了什麼錯誤信息?什麼是您的上下文中的關鍵字?你使用什麼樣的翻譯文件? – Iznogood 2010-08-20 18:33:14

+0

我的意思是說,zend_translate有一些特殊的詞,如'是','不'。 當我在我的language.ini文件中使用這些單詞進行翻譯時,它會引發這些錯誤: 警告:解析E:\ work \ web \ tadbir/application/admin/languages/fa.ini時C: \ Program Files \ xampp \ php \ Zend \ Translate \ Adapter \ Ini.php on line 69 Warning:array_merge()[function.array-merge]:參數#2不是C:\ Program Files \ xampp中的數組\ php \ Zend \ Translate \ Adapter \ Ini.php on line 74 致命錯誤:在477行中的C:\ Program Files \ xampp \ php \ Zend \ Translate \ Adapter.php中不受支持的操作數類型 – 2010-08-20 18:44:35

回答

0

於是從documentation

INI files have several restrictions. If a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes ("). There are also reserved words which must not be used as keys for ini files. These include: NULL, yes, no, TRUE, and FALSE. Values NULL, no and FALSE results in "", yes and TRUE results in 1. Characters {}|&~![()" must not be used anywhere in the key and have a special meaning in the value. Do not use them as it will produce unexpected behaviour.