Problem with PO/MO in new version — labels but revert to English after saving
Support › MB Custom Post Type › Problem with PO/MO in new version — labels but revert to English after savingResolved
- This topic has 12 replies, 3 voices, and was last updated 4 years, 4 months ago by
Teia Local Studio.
-
AuthorPosts
-
December 2, 2020 at 8:29 PM #23395
Teia Local Studio
ParticipantHello there!
Previous versions worked like a charm using a custom PO/MO in pt_BR located inside my theme. After updating today (using AIO) things changed on MBCustomPostType extension (I really was fond of the previous interface) — and now my pt-BR translation is gone for good.
But the worst part is — no matter what label I change while creating a CPT or taxonomy, they always revert back to English.
What I was doing — just before "boot" the MetaBox stuff, in my functions.php, I was calling my PO/MOs for the extensions I use:
load_textdomain( 'meta-box', MY_PATH.'/languages/plugins/meta-box-'.get_locale().'.mo' ); load_textdomain( 'mb-custom-post-type', MY_PATH.'/languages/plugins/mb-custom-post-type-'.get_locale().'.mo' ); (...)
What should I do now? Is it a matter of calling a new PO/MO? Perhaps my old PO/MOs are not up to date?
Thank you!
G.December 2, 2020 at 10:35 PM #23399Long Nguyen
ModeratorHi Giovani,
I can create a new Post type or Taxonomy with my language (Vietnamese) as well. It does not revert back to English while creating or updating. See my screenshots:
https://share.getcloudapp.com/llun46EY
https://share.getcloudapp.com/WnulEqXQRegarding the translation is gone, I recommend using Loco Translate to translate the extension's text to your language (BR). Loco also helps you to scan (new) text and loads the correct file MO.
https://share.getcloudapp.com/geuormpEDecember 3, 2020 at 1:30 AM #23400Teia Local Studio
ParticipantDear Long,
I can't still figure out what could be the problem, but I will take a look on Loco translate. More info:
The MBCPT plugin itself is loading in English (not a big problem for me), but what I refer too is the content of each label. They are also in English, of course, but I can't modify them permanently. Steps:
- I do create a "Foo" custom post, all OK.
- I name plural and singular, "Foos" anf "Foo", all OK.
- I go to CPT labels and change from, for example, "Add new Foo" to "Adicionar Novo Foo". And I change "All Foos" to "Todos os Foos"... And it is ALMOST OK.
The changes are made, the labels are indeed modified, but the text field itself, on the plugin, retains the old value in English. If I need, for some reason, edit the CPT again, I need to rename aaaall labels once more, otherwise the will be re-saved with the original English values the plugin provides.
If I radically change it to any crazy text, it get's saved, but upon entering the CPT's edit screen again, the value will not be there.
But is is strange, because the same problem happened using just free the MB and MBCPT on on a different theme, a commercial one (mine is all custom and I use premium AIO). On both themes I just activate MB's plugins and use a custom code to "boot" the metaboxes (did learn on your old tutorials). Perhaps my custom way of starting MB internals is breaking something?
This is the way I do:
function teialocal_register_meta_boxes() { include 'boxes/post.php'; include 'boxes/page.php'; if (post_type_exists('case')) { include 'boxes/case.php'; } if (post_type_exists('event')) { include 'boxes/event.php'; } return $meta_boxes; } add_filter( 'rwmb_meta_boxes', 'teialocal_register_meta_boxes' );
I will try MB + MBCPT on a default WordPress template to check if it happens there as well.
Thanks!
G.December 3, 2020 at 2:20 AM #23401Teia Local Studio
ParticipantDear Long,
Got LOCO working (still learning how to handle it) and make progress translating MB-CPT plugin English terms to Portuguese, however, LOCO can't locate any of the ENGLISH LABEL TERMS. They are nowhere to be found on the compiled brand new POT file.
I really need to translate the labels itself, not the plugin screens...
Need to put in Portuguese the field values, like:Add new XXX, All XXX, Edit XXX, New name for XXX, View XXX, Search XXX, etc, etc.
Upon a quick inspection, these values are hard coded inside minified JS files:
wp-content\plugins\meta-box-aio\vendor\meta-box\mb-custom-post-type\post-type.js
and
wp-content\plugins\meta-box-aio\vendor\meta-box\mb-custom-post-type\taxonomy.jsOr, in the end... Alt least the input text fields for the labels should retain the entered value, and not refreshing always with the default English ones.
Thanks!!
G.December 3, 2020 at 3:02 AM #23402Teia Local Studio
ParticipantHey there!
Just found, inside MB-AIO folder, a fr_FR PO/MO file that contains the strings I look forward to have translated... But I have no idea how to add this and where add this to my Portuguese WordPress. Everything is sooo confusing. I can't even turn off pt_BR global translation (for a test)!
What should I do?
Can someone provide some simple steps?In time:
LOCO shows me a lot of stuff from MetaboxAIO, but does not show me nothing related to the regular MetaBox base plugin at all.
December 3, 2020 at 3:17 AM #23403Teia Local Studio
ParticipantUPDATE!!!
Just did a clean install of WordPress.
Default official theme. Nothing changed or custom.
Installed METABOX FREE and METABOX CUSTOM POST TYPES FREE.Everything works fine BUT the custom post types and taxonomies label values.
The only one who retains the modified value is the very first field — ADD NEW.
The other fields, when you change the label value (although saving to database), revert back to the default English term when the screen reloads.Imagine having 10 CPTs, all with nice labels in other language... Then you need to edit all of them, form some other reason, like, remove Thumbnail support, etc etc... and then, you need to re-crete all labels for all the 10 cpts, because all fields are back to their default!
Sounds something is not right here, what do you think?
Can you please inspect?Thaaaanks!
G.December 3, 2020 at 7:56 PM #23406Teia Local Studio
ParticipantAnother problem found...
You create a CPT, change its labels to anything else than the default. They get saved (but the fields remain in default EN). Then you think, a far as I do not edit it again, its okay...
But then you access the extension to create a taxonomy, and, after creating it, the CPT got its labels all reset to default again.
Oh my.
December 8, 2020 at 4:54 PM #23468netalys
ParticipantI have exactly the same issue.
When I go to labels tab, I can edit the first one, but another label is reverted to english when saving.
You can see a video here : https://www.loom.com/share/dad5f6d36f5d493b9ca6d7a778cde050Thanks. Cedric.
December 8, 2020 at 7:13 PM #23470Teia Local Studio
ParticipantIt's important to note:
All values GET SAVED indeed. The problem is that they does not retain on the fields. If you need to edit your taxonomy or CPT you will need to write all your labels again, except for the first one (as pointed by Cedric), otherwise, on the next save, all will be reverted to English default values.
Thanks guys!
December 16, 2020 at 3:40 AM #23554Teia Local Studio
ParticipantGuys,
Any news?
There is something wrong here really indeed!Thaaanks!
G.December 16, 2020 at 2:13 PM #23564Long Nguyen
ModeratorHi guys,
The issue about labels auto revert to English after saving has been fixed in the new version of MB Custom Post Type 2.0.7 or MB AIO 1.12.1.
December 16, 2020 at 2:32 PM #23565netalys
ParticipantGreat ! Thanks !
December 16, 2020 at 5:47 PM #23570Teia Local Studio
ParticipantTHANK YOU GUYS!
Long live to META BOX family! -
AuthorPosts
- You must be logged in to reply to this topic.