Dynamic selection of admin language from storefront cookie
Posted: Sat Apr 03, 2010 6:37 pm
Hello,
While there is an easy way to change the language of the storefront, there is no such feature for the admin panel. To change it, one must go through the settings, which is inconvenient. Also, there is only one choice for all users.
With the following patch, each administrator can use the panel in a language of their choice. The admin language will be the same as the storefront language for a given user. To change it, just select another language in the storefront.
The selection is based on the language cookie. Only if the cookie does not exist or does not lead to a valid index in the $languages table, config_admin_language is used as a fallback choice.
Thus, the admin language option in settings can still be used to set the default, fallback language, unless overriden by the cookie.
The patch is a unified diff against the 1.4.6 release. To apply, type
% patch -p0 < admin_lang_autosel.diff
in your web root.
Hope someone finds it useful too
UPDATED : File in next post
While there is an easy way to change the language of the storefront, there is no such feature for the admin panel. To change it, one must go through the settings, which is inconvenient. Also, there is only one choice for all users.
With the following patch, each administrator can use the panel in a language of their choice. The admin language will be the same as the storefront language for a given user. To change it, just select another language in the storefront.
The selection is based on the language cookie. Only if the cookie does not exist or does not lead to a valid index in the $languages table, config_admin_language is used as a fallback choice.
Thus, the admin language option in settings can still be used to set the default, fallback language, unless overriden by the cookie.
The patch is a unified diff against the 1.4.6 release. To apply, type
% patch -p0 < admin_lang_autosel.diff
in your web root.
Hope someone finds it useful too
UPDATED : File in next post