1

i am using zend_translate class (ini adaptor) for my multi language site.

but when i use some keywords in my language files it produce error. for example (yes, no keywords).

sample language file entries which produce error:

yes=native language yes

no=native language no

how do i solve this problem?

thx in advance.

rahim asgari
  • 12,197
  • 10
  • 43
  • 53
  • I cannot understand your question. try rewording it or posting what code you have because as it is I cannot help you. But I have used Zend_Translate plenty. – Iznogood Aug 20 '10 at 18:26
  • What error message are you getting? What is a keyword in your context? What kind of translation files are you using? – Iznogood Aug 20 '10 at 18:33
  • i mean that zend_translate have problem with some special words like 'yes','no'. when i use these words in my language.ini file to translate, it raises these errors: Warning: Error parsing E:\work\web\tadbir/application/admin/languages/fa.ini on line 1 in C:\Program Files\xampp\php\Zend\Translate\Adapter\Ini.php on line 69 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\Program Files\xampp\php\Zend\Translate\Adapter\Ini.php on line 74 Fatal error: Unsupported operand types in C:\Program Files\xampp\php\Zend\Translate\Adapter.php on line 477 – rahim asgari Aug 20 '10 at 18:44

1 Answers1

0

So from the 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.

Matteo Tassinari
  • 18,121
  • 8
  • 60
  • 81
Iznogood
  • 12,447
  • 3
  • 26
  • 44