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

Best practices for multiple languages

How Do I?

Bobe's avatar
Bobe
19 posts
9 years ago
Bobe's avatar Bobe

I’m attempting a bilingual site for the first time in EE3 (as in first time for both bilingual and EE3), but I’m struggling to figure out an efficient way of approaching it. It’s only a single page website, but it’s for a restaurant so it has a lot of food menu content.

Here’s how I crudely have it set up now (very, very early):

”_includes” template group for base layout, “en” group for English (default), “zh” group for Chinese

So the language is switched by just routing to the corresponding URL segments (/en and /zh). The problem with this is in order to avoid having to duplicate layout code I have to just shove everything in the base layout template and use a ton of conditionals to check if the first segment is “zh” or not.

Then the only thing in the “en” and “zh” templates are the section for the food menus which is several channel entries tag. The way I’ve had to set it up is one channel for each menu (not sure it’s the best way, but not really relevant to this topic).

Is there a more efficient way of handling multiple languages so that I don’t have to duplicate structure but also don’t have to use heaps of conditionals?

       
Seth Barber's avatar
Seth Barber
172 posts
9 years ago
Seth Barber's avatar Seth Barber

Have you taken a look at Transcribe? It sounds like it would be a good fit for what you are trying to do.

       
benoitlemay's avatar
benoitlemay
19 posts
6 years ago
benoitlemay's avatar benoitlemay

I’m very late, but i use global variable for this.. and all my field are duplicate has .. field1_fr, field1_en , then in your template you don’t need conditionnal.. cleaner code. If you need more info i can help.. but your post is from last year…

       

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.