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   1190 Views

Avatar
bunheng

Community Member, 78 Posts

5 February 2011 at 6:35am

Edited: 05/02/2011 6:43am

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

Community Member, 215 Posts

5 February 2011 at 8:50am

Edited: 05/02/2011 8:52am

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

Community Member, 78 Posts

5 February 2011 at 3:15pm

Hi,

Thanks for your reply. Now it working fine.

Thanks.
Bunheng