Is there a native functionality for additional languages in EE4 or should we go for an addon for a site with LTR and RTL languages?
Please share your experiences.
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityIs there a native functionality for additional languages in EE4 or should we go for an addon for a site with LTR and RTL languages?
Please share your experiences.
okay it seems you are into this too. if you want to spend 200$ use https://boldminded.com/add-ons/publisher-2
if not; here is the tips for an easy way to do it. lets say that you have two languages English - en Arabic - ar
first duplicate your fields in your channels and make sure that you suffix the field name with the short-code of your language Like:
{title_ar} {body_en} {body_ar}
if you need categories add a custom field for your categories lets say the English is your default language : {category_name_ar}
if you have variable; you can use the suffix too, like: {home_en} : home {home_ar} : الرئيسية
=== in you blog template === use the template routs and make sure the segment_1 as the language short-code like: template group Blog/index
/{lang:regex[(en|ar)]}/blog/{section:category}/{page:pagination}
now the url of the "Blog" will be like: https://localhost/ar/blog/ https://localhost/en/blog/
in your template the code will be like this:
<ul>
<li>{home_{segment:lang}}</li>
{!-- this will translate the variable upon requested URL --}
</ul>
{exp:channel:categories}
<a href="{path='{segment:lang}/blog/'}">
{if segment_1 == "ar"}
{category_name_ar}
{if:else}
{category_name}
{/if}
</a>
{/exp:channel:categories}
{exp:channel:entries channel="blog" }
<h2>
{if segment_1 == "ar"}
{title_ar}
{if:else}
{title}
{/if}
</h2>
<p>{body_{segment:lang}}</p>
{/exp:channel:entries}
there is many ways to do so this is the easiest way to do it natively
hope you find this useful