Template strings translation

Yes, there is this shortcode to get the current language in WPML as mentioned above:

function get_language_shortcode() {
    return apply_filters( 'wpml_current_language', null );
}
add_shortcode( 'language', 'get_language_shortcode' );

Right, probably more robust than checking the URL:

<Set currentLang><Shortcode language /></Set>

<Switch check="{Get currentLang}">
  <When value="en" />
    <Set string_cv> See the CV</Set>
  <When />
    <Set string_cv>Voir le CV</Set>
</Switch>

Thanks guys!

2 Likes