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

Internationalization. Best Practices?

 
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
auggiedoggie
Smarty Rookie


Joined: 30 Mar 2008
Posts: 6

PostPosted: Wed Dec 14, 2016 7:54 pm    Post subject: Internationalization. Best Practices? Reply with quote

I'm about to begin building a fairly large health records-oriented site which will be supporting English and Spanish. I've worked with i8n and multi-language sites before but not within Smarty 3 (Twig inside Symfony 2).

I see several package options via Google but I'd be interested in hearing which are best-of-breed so I don't waste days working with broken, abandoned code. Any thoughts, links, etc?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Dec 14, 2016 7:58 pm    Post subject: Reply with quote

Could you please clarify your question?
What exactly you are looking for?
Encodings support? Smarty works with UTF-8 out of the box.
Something else? You gotta clarify.
Back to top
View user's profile Send private message
auggiedoggie
Smarty Rookie


Joined: 30 Mar 2008
Posts: 6

PostPosted: Wed Dec 14, 2016 11:54 pm    Post subject: Reply with quote

AnrDaemon wrote:
Could you please clarify your question?
What exactly you are looking for?
Encodings support? Smarty works with UTF-8 out of the box.
Something else? You gotta clarify.


Sorry, I thought I was pretty clear. i8n is the standard for internationalization and localization... being able to support multiple languages on the same site, i.e. English and Spanish, i.e. "Good morning" and "Buenas dias".

It's not a character encoding thing. It's about Smarty support for Unix gettext() or something similar and, if Smarty doesn't support it, what third-party modules are recommended.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat Dec 17, 2016 1:38 am    Post subject: Reply with quote

It's "i18n", because of the length of the word "internationalization".
You can write any support you want by yourself. Or not use any and just go with what Smarty has on the offer.
gettext is easy and there's even plugins already available, I recall. But it isn't the best choice on the market at the moment.
intl is a way more sofisticated, but also predictable more complicated to work with.
However, if all you need is a number of predefined phrases, you could just use Smarty config mechanics.


Last edited by AnrDaemon on Sun Dec 18, 2016 11:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Sun Dec 18, 2016 8:51 pm    Post subject: Reply with quote

Smarty is basically the "view" of your application. i18n is a bit out of scope for the template engine itself. As AnrDaemon mentioned, there have been some attempts at plugins for Smarty, although none of them are a "standard" by any means. So to implement i18n, do it exactly the same way you would without Smarty, then plug the implementation results into template variables. You could also try implementing gettext as a template plugin, but it will likely result in limitations that way.
Back to top
View user's profile Send private message Visit poster's website
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