We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Multi Language - conditionals

Development and Programming

wbjp's avatar
wbjp
89 posts
16 years ago
wbjp's avatar wbjp

Hi, I’m doing a bilingual site where Japanese is the default language and the other language is English.

This is a sample of code I’m using. Works well but if the English fields are empty no content shows - I would like the default language to show.

<h3>{if lg_lang == "ja"}{artist_name}{if:else}{artist_name_{lg_lang}}{/if}</h3>

{if lg_lang == "ja"}{artist_bio} {if:else} {artist_bio_{lg_lang}} {/if}

Wondering if someone could help me this?

Thanks

       
Brendon Carr's avatar
Brendon Carr
135 posts
16 years ago
Brendon Carr's avatar Brendon Carr

LG Multi Language 1.1 has a default language setting in the extension Control Panel. The original default setting is “en” for English – maybe you just need to update the setting to “jp” for the Japanese text you want to be the default when no English is available.

       
wbjp's avatar
wbjp
89 posts
16 years ago
wbjp's avatar wbjp

Thanks for replying Brendon. Yes, I have the default set to “ja” but that doesn’t seem to work…

Update

This seems to work but not sure if it’s the best way of doing it?

{if lg_lang == "ja"}{my_custom_field}{if:else}{if my_custom_field_{lg_lang} != ''} {my_custom_field_{lg_lang}} {/if} {if my_custom_field_{lg_lang} == ''}Sorry, no content{/if}{/if}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.