Thank you for interest to my theme. I have found solution of my task.
First of all the easiest way is to use a plugin, JSM-user-locale is good plugin for this task: wordpress.org/plugins/jsm-user-locale
Another way is to use standard WP functions.
You can get user locale with function
get_user_meta( $user_id, 'locale', $single = true );
Site localization you can check with
get_locale();
If you have to update user`s localization with function
update_user_meta( $user_id, 'locale', $user_locale );
And for switching localization you can use function:
switch_to_locale( $user_locale );
This function will switch localization for one session.
All above functions help updating user functions.
I hope this will be helpful for you.
Related Posts:
- How to get locale within WP REST Request?
- How to make a WordPress plugin translation ready?
- Change admin language based on user (in single-site)
- How to check username/password without signing in the user
- How to provide translations for a WordPress TinyMCE plugin?
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- Preparing a string in an array for localization
- WordPress REST API call generates nonce twice on every call
- Shortcodes, output buffering, and WordPress functions
- Problems with localization
- Multiple textdomains
- How to properly load text domain of custom mu plugin
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Custom user profile, registration, login page with theme
- How to use WP default post list tables in a plugin?
- WordPress Localization and Templating
- How to properly load text domain of custom mu plugin
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- How to update the language used by wordpress from a plugin
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- How to add quick edit and bulk edit fields to users admin section
- Singular name Plugin localization
- Why load_textdomain work but not load_plugin_textdomain?
- Generating User(s) with Settings API
- WordPress admin deleted user details not removed in database. How to delete WordPress Users from Database
- plugin development: storing language specific options
- Print WordPress username id inside JavaScript
- Function Get User Object By Username?
- How to i18n text coming from the db or from an external source
- Check if someone is editing a post (this content is currently locked)
- Should I always prefer esc_attr_e & esc_html_e instead of _e?
- Some strings from a .mo file do not load
- Should shorcodes in i18n plugins be translated and if so, how?
- Modify users.php page to create page/post on button clicked
- A better way to include localized labels in WordPress plugins
- Subscribe to author?
- How to render a time-of-day string like ’16:42′ with a site’s chosen time format?
- How to filter users list on user_status field with get_users()
- Display custom fields in frontside user profile
- Generate JSON files for language translation from po file without wp-cli i18n make-json
- Force language in translate function
- Shortcode returning localized HTML part
- load_plugin_textdomain doestn’t work with add_action plugins_loaded
- global $current_user not current user
- Display list of uploaded images, filtered by user under a specific user group
- What is the proper way to get logged in user id in a plugin?
- How to build a fool proof AdSense revenue sharing model?
- Hide custom post type by user roles
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- How to prevent someone from entering strings without making it available for translation?
- How to allow only two (or more) users access to a plugin
- I18n not working in plugin
- First and last name fields not filled when using wp_insert_user
- Wp-admin Custom User Management
- Mixing l18n string from my plugin with WordPress’ translations
- get author of published post
- How to get custom post_author?
- Associate multiple email addresses with the same user account, so they can log in with either
- Plugin language always shows WP site language, not profile language
- Is hint for translator compulsory while internationalizing a string containing variables?
- Update a user profile via frontend
- Best practice for Designing a Plugin with this scenario
- Adding another field to user table
- Plugin Development – Multilangual – Different pages
- How to translate wordpress backend to another language
- how to get the top 10 popular blogs
- How can I change my assigned user role in WordPress 3.5.1?
- How to relate the Category to user?
- Adding a dropdown on the user admin
- Allowing duplicating users with same user_login and user_email
- Do I lose translations when I change my Text domain for my plugin on wp.org?
- Why User_login key doesn’t work with wp_update_user()
- How to grab data after wp user search is complete
- Transform internationalized plugin into internationalized mu-plugin?
- get_the_date() returns english Year & Day when language is Arabic
- Load custom translation in custom plugin fails
- How to prevent users from deleting their accounts?
- wordpress4.8.2 Multilingual Plugin
- User Registration Moderate
- Translation not working for Constant strings in Plugin
- How to retrieve custom profile fields associated with different users
- Upgrade routine: Interaction with user confirmation
- Multiple Users Logged In Causing Incorrect Account Returned
- first_name property missing inside register_user action hook
- user can login from single account detail from multiple locations(computer) at the same time [closed]
- Create Unique and Customized User ID for Website Members in WordPress
- How are themes and plugins localized using the gettext GNU framework?
- Save translation file of third party plugin in a custom plugin?
- React Plugin Settings Page Localization
- Is there a faster way than wp_insert_post to add content to a blog
- How to include external library in wordpress plugin
- Decrease RSS cache time in plugin?
- Add custom element ID depending where the widget place is, sidebar or footer
- My plugin class doesn’t work! [closed]
- How to get current post user id
- Delist entries in the_loop
- Including template in shortcodes
- Securing custom rest API endpoints with public access from PWA
- Experts opinions needed: How (in)secure is this approach?
- how can I insert a link on login page