Skip Navigation

[Resolved] Set user administration language via the front end?

This support ticket is created 2 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by simonM-5 2 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2221455

Hi Support

I'm having issues with an invoicing plugin and want to be able to give users the possibility to set their WordPress administration user language, without having access to the WordPress admin. Is this possible with Toolset?

According to

https://wpml.org/documentation/getting-started-guide/language-setup/setting-the-wordpress-administration-language/

there is a difference between a user's WordPress admin language and the language which the user is using to view the site via the WPML language switcher.

For example, is it possible to set their preferred language via the front end, either:
(a) on the user registration form when they first create their profile (Toolset User Form)?
(b) elsewhere via the front end, eg on some profile page or similar?

Thanks and kind regards
Simon

Is there any documentation that you are following?
I wasn't able to find any relevant articles in Toolset support forum and only the one article as above on the WPML forum, but it specified allowing the user to access the WordPress backend, which we would like to disallow.

Kind regards
Simon

#2221965

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Simon,

Thank you for contacting us and I'd be happy to assist.

There is no built-in method available in the Toolset Forms for this, so it will require some workaround and custom code.

WordPress store's the language code for the user's selected WordPress admin language as a value, in the user meta field with key 'locale'.

In your user registration or profile edit form, you can include a generic field, with all the language options and then use the 'cred_save_data' hook to programmatically assign that selected language value into the user's 'locale' meta field:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

I hope this helps and for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#2224793

Hello Waqar

Thanks for the info and the suggestion, I'll bear this in mind while looking at solutions and get back to Support if i have any issues using the suggested customisation.

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.