I'm making a new payment option for the upgrades plugin (iDeal via Mollie.nl) and since that is for the Netherlands I want to translate the upgrades plugin to Dutch.
To be honest: I have no idea how to start. I do know how to translate a plugin when there's a .po file, but I have no idea how you make one of those things from scratch..
I'm making a new payment option for the upgrades plugin (iDeal via Mollie.nl) and since that is for the Netherlands I want to translate the upgrades plugin to Dutch.
To be honest: I have no idea how to start. I do know how to translate a plugin when there's a .po file, but I have no idea how you make one of those things from scratch..
The codex explanation doesn't make any sense to me (keep reading the same pages, and it does say what you should do, but not how.. - or there is and I just can't find it) but I'll just go with trial and error I guess :)
## edit ##
Searches on WP itself didn't give the answer, but a search on google did :) Just found it :)
Honestly, other than providing lang strings to be translated, I can't say I've ever had the need to actually translate a file since everything I've dealt with to date has been either straight English, or an environment where there are mixed languages and English was the common ground.
Okay, I almost got the iDeal thing going. The only thing that just won't work is the credits-update function (upgrades_user_credits_add).
While I was looking into the function, I was wondering why there are 2 queries, when one would do just fine..
function upgrades_user_credits_add($tmp_credits, $tmp_user_id){
global $wpdb, $wp_roles, $current_user;
$tmp_old_total = $wpdb->get_var("SELECT credits FROM " . $wpdb->base_prefix . "upgrades_credits WHERE user_ID = '" . $tmp_user_id . "'");
$tmp_new_total = $tmp_old_total + $tmp_credits;
$wpdb->query( "UPDATE " . $wpdb->base_prefix . "upgrades_credits SET credits = '" . $tmp_new_total . "' WHERE user_ID = '" . $tmp_user_id . "'");
}
The only query you need is (this query does work for me btw, the above function doesn't..): $wpdb->query( "UPDATE " . $wpdb->base_prefix . "upgrades_credits SET credits = credits+" . $tmp_credits . " WHERE user_ID = '" . $tmp_user_id . "'");
Btw, in the upgrades_payment_module_paypal.php there are 2 urls defined in the paypal form, which both point to a premium.php(?page=upgrades_credits) that doesn't exist. Shouldn't that be upgrades.php(?page=credits)..?
Hmm.. for some reason I can't get the translation to work.. In the 'Writing a plugin' page at the WP Codex it says that you should include a function. First of all I have no idea where to place it (before either of the gettext functions is called, but as late in the session as possible it says.. I have no idea where that would be in this plugin..).
And I also don't know - for sure - how to name the language file. I named it upgrades-nl_NL.mo (as in the example at WPC) and dropped in the mu-plugins folder, but since it's not an ordinary plugin I'm not sure if that's correct..
Still haven't been able to get the translation to work and for some reason my whole mu install is broken now..
When I try to access /wp-admin/
Fatal error: Call to undefined function get_admin_page_title() in /xxx/httpdocs/wp-admin/admin-header.php on line 23
when I try to access the frontend
Warning: require_once(admin.php) [function.require-once]: failed to open stream: No such file or directory in /xxx/httpdocs/wp-content/mu-plugins/upgrades.php on line 10
Fatal error: require_once() [function.require]: Failed opening required 'admin.php' (include_path='.:/usr/share/php:/usr/share/pear:') in /xxx/httpdocs/wp-content/mu-plugins/upgrades.php on line 10
Changed everything back to what it was, but the error remains.. Has anyone got an idea of how this happened?..
//edit
To be clear: this happened while I was trying to get the Dutch translation of Upgrades to work
Ok, just to be sure I added the domain to every translate function ( __() and _e() ) and that did the job... I've finally got a translated version of Upgrades :)
I'm trying to translate some plugins and themes using poedit. I thought I'd start with edu-clean but the theme doesn't seem to recognize the files at all. Everything looks good in poedit and i'm saving the files as sv_SE.po and .mo in the theme dir. I tried making folders named lang and/or language aswell and it doesn't work.
How did you do to do this?
The perfect scenario for me is that the localization plugin locates them. Then I can translate at work ;). My company's blocked the common ftp ports and I don't feel like installing poedit there.
7430 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Erstwhile founder
—
1st October 2009 (2 years ago)
#
Hiya,
Plenty of people have been able to translate the plugins in the past. I'm sorry to hear that you're having so much trouble but I'm afraid translating really isn't an area In which have a lot of experience.
You're more than welcome to keep discussing translating here in the forums but I need to ask you to pick a thread and stick to that one thread. This one of the very old threads you resurrected so I'm going to go ahead and close it.
Thanks,
Andrew
Thanks for viewing this post but this topic has been closed to new replies.
Responses (21)
Member — 3rd September 2008 (3 years ago) #
It would be no different than translating any other WordPress resource. There's a pretty good explanation of the process on the WP codex.
Member — 3rd September 2008 (3 years ago) #
I realized that a little too late, sorry..
The codex explanation doesn't make any sense to me (keep reading the same pages, and it does say what you should do, but not how.. - or there is and I just can't find it) but I'll just go with trial and error I guess :)
## edit ##
Searches on WP itself didn't give the answer, but a search on google did :) Just found it :)
Member — 3rd September 2008 (3 years ago) #
Glad it did.
Honestly, other than providing lang strings to be translated, I can't say I've ever had the need to actually translate a file since everything I've dealt with to date has been either straight English, or an environment where there are mixed languages and English was the common ground.
Member — 3rd September 2008 (3 years ago) #
Okay, I almost got the iDeal thing going. The only thing that just won't work is the credits-update function (upgrades_user_credits_add).
While I was looking into the function, I was wondering why there are 2 queries, when one would do just fine..
function upgrades_user_credits_add($tmp_credits, $tmp_user_id){global $wpdb, $wp_roles, $current_user;
$tmp_old_total = $wpdb->get_var("SELECT credits FROM " . $wpdb->base_prefix . "upgrades_credits WHERE user_ID = '" . $tmp_user_id . "'");
$tmp_new_total = $tmp_old_total + $tmp_credits;
$wpdb->query( "UPDATE " . $wpdb->base_prefix . "upgrades_credits SET credits = '" . $tmp_new_total . "' WHERE user_ID = '" . $tmp_user_id . "'");
}
The only query you need is (this query does work for me btw, the above function doesn't..):
$wpdb->query( "UPDATE " . $wpdb->base_prefix . "upgrades_credits SET credits = credits+" . $tmp_credits . " WHERE user_ID = '" . $tmp_user_id . "'");Is there a reason for the two-queries solution?
Erstwhile founder — 3rd September 2008 (3 years ago) #
Nope, no reason at all. Nice catch in fact :)
Thanks,
Andrew
Member — 3rd September 2008 (3 years ago) #
Glad to be of service :) ;)
Member — 3rd September 2008 (3 years ago) #
I'll point the blame to a lack of proper caffeinated nutrition. Improper blend, using generic off the shelf "coffee", and so on.
Once we get Andrew craving his own fresh roasted varieties, he should be back to normal. :D
Erstwhile founder — 4th September 2008 (3 years ago) #
Yeh, I must have had a some sort of brain malfunction when coding that bit.
Thanks,
Andrew
Member — 4th September 2008 (3 years ago) #
It happens. We all do it. :D
Member — 4th September 2008 (3 years ago) #
Andrew += coffee :D
Member — 4th September 2008 (3 years ago) #
lol :D
Btw, in the upgrades_payment_module_paypal.php there are 2 urls defined in the paypal form, which both point to a premium.php(?page=upgrades_credits) that doesn't exist. Shouldn't that be upgrades.php(?page=credits)..?
Member — 4th September 2008 (3 years ago) #
Hmm.. for some reason I can't get the translation to work.. In the 'Writing a plugin' page at the WP Codex it says that you should include a function. First of all I have no idea where to place it (before either of the gettext functions is called, but as late in the session as possible it says.. I have no idea where that would be in this plugin..).
And I also don't know - for sure - how to name the language file. I named it upgrades-nl_NL.mo (as in the example at WPC) and dropped in the mu-plugins folder, but since it's not an ordinary plugin I'm not sure if that's correct..
Member — 29th September 2008 (3 years ago) #
Still haven't been able to get the translation to work and for some reason my whole mu install is broken now..
When I try to access /wp-admin/
when I try to access the frontend
Changed everything back to what it was, but the error remains.. Has anyone got an idea of how this happened?..
//edit
To be clear: this happened while I was trying to get the Dutch translation of Upgrades to work
Member — 29th September 2008 (3 years ago) #
Ok, just found that when I delete the upgrades.php file I can access my dashboard (and frontend) again...
Member — 30th September 2008 (3 years ago) #
Still not able to translate the Upgrades plugin.. Isn't there anyone that can help me with this?
Member — 30th September 2008 (3 years ago) #
Ok, just to be sure I added the domain to every translate function ( __() and _e() ) and that did the job... I've finally got a translated version of Upgrades :)
Erstwhile founder — 30th September 2008 (3 years ago) #
Sorry about the troubles. Glad to see you got it working though.
Thanks,
Andrew
Member — 27th September 2009 (2 years ago) #
Upping this old thread.
I'm trying to translate some plugins and themes using poedit. I thought I'd start with edu-clean but the theme doesn't seem to recognize the files at all. Everything looks good in poedit and i'm saving the files as sv_SE.po and .mo in the theme dir. I tried making folders named lang and/or language aswell and it doesn't work.
How did you do to do this?
The perfect scenario for me is that the localization plugin locates them. Then I can translate at work ;). My company's blocked the common ftp ports and I don't feel like installing poedit there.
Erstwhile founder — 28th September 2009 (2 years ago) #
Hiya,
As I mentioned in a reply to one of your other posts, you may want to try this plugin:
http://wordpress.org/extend/plugins/codestyling-localization/
Thanks,
Andrew
Member — 1st October 2009 (2 years ago) #
Andrew, have you managed to use the plugin to translate mu-plugins from here? I don't think the plugins are ready to be translated.
Erstwhile founder — 1st October 2009 (2 years ago) #
Hiya,
Plenty of people have been able to translate the plugins in the past. I'm sorry to hear that you're having so much trouble but I'm afraid translating really isn't an area In which have a lot of experience.
You're more than welcome to keep discussing translating here in the forums but I need to ask you to pick a thread and stick to that one thread. This one of the very old threads you resurrected so I'm going to go ahead and close it.
Thanks,
Andrew
Thanks for viewing this post but this topic has been closed to new replies.
Become a member