Loading...

toemmy

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Localize countries in Dropbox #10003609
    toemmy
    Participant

    Very nice! Thanks a lot!
    I didn’t notice that I could add the filter to get_option directly.

    in reply to: Localize countries in Dropbox #10003592
    toemmy
    Participant

    Hi Eva,

    unfortunately there isn’t an easy solution without making some modifications to the plugin code.
    I checked the Plugin Files and the countries aren’t translated in other languages before they are displayed in the dropdown box.
    So I had to add some code to the plugin myself (registration_form.php, around line 450).

    The way I did it was going through the $countries array and translating every entry to the given language:

    
    $countries_t = array();
    for($i=0; $i<sizeof($countries); $i++){
     $ct = __($countries[$i], "piereg");
     array_push($countries_t, $ct);
    }
    sort($countries_t);
    $countries = $countries_t;
    

    Of course it makes sense to put this code in an hook, so you don’t have to rewrite the whole code again after a plugin update. And you still have to translate the country strings in the .po files.

    Hope I could help.

    Cheers,
    Toemmy.

Viewing 2 posts - 1 through 2 (of 2 total)