Forums / Install & configuration / User-dependent language for admin interface?

User-dependent language for admin interface?

Author Message

Guido Ehlert

Tuesday 18 November 2008 3:48:22 am

Hello ezp community,

at a customer project in an international company we have following situation: Their website is available in three languages (siteaccesses). The admin interface is currently in English, but this is not satisfactory, since some editors understand English and German, but others only Russian for example.

Is it somehow possible to display the admin interface in the user's preferred language? Ideally with the site content in his language too, but this is no must.

The only solution in my mind would be creating three separate siteaccess for the admin interface too. But I'd like to avoid the effort to also manage config files and permissions for this additial siteaccesses, if possible anyhow.

Im am using ezp 4.0.1.

Thanks,
Guido

Arnaud Lafon

Monday 24 November 2008 5:05:34 am

Hi Guido,

I think you'll need to use three siteaccess cuz some core functionnality are directly using the Locale set in your site.ini.
If you want to manage some ini files at a top lvl configuration (but not in the settings/override folder), maybe you could put them in an extension and activate that extension using the ActiveAccessExtension settings. If you want to manage the override.ini.append.php with only one file for all your front office siteaccess for exemple, you'll need to do that otherwise you'll override your backoffice template too.

Arnaud

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Kristof Coomans

Monday 24 November 2008 8:25:47 am

Hi

I made a patch for setting the interface language per user, see http://issues.ez.no/14008. Feel free to try and let me know if you have any feedback.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Guido Ehlert

Monday 24 November 2008 11:32:00 pm

Hi Christof,

I applied your patches and in general they do as intended, thanks! It would be perfect if not only the admin interface, but also the content itself (i.e. in the content structure tree) would be shown in the user's language. Is this possible?

But caution: The patches do not work against 4.0.1 files out of the box. I had to delete several commented lines and to patch "manually". For example, in <i>kernel/classes/eznodeviewfunctions.php</i> (file header says build 22260) there is the line 319

$ini = eZINI::instance(); 

which makes the patch fail.

Could you please check whether the patches were made against the official 4.0.1 release? If you need more details, please tell me.

Regards,
Guido

Kristof Coomans

Tuesday 25 November 2008 1:13:11 am

Hi Guido

The patches were made against the trunk (4.1.0alpha1), so they indeed might require some minor modifications for 4.0.x.

I'll see what can be done to get a per-user prioritized language list.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Tuesday 25 November 2008 1:49:00 am

I gave it a quick try, insert this code in index.php in the if ( $lang ) conditional:

    $langCodes = eZContentLanguage::prioritizedLanguageCodes();
    if ( in_array( $lang, $langCodes ) )
    {
        $langCodes = array_diff( $langCodes, array( $lang ) );
        array_unshift( $langCodes, $lang );
        eZContentLanguage::setPrioritizedLanguages( $langCodes );
    }

This code just moves the current language to the front of the prioritized languages list.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Guido Ehlert

Tuesday 25 November 2008 3:30:35 am

Wow, that was fast! Just applied your hack to my index.php and everything is fine now :-)

It should be noted that after changig the language, the user might need to reload the browser cache with CTRL+F5 since otherwise the entries in the content structure tree are still in the old language (at least here with Firefox 3).

But nevertheless, you helped me a lot!

Is there any chance to have such a feature in an official eZ Publish release?

Best regards,
Guido

Joakim Farestveit

Sunday 23 August 2009 6:15:04 pm

Hi, I'm new to all this stuff, so I have absolutely no clue how to apply that patch, and I'd really love to have one user get english interface, and one to get norwegian interface.

To be frank I don't know where to place that code-snippet, and I don't know how to apply any patches, and despite an hour of Google I have to throw in the towel and ask here on the forums :)

I have PuTTY and FireFTP ready at my disposal.

Edit: http://ezpedia.org/en/ez/patch didn't make any sense to me I'm afraid