Hi,
I’ve been trying to replicate this, but so far I’ve not been able to do so. Can you elaborate how you switch languages? Is this in the WP Settings > General or somewhere else?
Which option should I select here? (I tried one with looked Arabic to me, but I’m not able to tell if it actually is)
Cheers,
Jeroen
When I choose Arabic from the main settings like that screenshot[screenshot]
the plugin page be like that [Screenshot]
Hi,
Thank you, I believe I’ve found the same language in the settings (excuse the ignorance, I’m not familiar with the Arabic character set, very hard to ‘read’ for me)
It does seem to load the stylesheets for me, so there may be something else going on at the same time.
https://snipboard.io/PjS9Wd.jpg
Could you add the snippet I posted here before to your functions.php file and after refreshing the generator page, let me know the results that are in the error log?
(make sure to remove the snippet right after, as it’ll log the page ID of every page that is loaded)
add_action( 'admin_enqueue_scripts', function() {
$current_screen = get_current_screen();
error_log( $current_screen->id );
}, 20 );
Let me know!
Jeroen
You made if condition `$current_screen = get_current_screen();
if ( in_array( $current_screen->id, array( ‘marketing_page_woocommerce_coupon_generator’, ‘woocommerce_page_woocommerce_coupon_generator’) ) )to enqueue scripts and styles based onget_current_screen();`
and the current screen in Arabic is pagenow = '%d8%a7%d9%84%d8%aa%d8%b3%d9%88%d9%8a%d9%82_page_woocommerce_coupon_generator'
[screenshot]
so I changed the condition to if ( in_array( $current_screen->id, array( 'marketing_page_woocommerce_coupon_generator', 'woocommerce_page_woocommerce_coupon_generator','%d8%a7%d9%84%d8%aa%d8%b3%d9%88%d9%8a%d9%82_page_woocommerce_coupon_generator' ) ) )
Thanks!
Thank you for the info / results. It is very interesting this is happening..
%d8%a7%d9%84%d8%aa%d8%b3%d9%88%d9%8a%d9%82 seems to decode to “التسويق” – which Google Translate says is ‘marketing’. This should be the page ID/slug, so in theory shouldn’t get translated, will have to check up on this in WC Core.
Which version of Woo are you running exactly?
Cheers,
Jeroen
Yes this code %d8%a7%d9%84%d8%aa%d8%b3%d9%88%d9%8a%d9%82 is “Marketing” in English which is the page slug.
I use Woo 5.1.0
Regards,
Mohamed
Hi Mohamed,
I’ve looked into this, and I’m not sure why there’s a translated/encoded part in the ID there, so instead I’ve created a different workaround.
Could you download a updated version of the plugin here and give it a try to get another verification before releasing: https://github.com/JeroenSormani/woocommerce-coupon-generator
Thank you,
Jeroen