Jump to:

23379 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Two Languages Website

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1163 Views
  • bunheng
    Avatar
    Community Member
    77 Posts

    Two Languages Website Link to this post

    Hi,

    I am trying to write condition to check $ContentLocale in order to execute some JavaScript required by page, my website has two languages which is en_US and km_KH. I start with the following code in my template.ss but it was error.

    <% control Translations %>
    <% if ContentLocale == 'en-US' %>
    <script type="text/javascript" src="themes/cambo/scripts/conden.font.js"></script>
    <% end_if %>
    <% end_control %>

    I really need help otherwise I can't sleep.

    Bunheng

  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: Two Languages Website Link to this post

    <% if ContentLocale = en-US %>
    <script type="text/javascript" src="themes/cambo/scripts/conden.font.js"></script>
    <% else %>
    <script type="text/javascript" src="themes/cambo/scripts/conden.font.js"></script>
    <% end_if %>

    Delete the control unless you do some magical stuff with it.

  • bunheng
    Avatar
    Community Member
    77 Posts

    Re: Two Languages Website Link to this post

    Hi,

    Thanks for your reply. Now it working fine.

    Thanks.
    Bunheng

    1163 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.