Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Language Variables
HI,
I'm a theme developer and need to create multi language themes, is there a way to use a language variable instead of static words? I want dynamic codes. for example {Lang_Discussions}
Thanks
Tagged:
0
Comments
You can use
{t c="Foo"}
in Smarty to utilize Vanilla's localization functionality. More info can be found here: http://docs.vanillaforums.com/theming/smarty/i18n/Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
Thanks Kasper,
Can you explain more? Where can I find all {t} strings? i am interested using the default ones.
No problem! All default locale strings can be found on Transifex (account required): https://www.transifex.com/projects/p/vanilla/language/en/
Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
Thanks Again Master,
for example :
$Definition['xctivity'] = 'Xctivity';
{t c="xctivity"}
Is that correct?
Also can i add custom strings?
themefolder/locale/en-CA.php
Sorry if I ask too much ... Your information can open a door.
Sincerely
You should be able to add locale definitions via your theme.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
No problem! You're spot on, yes; that would be the correct use of
{t}
. Custom locale strings can indeed be put in thelocale/en-CA.php
file of your theme. You can of course also add other languages thanen-CA
.Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
Thanks both,
There is a problem! I create a php file in theme/locale/en-CA.php and wrote:
Then i wrote this in default.master.tpl:
{t c="Hithere"}
But vanilla still shows Hithere!
Where is my mistake?
Many Thanks
Get rid of the the locale info array. That is not needed.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.