Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Using smarty config for translations? performance?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
RomanTarasov
Smarty Rookie


Joined: 21 Nov 2014
Posts: 6

PostPosted: Sat Nov 29, 2014 10:36 pm    Post subject: Using smarty config for translations? performance? Reply with quote

I wonder if i should use smarty configs for holding translations for multilingual sites.

In the past i used just plain text files with
var1=value1
var2=value2
var3=value3

that i parsed file for language i need with PHP and got translations array.

I think its much cleaner to use smarty configs for this, however am i losing something in terms of performance from using smarty configs instead of plain text files?

Also if config holds like 4000 variables for translation will this be slower than same in plan text file?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Dec 01, 2014 1:11 am    Post subject: Reply with quote

Not gonna work. For obvious resons. Normal, quality translation is rarely a mere string replacement.

Though, to be absolutely precise,something like this is possible, but this is not a question of performance.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Dec 02, 2014 3:12 pm    Post subject: Reply with quote

AnrDaemon wrote:
Not gonna work. For obvious resons. Normal, quality translation is rarely a mere string replacement.

Though, to be absolutely precise,something like this is possible, but this is not a question of performance.


Config files are parsed into PHP, so they should be much faster than scanning text files. I'd recommend running a benchmark and see for yourself.
Back to top
View user's profile Send private message Visit poster's website
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Dec 03, 2014 6:45 am    Post subject: Reply with quote

Either way, it'll end up in cache, and you WILL be caching pages, if your enterprise runs into performance concerns.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP