07-16-2007, 04:33 PM
[eluser]Yoglets[/eluser]
This post is my solution to the question I posed here: http://ellislab.com/forums/viewthread/56508/
I made a very simple mod to Parser.php:
This simply adds a special coded entry to the existing $data array for each entry in the language array. Thus, instead of having to use a template with this:
Or having to explicitly map this value to your $data array in your controller like this:
One can simply use this in the template:
This post is my solution to the question I posed here: http://ellislab.com/forums/viewthread/56508/
I made a very simple mod to Parser.php:
Code:
--- Parser.php.orig 2007-07-16 17:22:46.000000000 -0500
+++ Parser.php 2007-07-16 17:23:14.000000000 -0500
@@ -47,6 +47,11 @@
$CI =& get_instance();
$template = $CI->load->view($template, $data, TRUE);
+ foreach ($CI->lang->language as $key => $val)
+ {
+ $data['_(' . $key . ')'] = $val;
+ }
+
if ($template == '')
{
return FALSE;
Code:
<?=$this->lang->line('string')?>
Code:
$data['string'] = $this->lang->line('string');
Code:
{_(string)}