glowlogix / wp-frontend-profile

WP Frontend Profile allows users to edit/view their profile and register/login without going into the dashboard to do so.
https://wordpress.org/plugins/wp-front-end-profile/
GNU General Public License v2.0
17 stars 20 forks source link

i18n not working [solution included] #102

Closed frifrafry closed 1 year ago

frifrafry commented 1 year ago

It seems the localization is pretty mixed up and not working in it's current configuration.

A textdomain has to be unique across the entire project, but you're mixing two domains: 'wp-front-end-profile' vs. 'wpfep'.

Further along your implementation is not working at all. You named your language files (in folder 'languages') with the domain 'wpfep', e.g. 'wpfep-en_US.mo'.

But you try to load language files for the domain 'wp-front-end-profile'. See class-wp-frontend-profile.php in line 116ff:

public function load_textdomain()
{
    load_plugin_textdomain('wp-front-end-profile', false, WPFEP_PATH . '/languages/');
}

This contains two bugs: 1.) It uses the wrong domain ('wp-front-end-profile' instead of 'wpfep') 2.) It provides an wrong path (absolute path, multiple slashes)

To get the internationalization working for your plugin you need to take two steps.

Solution step 1: Search&Replace 'wp-front-end-profile' => 'wpfep'

Solution step 2: Correct textdomain loading:

public function load_textdomain()
{
    load_plugin_textdomain('wpfep', false, 'wp-frontend-profile/languages');
}

Apart from that: Your .pot file is pretty outdated, and your code contains some hardcoded strings. If you want I could fix these issues and commit a branch, including a german translation.

Because I really like the plugin :-)

musamamasood commented 1 year ago

HI @frifrafry,

Thank you for reporting the issue. We will release patch asap.

frifrafry commented 1 year ago

Do you want me to fix it? I also found some other small things I could patch...

musamamasood commented 1 year ago

Pull request merge. Will release in 1.3.0