|
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 |
Hans Deragon Smarty n00b
Joined: 23 Dec 2003 Posts: 1 Location: Montréal
|
Posted: Tue Dec 23, 2003 4:32 pm Post subject: New i18n plugin. |
|
|
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 |
|
|
|
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
|