Remove Codeigniter <label> wrapping lang() |
[eluser]John-Doe[/eluser]
Hello, How do I remove the auto label wrapping that is for the lang() in Codeigniter. The manual doesn't say anything about it: http://ellislab.com/codeigniter /user-guide/helpers/language_helper.html Do I have to write a function by myself or is there a simple clean way that Im missing? /John-Doe
[eluser]John-Doe[/eluser]
Im using lang(); because I want to send a dynamic value with it, like lang('welcom_user', $username); . $this->lang->line(); doesn't support this, so its not an option.
[eluser]Tpojka[/eluser]
Just write: Code: Welcome, <?php echo isset(lang('username')) ? lang('username') : 'Guest';?>
[eluser]John-Doe[/eluser]
[quote author="Tpojka" date="1383339827"]Just write: Code: Welcome, <?php echo isset(lang('username')) ? lang('username') : 'Guest';?> But that won't work either. Of course I want to be able to translate "Welcome" beofre the message as well. Code: lang(‘welcom_user’, $username); Variable in lang file: Eng-ver: Welcome %s to this page Swe-ver: Välkommen %s till denna sidan With your code I won't be able to translate the whole variable.
[eluser]Tpojka[/eluser]
Use placeholders in language files. Code: //In your language file... |
Welcome Guest, Not a member yet? Register Sign In |