This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » General » Bilingual admin
expandshrink

Bilingual admin

Bilingual admin

Friday 16 November 2012 3:04:35 am - 8 replies

Hi!

I was wondering if its possible to have the admin displaying in multiple languages. On the application I'm trying to build right now I'll have English and Chinese speaking users and I want them to be able to manage their profiles in their own language.

Any help will be greatly appreciated!

I'm using the legacy code (4.x) from ezpublish5.

Friday 16 November 2012 10:00:32 am

Different site accesses for different languages.   There is no reason you can't copy the admin site access to admin_cn (or somesuch) and change the settings:

[RegionalSettings]
Locale=chi-CN
ContentObjectLocale=chi-CN

Saturday 17 November 2012 6:29:34 am

Thanks Steven!

Bu then I'll have to find a way to redirect the user according to his/her language.

Is there any way to have Language switcher in the Admin?

Saturday 17 November 2012 5:46:49 pm

You could also have just one admin site access with both languages in the site.ini.append.php.

[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB
ShowUntranslatedObjects=disabled
SiteLanguageList[]=eng-GB
SiteLanguageList[]=chi-CN

Switching between the two translations for the objects is possible using a select field.

Sunday 18 November 2012 9:34:59 am

Thanks Charles!

I already have those settings for the admin, but I don't know how to give users the possibility to chose the language in the Admin.

How can I add the select field you mentioned about. On the Frontend I have the language switcher and it works perfect, but how can I add something similar to the Admin.

Thanks!

Sunday 18 November 2012 1:46:40 pm

Ok, I've created multi-lingual sites with eZ since 3.x but have yet come across, nor needed the language switcher similar to the one on the Frontend in Admin.

The select field I was referring to is always available so long as you have defined more than one language in Admin so that there is always the possibility to choose the language for every content object you want to create or edit.

Now, if you want your English users to only create and edit content objects in English and the Chinese ones only in Chinese, the only way I can think of implementing this is to separate your English and Chinese users in their own user groups and use the "Roles and policies" access control to limit the creation and editing of objects on the language level.

According to the manual, it is possible to do this only on the "create" and "edit" functions, but not on the "read" function.

http://doc.ez.no/eZ-Publish/Techn...-language/Language-based-permissions

Sunday 18 November 2012 4:27:04 pm

Maybe I misunderstood - but, the question that I was answering is how to have the backend itself - not just the content - in a different language.  The content is going to - by default - displayed depending on the contentObjectLocale you have set for that siteaccess and there is no way to set that on the fly.  It's what the cache for that siteaccess is going to be generated in. 

The only way to do that (easily anyway) is with two separate siteaccesses - with the Locale and contentObjectLocale settings set to the different languages.

I've set up a few sites like this - with an admin_en and admin_fr, and one site with 7 different backend languages.  It makes sense if your content editors are from different countries and not everyone knows (or wants to work in) English.  You share the database and the content and don't need to share the language.

Now, if you don't want to send people to www.yoursite.com/admin_fr for whatever reason (although that is the easiest way) there are a few ways you can redirect people to a specific language siteaccess.

you can maybe redirect using apache rewrite rules based on geography.  But, if your content editor happens to be in a different country then they'll be redirected to the one for where they are and not necessarily the one they want.  For all of the site accesses you should still get a drop-down on content creation to be able to create content in any of the available languages.  Although you can limit that too.

Another possibility is to have an admin landing page which then redirects people to the correct backend login page depending on a language selected by a dropdown.

You could add an attribute to the user class to redirect people to a language but... they would have to login using the English (or whatever the default language) login page - and then be redirected using a custom login handler or something like that.

Modified on Sunday 18 November 2012 4:28:16 pm by Steven E Bailey

Tuesday 02 April 2013 10:22:49 pm

Quote from Steven E Bailey :

You could add an attribute to the user class to redirect people to a language but... they would have to login using the English (or whatever the default language) login page - and then be redirected using a custom login handler or something like that.

Do you think it's possible to have the ContentObjectLocale+Locale changed (temporarily) via EventListeners?  So rather than redirection, override those two settings, similar to user preferences.

Wednesday 03 April 2013 9:22:49 am

Hi Geoff,  I'm thinking about it... and the more I think about it the more I think, yeah it's possible in a limited way... but, it's more trouble than it's worth.  Waay more trouble. (IMHO)

Basically you'll be fighting against the caching (by siteaccess) and settings (by siteaccess)... which is core to ezpublish (and what it does well).

It makes me think that the best you'll be able to do is change those settings per individual in your own custom module(s) - and if that's the case there are probably easier ways of dealing with this than trying to change settings on the fly.

But, hey, maybe there is some other way that I'm not thinking of.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from