Skip to content

Instantly share code, notes, and snippets.

@bueckl
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bueckl/2e9e2565a42e8c5af5e0 to your computer and use it in GitHub Desktop.
Save bueckl/2e9e2565a42e8c5af5e0 to your computer and use it in GitHub Desktop.
<%-- Page.ss --%>
<div class="language-chooser">
<% include LanguageChooser %>
</div>
<div id="language-switch">
<div style="float: left;">
<% if $Locale == "de_DE" %>
<strong>Deutsch</strong>
<% else_if $Locale == "es_ES" %>
<strong>Español</strong>
<% else %>
<strong>English</strong>
<% end_if %>
</div>
<ul>
<% if $Translations && $Translations.First.Link != "" %>
<% if $Action == 'show' %>
<% with $Item %>
<% loop $Languages %>
<li class="$Locale.RFC1766">
<a href="$Link" hreflang="$Locale.RFC1766" title="$Title">
<% if $Locale == "de_DE" %>| Deutsch<% end_if %>
<% if $Locale == "en_US" %>| English<% end_if %>
<% if $Locale == "es_ES" %>| Español<% end_if %>
</a>
</li>
<% end_loop %>
<% end_with %>
<% else %>
<% loop $Translations %>
<li class="$Locale.RFC1766">
<a href="$Link" hreflang="$Locale.RFC1766" title="$Title">
<% if $Locale == "de_DE" %>| Deutsch<% end_if %>
<% if $Locale == "en_US" %>| English<% end_if %>
<% if $Locale == "es_ES" %>| Español<% end_if %>
</a>
</li>
<% end_loop %>
<% end_if %>
<% else %>
<%-- if there's no translation we display the homepage --%>
<% if $Locale == "de_DE" %>
<li class="$Locale.RFC1766">
<a href="/de/" hreflang="$Locale.RFC1766" title="$Title">| Deutsch</a>
</li>
<% else_if $Locale == "es_ES" %>
<li class="$Locale.RFC1766">
<a href="/es/" hreflang="$Locale.RFC1766" title="$Title">| Español</a>
</li>
<% else %>
<li class="$Locale.RFC1766">
<a href="/en/" hreflang="$Locale.RFC1766" title="$Title">| English</a>
</li>
<% end_if %>
<% end_if %>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment