makmerghen
Forum Replies Created
-
Dear @champsupertramp
sorry I missed some steps to active the java code and its work now and I can change the language in front end and in the backendbut still some issue regarding subcategory option of translatepress will investigate it and let you know the result
best regards- This reply was modified 3 years, 1 month ago by makmerghen.
- This reply was modified 3 years, 1 month ago by makmerghen.
Dear @champsupertramp I cleared cache but got the same result
let me tell you again my steps
1- in registration form create drop down field with meta key = locale and I add in its choices en_US and ar and the default value is en_US2- to add add language field to account page I add this snippets code
add_filter( 'um_account_tab_general_fields', 'um_120721_account_locale', 10, 2 ); function um_120721_account_locale( $args, $shortcode_args ) { $args .= ',locale'; return $args; } add_filter("um_predefined_fields_hook", "um_011122_add_language_to_account", 10, 1 ); function um_011122_add_language_to_account( $fields ){ $fields['locale'] = array( 'title' => __('Language','ultimate-member'), 'metakey' => 'locale', 'type' => 'select', 'label' => __('Language','ultimate-member'), 'required' => 0, 'public' => 1, 'editable' => 1, 'options' => array( 'ar' => 'Arabic', 'en_US' => 'English' ) ); return $fields; }
3- add javascript snippet to make the TranslatePress compatible with UM forms:
<script type="text/javascript"> jQuery(window).on("load", function() { jQuery("select[data-key='locale']").on("change", function() { var trp_code_field = jQuery("input[name='trp-form-language']"); var frm = jQuery(".um.um-account form"); var lang_code = jQuery(this).val(); if (lang_code == "en_US") { trp_code_field.val(""); frm.attr("action", "/account/general/"); } else { trp_code_field.val(lang_code); frm.attr("action", "/" + lang_code + "/account/general/"); } }); }); </script>
so please check and advise
also please note that I made default language in translatpress as English and second as Arabic but I used option of Use a subdirectory for the default language to make Arabic the default language in front end
do think that can make issue
best regardsDear @champsupertramp thank you for the code
I add it as java script
but unfortunatilly it is still the same
if I change language from UM form language field it only change the language of the user in back end and didn’t change it in fromtendso please advise
best regardsDear @anghelemanuel99 is it possible to do the next
since I got method to let user can change his locale language of the backend from the front end
so need to do the next
as example we have 2 language English and Arabic
if the locale language in edit user profile page = English then the selected language of translatepress in frontend will be English and if we change locale to be = Arabic then translatepress language selector will be Arabicwould you please advise how to do that
best regardsDear @champsupertramp I cleared it but still the same
I noted that when change the language from the form then language only changed in the backend and didn’t change in the fornt endwhat suppose to be that when user enter account page while his active language is English and and then change language to be Arabic and press update account then his language should changed to be Arabic in front end and backend but this not happened it only change in back end
note : I am using translatepress pluginso please advise
best regards- This reply was modified 3 years, 1 month ago by makmerghen.
Dear @champsupertramp thank you
it added language field to account page
but
after I change the language and press update account button it didn’t change in the front end
so please advise
best regardsDear @champsupertramp no problem at all you are always give a perfect help
best regards and wish you all the bestDear @champsupertramp
1- I already created drop down field with meta key locale
2- I need user to find drop down so he can change his language and you told me before about adding new profile field has only the drop down language field
3- I did what you recommend and I created code snippet in code snippets plugin with the above code
but the result was no thing change in account page no language field appearso please advise
best regardsDear @champsupertramp thank you for let me know
best regardsDear @champsupertramp
I found the reason of this issue
I asked you before how to add language switch field in account page and you told me just create new profile form contains only language drop down fieldand this what cause the auto redirect of UM account page to home page
because the exist of profile form along with account formif I removed the profile shortcode and leave account shortcode alone then the page open normal on account page but if I add to it profile shortcode it give this issue
so please advise how to fix this
I need to add language field to account page without this issuebest regards
Dear @champsupertramp I delete the custom css I added and I got the same result
okay it gave 2 columns but some thing not right in the design happened such ass when click on some field this field become bigger and the 2 columns became one and then become 2 againwhatever thanks for trying to help
best regardsokay Dear @champsupertramp thank you I will not use the callback since using the normal way give the right result
thanks very much for helpingDear @champsupertramp
I got this message
um um-register um-944 uimob960
best regardsDear @champsupertramp
actually it the link do the same even if I write it in the address barbut dear I restored old database and it fix it I will test every plugin I installed one by one and will let you know if I determined the one that did this issue
best regards
Dear @champsupertramp
first I add this code in code snippets plugin and I got this errorDon't Panic The code snippet you are trying to save produced a fatal error on line 1: Uncaught Error: Call to undefined function jQuery() in /home/elazbagr/newhope.me/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(221) : eval()'d code:1 Stack trace: #0 /home/elazbagr/newhope.me/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(221): eval() #1 /home/elazbagr/newhope.me/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(271): Code_Snippets_Edit_Menu->test_code(Object(Code_Snippet)) #2 /home/elazbagr/newhope.me/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(130): Code_Snippets_Edit_Menu->save_posted_snippet() #3 /home/elazbagr/newhope.me/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(107): Code_Snippets_Edit_Menu->process_actions() #4 /home/elazbagr/newhope.me/wp-includes/class-wp-hook.php(303): Code_Snippets_Edit_Menu->load('') #5 /home/elazbagr/newhope.me/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array) #6 /home/elazbagr/newhope.me/wp-includes/plugin.php(470): WP_Hook->do_ The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before. Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.
then I added it in as java and I got this error in front end register form page
mysite says um um-register um-944 uimob500regards