Trouble changing language…
-
I have the impression that the possibility is missing when registering the user to choose his language (or what is automatically assigned according to the language of the browser) so that the correct language is assigned to him ( I have the main one in French and the translation in English, the emails and others will be sent in FR because the language in the parameters of the site is on FR…
My problem looks like another request but that is closed and since no more news and that even on GitHub > https://github.com/ultimatemember/ultimatemember/issues/783
-
You can try this plugin:
https://github.com/MissVeronica/UM-Backend-Local-Language
I have given the browser language first choice of local language and if not available the WP Profile settings will be used.
If you want to change this let me know.
“the WP Profile settings will be used”
The function that detects the language is already possible via Polylang, that’s ok.
But the problem is that in WP it’s the default language that remains and not the en_GB (in my case).In addition, many links do not redirect to en_GB but to fr_FR (default language), if the user wants to modify his profile it does not work because he is redirected to FR
My FR page is named “user”
The EN page is named “user-2” which gives mydomain/en/user-2If the member clicks from his profile on “edit profile” the link is mydomaine/user/username/?um_action=edit and not on mydomaine/en/user-2/username/?um_action=edit
It’s the same for all the links (My Account, …)Ditto for /account/, the links on the EN page (account, change pass, privacy, view profile,…) go to FR…
Login and register page have the same problem for secondary buttons and forgotten password (which is less important because I can recreate it manually)
-
This reply was modified 2 years, 11 months ago by
scoufy.
Which version of UM are you using?
Have you tried using the special version of UM that’s compatible with the PolyLang plugin?
https://docs.ultimatemember.com/article/1449-how-to-translate-plugin#switch
Thank you for your reply,
Version 2.3.1 (free)
No I didn’t try the special version because I didn’t know about it.
Small question before testing, will I lose lose everything or the work I have already done will be preserved?The UM Polylang version is based on UM 2.2.5 from 22 Sep 2021
See the UM release history here: https://github.com/ultimatemember/ultimatemember/releases
Installation
1. Create a full backup of your site before updating
2. Deactivate current UM 2.3.1
3. Rename current UM directory from/plugins/ultimate-member
to/plugins/ultimate-member-231
4. Download zip file from the repository (green button) https://github.com/ultimatemember/ultimatemember/tree/feature/multilingual
5. Do a WP new plugin installation by uploading the zip file without activating plugin.
6. Rename the upload directory from/plugins/ultimatemember-feature-multilingual
to/plugins/ultimate-member
7. Activate UM
8. Don’t follow the advice on updating from UM 2.2.5 to UM 2.3.1You can now switch between the two UM versions by deactivating UM and rename plugin directories.
Thank you for your helpful help!
Question about this version of UM, I don’t have to update it but is it maintained for security? Why is this not implemented in the latest version?This solved the problem but I still have one in the same style..
I created a second member directory for the EN language (named “Members”, the first one is “Membres”, FR),
a page with the shortcode “/en/members-list-2/” and the profiles are displayed, but the problem is that when I click on a profile in the list it is redirected to /user/testing+one/ (fr ) and not to /en/user-2/testing+one (en), this page is displayed as a direct link..(I hope this will be the last problem.. ?? )
Why is this not implemented in the latest version?
UM version 3 will be compatible with Polylang.
@missveronicatv , Super good news, this could decide me to buy the premium license later. The support is very good and it’s nice even for a free version!!
I created a second member directory for the EN language (named “Members”, the first one is “Membres”, FR),
a page with the shortcode “/en/members-list-2/” and the profiles are displayed, but the problem is that when I click on a profile in the list it is redirected to /user/testing+one/ (fr ) and not to /en/user-2/testing+one (en), this page is displayed as a direct link..I think there should be a possibility for the user to choose the language (fr or en in my case) and have it saved instead of the default language (of the WP profile), because that remains on the default language even if the user chooses another language.
I think there should be a possibility for the user to choose the language (fr or en in my case) and have it saved instead of the default language (of the WP profile), because that remains on the default language even if the user chooses another language.
Try to update/replace my UM Language Plugin, which now is using the Browser language both for UM Backend and now also UM Frontend by overriding all UM calls for language choice.
I did install your latest plugin but that didn’t fix the directory problem…
/en/members-list-2 always displays profiles from the default language directory /user/testingone/ and not /en/user-2/testingone/
if testingone clicks on a profile he is redirected to /members-list/ (in FR), it’s the same if he wants to edit his profile from this page, it’s in French and not English.. my pages and form are correct because it works.
(in WP “account”, the language of testingone remains on “default site”, like all the others, I don’t know if it’s normal?)
Try this code snippet and add it to the current
UM-Backend-Local-Language
add_filter( 'um_localize_permalink_filter', 'um_localize_permalink_filter_custom', 10, 2 ); function um_localize_permalink_filter_custom( $profile_url, $page_id ){ global $current_user; if( get_user_locale( $current_user->ID ) == 'en_GB') { $profile_url = str_replace( '/user/', '/en/user-2/', $profile_url ); } return $profile_url; }
The code snippet will change all user links from
/user/
to/en/user-2/
when current user language isen_GB
.@missveronicatv , Disregard the previous message, I just solved the problem… I installed a cache plugin (which I had to activate later because I’m in production) and that solved the directory problem! The default language should remain in the cache despite the box checked in the UM settings (?)
I thought I was done with that, but still on the EN part, on the account page, I can clearly see the left part with the menus “account”, change password, privacy, delete account” but not the information on the side, of the least not directly, for Account, if I refresh the page it’s good the right side is displayed and works, the same for Privacy, if I go back to account, same problem.. The forms are not displayed the first time, I should I refresh the page?
I also have the problem with the members list and “logout” page, on click it’s good but then it comes back to the page, I have to refresh it too!Another concern is for the urls of the notification emails, to activate the account, for example, the link is like this: the url href=”{account_activation_link}”>Activate your Account how to modify properly so that it points to /en/?
I thought I was done with that, but still on the EN part, on the account page, I can clearly see the left part with the menus “account”, change password, privacy, delete account” but not the information on the side, of the least not directly, for Account, if I refresh the page it’s good the right side is displayed and works, the same for Privacy, if I go back to account, same problem.. The forms are not displayed the first time, I should I refresh the page?
I also have the problem with the members list and “logout” page, on click it’s good but then it comes back to the page, I have to refresh it tooWait because I just found that I could do it via my admin account… if the accounts are set to administrator it’s ok.
I’ll find or settle this for the subscribers.
Sorry to waste your time, but you see I’m also looking for myself…
I will only have the problem with the activation links that are in the emails, that I know I will not have the answer.
Another concern is for the urls of the notification emails, to activate the account, for example, the link is like this: the url href=”{account_activation_link}”>Activate your Account how to modify properly so that it points to /en/?
Hi @scoufy Thanks for letting us know how it resolved the issue.
-
This reply was modified 2 years, 11 months ago by
- The topic ‘Trouble changing language…’ is closed to new replies.