Support Forum
Support › General › How to translate custom field labels for different admin users languages ?Resolved
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
thank you
Hi,
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',
],
],
];
Thank you for your response,
i couldn't acheive this i don't know where i am not doing it right
i am using oxygen builder
thanks
Hi,
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
Thanks,
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 !
https://ibb.co/9V9cvJ2
https://ibb.co/9YNFLk7
https://ibb.co/68qpcST
https://ibb.co/X4WzD15
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
the field is on the hello world post
https://ibb.co/HHngbSg
Hi,
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
Hi,
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 ?
thanks
Hi,
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 🙂
Hi Long
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 ?
thanks again