clever-host Posted February 20, 2015 Share Posted February 20, 2015 hello what can I do for translate this functions? {$smarty.now|date_format:"%A, %d %B %Y, %H:%M"} I put this functions to clientarea template, and it's ok, but appear in english language and I want romanian language. in this moments appear this: Friday, 20 February 2015, 13:49 But I want to appear in romanian language. Example: Vineri, 20 Februarie 2015, 13:49 Thanks. 0 Quote Link to comment Share on other sites More sharing options...
luckysoft Posted January 6, 2016 Share Posted January 6, 2016 Hi! Did you ever found a solution for this? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 6, 2016 Share Posted January 6, 2016 you can't really do this in Smarty, ideally you'd need to modify PHP using setlocale. http://php.net/manual/en/function.setlocale.php I suppose if theory if you *had* to do this is Smarty, you could use replace to convert the English names to Romanian (or any other language) - but you'd need 17 replaces for each language (7 day names, 12 months)... to change the days of the week to Romanian, you could use the code below... if you wanted to change the months, you'd need to extend this with 12 more replaces... {$smarty.now|date_format:"%A, %d %B %Y, %H:%M"|replace:'Monday':'luni'|replace:'Tuesday':'marţi'|replace:'Wednesday':'miercuri'|replace:'Thursday':'joi'|replace:'Friday':'vineri'|replace:'Saturday':'sîmbătă'|replace:'Sunday':'duminică'} there would be another way to do it which would be better, but you'd still end up using 17 replaces! if you have the choice, using setlocale would be a far simpler and more thorough solution. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.