Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

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

Two Languages Website


Reply

3 Posts   1185 Views

Avatar
bunheng

5 February 2011 at 6:35am (Last edited: 5 February 2011 6:43am), Community Member, 78 Posts

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

Avatar
Devlin

5 February 2011 at 8:50am (Last edited: 5 February 2011 8:52am), Community Member, 215 Posts

<% 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.

Avatar
bunheng

5 February 2011 at 3:15pm Community Member, 78 Posts

Hi,

Thanks for your reply. Now it working fine.

Thanks.
Bunheng