|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
t3hAndy Smarty Rookie
Joined: 10 Sep 2008 Posts: 12
|
Posted: Tue Jan 05, 2010 5:57 pm Post subject: Smarty 3x: Replace |
|
|
I tryed to replace a string from my config. I'm using the config for multi language.
news_de.conf
news_error_max = "Es können nur %countNews% News pro Tag geschrieben werden!"
news_en.conf
news_error_max = "You could only add %countNews% news per day!"
news.tpl
{#news_error_max#|replace:"%countNews%":$news_max}
Result:
Es können nur %co3ws pro Tag geschrieben werden!
The Script is searching for %countNews% in the english translation and is using the string from the german translation to replace it. _________________ I developed a Webradio |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Jan 07, 2010 4:56 pm Post subject: |
|
|
This problem is related to the multibyte support which was added to Smarty3.
Smarty3 does use UTF-8 as the default charset. This is used by the modifiers which make use of mb support. In order to get this working with German text using special character like ä,ö,ü etc. you must store your config files in UTF-8 format or change the default charset.
The later can be done by
define('SMARTY_RESOURCE_CHAR_SET', 'ISO-8859-1');
before you include Smarty.class.php. |
|
Back to top |
|
t3hAndy Smarty Rookie
Joined: 10 Sep 2008 Posts: 12
|
Posted: Fri Jan 08, 2010 6:51 am Post subject: |
|
|
Thanks! It's working fine... _________________ I developed a Webradio |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|