Hi all,
I use nativeArray
adapter for my translation. in my controller I try to translate a message and send it to user:
$message = $this->translation->_("You are logged in as %username%", ['username' =>$user->username]);
If "You are logged in as %username%
" key is not defined in language array
, then the index returns as is, without replacement!
See this section of source code:
/**
* Returns the translation related to the given key
*
* @param string index
* @param array placeholders
* @return string
*/
public function query(string! index, placeholders = null) -> string
{
var translation;
if fetch translation, this->_translate[index] {
return this->replacePlaceholders(translation, placeholders);
}
return index;
}
This issue does not append in getext
addapter. U can see the source. But in csv
and nativeArray
addpter already happens.
I think this is a Bug.
Any idea?
Thanks