diff --git a/README.md b/README.md index 5beec8d..673622e 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,19 @@ This is a simple i18n class for PHP. Nothing fancy, but fast, because it uses ca Some of its features: -* Translation strings in `.ini`/`.properties`, `.json` or `.yaml` format -* Caching -* Simple API: `L::category_stringname` -* Built-in support for [vsprintf](http://php.net/manual/en/function.vsprintf.php) formatting: `L::name($par1)` -* Automatic user language detection -* Simplicity ;) +- Translation strings in `.ini`/`.properties`, `.json` or `.yaml` format +- Case-insensitive keys +- Caching +- Simple API: `L::category_stringname` +- Built-in support for [vsprintf](http://php.net/manual/en/function.vsprintf.php) formatting: `L::name($par1)` +- Automatic user language detection +- Simplicity ;) ## Requirements -* Write permissions in cache directory -* PHP 5.2 and above -* PHP SPL extension (installed by default) +- Write permissions in cache directory +- PHP 5.2 and above +- PHP SPL extension (installed by default) ## Setup @@ -57,6 +58,7 @@ The files must be named according to the filePath setting, where '{LANGUAGE}' wi ``` ### 3. Initialize the class + ```php prefix .'($string, $args=NULL) {'."\n" + . ' $string = str_replace(\'.\', \'_\', $string);'."\n" + . ' $string = strtolower($string);'."\n" . ' $return = constant("'.$this->prefix.'::".$string);'."\n" . ' return $args ? vsprintf($return,$args) : $return;' . "\n}"; @@ -351,7 +353,7 @@ protected function compile($config, $prefix = '') { $code = ''; foreach ($config as $key => $value) { if (is_array($value)) { - $code .= $this->compile($value, $prefix . $key . $this->sectionSeparator); + $code .= $this->compile($value, $prefix . $key . str_replace('.', '_', $this->sectionSeparator)); } else { $fullName = $prefix . $key; if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $fullName)) {