Hi again!
I’m working on a bilingual website. The structure is as follows
content/
en-US/
index.smd
fr-FR/
index.smd
In my navigation bar, I would like a button that toggles between the two languages (When in en-US the button displays “français”, when in fr-FR the button should display “English”).
To create the toggling, I need to be able to know if the user is on the French site or the English site. I tried doing this using locale?, but it always returns true.
<div :if="$page.locale?('en-US')">
<a href="$site.page('').locale('fr-FR').link()" :text="$i18n.get('menu-change-language')"></a>
</div>
<div :if="$page.locale?('fr-FR')">
<a href="$site.page('').locale('en-US').link()" :text="$i18n.get('menu-change-language')"></a>
</div>
Is there a way to get $page.isLocale?('en-US') ? Is there a smarter way to tackle this problem?
Thanks !