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

New i18n plugin.

 
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 -> Plugins
View previous topic :: View next topic  
Author Message
Hans Deragon
Smarty n00b


Joined: 23 Dec 2003
Posts: 1
Location: Montréal

PostPosted: Tue Dec 23, 2003 4:32 pm    Post subject: New i18n plugin. Reply with quote

Greetings.


Newbie here. I submitted a new plugin, named i18n. Here is the descriiption:

----------------------------------------------------
Type: function
Name: i18n
Purpose: Choose proper internationalization string according to $locale.

Consider the following in your .tpl file:

{i18n def="Greetings" fr="Bonjour" de="GuttenTag"}

If the php global variable $locale is set to "fr_ca", then
the tag will be replaced by "Bonjour" in the final output.

You must set the php global $locale variable prior using
the tag.

You can provide as many locale definitions (parameters) as required.

@param def="<text>" Set the default text if no match is made between
$locale and the list of parameters in the i18n
command.

@param <locale>="<text>" Set the text for the corresponding locale. The
locale follows the format <lang>[_<country].
Example: "fr", "en_US".

@return string Returns the proper text for the given locale.
----------------------------------------------------

I hope this will be usefull for others.


Best Regards,
Hans Deragon
Back to top
View user's profile Send private message Send e-mail 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 -> Plugins 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