I’m using Codeigniter 2.0.1 and I’d like to put an variable in a language line. For example: if an user wants to register an account, and that username already exists I would like to put in my language line “This username $username is alrady in use”. I saw in the validation error language lines that they used %s as variable. But if I put this in my custom authentication error lang file I just get a plain %s instead of a variable.
Share
It doen’t look like it is possible with the default Lang class. Personally I did it that way.
First a i18n_helper :
and then I call it in my controller :
and my lang file :