“The price for membership is” is missing in po file
-
I am using Loco to translate English text into Japanese.
The following message in membership registration page is not found in the definition file.
“The price for membership is”
Please tell me in which file it is written.
-
Additional info;
Loco Translate shows the message below.
This bundle’s configuration has been automatically detected, but isn’t fully complete.
3 files can’t be matched to a known set of strings
Is it possible to provide XML for the missing files?
Hi @sgel
Thank you for using Paid Memberships Pro.
I’ve checked this and the string “The price for membership is” is wrapped correctly from what I could tell. Do you have a line number for this?
I’ve searched GlotPress for this translation and it is showing up correctly here (example) – https://translate.wordpress.org/projects/wp-plugins/paid-memberships-pro/stable/en-za/default/?filters%5Bterm%5D=the+price+for+membership+is&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc
What you could possible do is regenerate the .pot file using a translation application like POEdit or something similar.
Please let me know if you have a line number where this is missing and I’ll gladly look into this further.
Hello @andrewza
Thank you for your reply.
I mean missing the string ONLY “The price for membership is”.That is showed in membership registration page.
https://prnt.sc/1hhpukdI’ve already found and set Japanese the strings INCLUDING “The price for membership is” which you said.
https://prnt.sc/1hhr7vmBut the original English “The price for membership is” in the registration page remains.
Where is this text reflected?
I found the text “The price for membership is” in membershiplevels.php and rewrite it, but doesn’t reflect on live page.
<td>
<?php if(pmpro_isLevelFree($level)) { ?>
<?php _e(‘FREE’, ‘paid-memberships-pro’ );?>
<?php } else { ?>
<?php echo str_replace( ‘The price for membership is’, ”, pmpro_getLevelCost($level)); ?>
<?php } ?>
</td>What do I need to rewrite to fix the text “The price for membership is” that shows at the case of free membership?
I’m waiting for your reply. Thank you.
Thank you for sharing this, I am looking into this further and will advise as soon as I possibly can.
Did you find the cause of this issue?
In addition to the text “The price for membership is”, the text The same issue occurs in the sentence “You are logged in as “USERNAME”. If you would like to use a different account for this membership, log out now.
For these two strings that cannot be translated in the po file, please tell me how to change them.
Since this site is already open to the public, I would appreciate a reply as soon as possible.
Thank you.The text you’ve referenced in the membershiplevels.php is for the admin dashboard area and not outward facing.
You should be able to use the Custom Level Cost Text Add On to manually change the wording of the membership pricing.
Alternatively you may use custom code as well to adjust the text – https://www.paidmembershipspro.com/hook/pmpro_level_cost_text/
Here is the logged-in text you are referring to which is localized – https://github.com/strangerstudios/paid-memberships-pro/blob/dev/pages/checkout.php#L193
Here is the .pot file reference for this string – https://github.com/strangerstudios/paid-memberships-pro/blob/dev/languages/paid-memberships-pro.pot#L17251
@andrewza
Thank you for your reply.I checked source code. There is no definition the text ONLY “The price for membership is”. Is Filter hook available?
https://github.com/strangerstudios/paid-memberships-pro/blob/master/includes/functions.phpAs for the logged-in text, Of course I’ve already found and set translation text in PO file, but it doesn’t reflect to live page so I asked.
Translation settings(Loco Translate)
https://prnt.sc/1qixhry
Live page
https://prnt.sc/1qixinjI’m sorry to keep bothering you, but please answer the details of how to write the filter hook for pmpro_level_cost_text and issue about the logged-in text.
Regards,
The string you are referring to in your last reply is found inside the functions.php and the filter may be seen here – https://github.com/strangerstudios/paid-memberships-pro/blob/master/includes/functions.php#L471
Here is a rough example on how to adjust the level cost text, you may translate the phrase accordingly (You would need to also code in logic for the locale used to change this dynamically) – https://gist.github.com/andrewlimaza/f5afce6a3557b8731fa7da832f1e5600
A similar approach may be used for the non_member_text, however you would also need to detect the locale if you are using multilingual – https://gist.github.com/andrewlimaza/3a0051454aedf50be07f2774e833346f
I hope this helps get you started, if you need further assistance customizing this please reach out to a local WordPress developer. I have added the pricing text query to our development schedule to investigate further, however the non-member text is not translatable as it’s stored as-is inside the database and a custom function is needed to make it dynamically change based of the visitor’s locale.
The topic ‘“The price for membership is” is missing in po file’ is closed to new replies.