I'm trying to create a plugin that will be able to translate language used in wordpress. Here's my current code:
add_action('plugins_loaded', function(){
load_plugin_textdomain('ecom', false, dirname(plugin_basename(__FILE__)) . '/lang');
});
The problem is most of the tutorials that I find in the internet relies on updating the wp-config.php file to load the specific language file like this:
define('WPLANG', 'spanish');
But as a plugin developer we do not have control on the wp-config.php
Any ideas?
The only solution that I can think of is to read the wp-config.php file and then modify its contents but it really sounds like a bad practice.
