Welcome Guest, Not a member yet? Register   Sign In
Flashdata with Language support
#1

[eluser]travoltron[/eluser]
Ok, thanks first and foremost to everyone with the help I've received so far. This is why I love CI.

I fixed my internationalization issue regarding Japanese character support, but now, I have an issue when I need to call some flashdata.

If I set the flash with a string as the message, I have no troubles.

Again:
Code:
$this->session->set_flashdata('signed_in', 'You need to be signed in to see that page.');
And retrieving it with:
Code:
<?php if($this->session->flashdata('signed_in')) : ?>
<p>&lt;?=$this->session->flashdata('signed_in')?&gt;</p>
&lt;?php endif; ?&gt;

works.

However, I need to make this message load in different languages.
I have in my language files (English and Japanese in case anyone was curious)
Code:
$lang['locked_out'] = "Message text goes here";

And I have tried to load it in my flashdata setting with:

Code:
$this->session->set_flashdata('signed_in', $this->lang->line('locked_out'));

When I do this, I don't receive any errors, but my error message doesn't load up either. It appears that the flashdata just isn't being set.

I've autoloaded the session library, and the languages are loaded in the header. I know that I can call language lines, because the navigation menu uses entries from my lang files.

I'm stumped!
#2

[eluser]travoltron[/eluser]
As a quick hack, I've put in some conditional statements to load the messages I want as strings, but obviously this is a hack, a cleaner solution is preferred.




Theme © iAndrew 2016 - Forum software by © MyBB