Project

General

Profile

Actions

Defect #7813

closed

I18n function __() and get() problem

Added by Przemysław Plezia about 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-03-08
Due date:
2011-03-08
% Done:

100%

Estimated time:
Resolution:
Invalid
Affected version:

Description

When i want translate some text _ and in file application/i18n/pl.php have 'text'=>'moj text' then on return i get 'text' but should be 'moj text'. Maybe i doing some wrong but a function _() have variable to language.
I found someting like this:

function __($string, array $values = NULL, $lang = 'en-us')
    {
        if ($lang !== I18n::$lang)
        {
            // The message and target languages are different
            // Get the translation for this message
            $string = I18n::get($string);
        }

        return empty($values) ? $string : strtr($string, $values);
    }

Function I18n::get($string); should have 2 parameters like this I18n::get($string,$lang);

Actions

Also available in: Atom PDF