Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Preg_replace & Gettext Problem
09-04-2007, 03:07 AM #1
- Join Date
- Sep 2007
- Thanked 0 Times in 0 Posts
Preg_replace & Gettext Problem
I could not find any info on this so I will ask here, maybe someone has an experience with this.
Ok, so basically i`m taking a whole chunk of code from the database that is generated once in a while. My website has several languages so i want that translated to all languages.
I concatenated all the strings in the database-stored "chunk of code" via <ff> </ff>.
And then I use something like this:
I replaced _() with my tr() translating function and apparently it gets hit, just cant find the translation i guess.
When I use print _('same text'); it shows up correctly. So i`m guessing there's some issue locating the translations while using preg_replace like that.
I`m not looking for alternatives to storing the data, I`m looking for a solution to this problem if you have any.
Thanks for your time.
Last edited by Alexey; 09-04-2007 at 03:10 AM.
09-04-2007, 03:39 PM #2
- Join Date
- Oct 2004
- Thanked 1 Time in 1 Post
You wanna do something like search highlighting function.
If returned result is hello
then the desired output is
Google :Code:<span class="highlight">hello</span>