Hi, i want to trasnlate all my custom fields labels to another language in addition to the current language,
can you please tell me how to do that ?
i tried locotranslate but i can't find custom fields labels !
also i need to translate list choices, group labels and buttons
and switch labels and on off status labels
You can add the code that creat the custom field to the theme, change the text-domain to theme's text-domain. Then edit the file template POT in Loco Translate, sync with the new scan to translate the field name. Here is an example:
$meta_boxes = [ 'title' => __( 'User meta 2', 'estar' ), 'id' => 'user-meta-2', 'type' => 'user', 'fields' => [ [ 'name' => __( 'Text123', 'estar' ), 'id' => $prefix . 'text_ay5g5lcx88c', 'type' => 'text', ], ], ];
When editing a language, you also need to click "Sync" to update new strings from the POT file. Here is the demo https://monosnap.com/file/y7s1CGPchopz2baTeMCrlzYrEk9ODE
i tried everything without a success, i don't know what to do ! and why it didn't work !
btw: can i choose another text_domain like meta-box for example or meta-box-aio ? why it needs to be on the theme ?
because i suspect that the theme selected is managed by oxygen builder and maybe there is a conflict in this matter, what do you think, what you can do to try to troubleshoot this issue if you have a same case ?
thanks for your help
I tried that on a new fresh website
same thing, i can't get it to work !
i have no idea why it's not working, even on a fresh website without oxygen builder and using the free metabox version
if you want i can give you an access if you can help, thanks a lot
You can share your site credentials via this contact form https://metabox.io/contact/, I will help you to check this issue.
Thanks a lot,
i just sent you 2 emails
Can you please check the word
User Meta 2 added to the theme? It is translated as well.
Hi, thanks a lot Long, really appreciate it
Can you explain why my version didn't work ? what i did wrong ?
I'm not sure. Can you please share the code that you run on your site? I've just removed it to test. You can generate the standard code from Online Generator or Builder to translate.
I replaced your code with mine and it worked fine, have you done something other than the steps you showed me first time ?
can't figure out why my version is not working even with same code !
sorry again for bothering, i can't progress because of this
Nothing more. I've just re-synced the template file POT to get new strings. Then re-sync the language template with the POT file to start translating 🙂
thanks again for your assistance, really appreciate it
i did some deep testing and here is what i found:
when using the code generator and putting the code into themes functions.php, it will work like your example.
this way it's hard coded and loco translate can see the code
but in my case i use the builder, so i don't put code on functions.php !
so i think it's on the database, and loco translate can't see it !
i downloaded my whole website and i can't find any custom field names or labels there ! of course because there is nothing inside functions.php
if this is right, and seems logical to you, how would you deal with this situation ?