Internationalization autocomplete JS variable
I'm working in a plugin (My first plugin) that uses autocomplete (Via JQuery UI) via an array and I'm wondering if I have to translate the array too if I want to make my plugin fully translatable.
jQuery(function(){
let supportedServices = [
'Academia', 'Airbnb', 'Amazon', 'AppStore', 'Bandcamp', 'Blogger',
];
jQuery('#service_name ').autocomplete({
source: supportedServices,
classes: {
"ui-autocomplete": "contactmefy_ui_autocomplete"
},
select: SomeFunction,
});
});
In that case, it's a good idea to use the new wp-i18n JavaScript package? Internationalization in WordPress 5.0
Topic translation autocomplete plugins Wordpress javascript
Category Web