Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Wordpress how to translae acf plugin fields to another language?

I need to translate Choose File & No file chosen to another language (Japanese).

The following code is from acf field.

I looked into the code but there are no Choose File & No file chosen.

Would you please let me know how to translate them in this case?

enter image description here

<div class="acf-input">
<div class="acf-file-uploader" data-library="all" data-mime_types="" data-uploader="basic">
    <input type="hidden" name="acf[field_60bc51d8898c5]" value="" data-name="id">   <div class="show-if-value file-wrap">
        <div class="file-icon">
            <img data-name="icon" src="" alt="">
        </div>
        <div class="file-info">
            <p>
                <strong data-name="title"></strong>
            </p>
            <p>
                <strong>File name:</strong>
                <a data-name="filename" href="" target="_blank"></a>
            </p>
            <p>
                <strong>filesize:</strong>
                <span data-name="filesize"></span>
            </p>
        </div>
        <div class="acf-actions -hover">
            <a class="acf-icon -cancel dark" data-name="remove" href="#" title="Delete"></a>
        </div>
    </div>
    <div class="hide-if-value">     
        <label class="acf-basic-uploader">
            <input type="file" name="acf[field_60bc51d2899c5]" id="acf-field_60bc51d2899c5">
                               </label>             
    </div>
</div>
</div>



Thank you.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

If you want to translate just a handful of words and not the entire plugin, then you could use the following method!

So, every well-developed plugin/theme has a text domain associated with it, so that you could hook into it and manipulate any text generated by that plugin/theme. For example text domain for woocommerce plugin is woocommerce! For ACF plugin, it's acf!

Usually you could find the text domain in the main file of the plugin. For ACF plugin you could find it in the acf.php located in the root directory of the plugin. See the screenshot below!

enter image description here

After you found the text domain then you could hook into it using gettext, ngettext etc. filter hooks! See the code below:

add_filter('gettext', 'your_theme_translate_acf_fields', 20, 3);

function your_theme_translate_acf_fields($translated, $text, $domain)
{
  if ('acf' == $domain) :
    switch ($translated) {
      case 'No file chosen': // THIS IS THE TEXT GENERATED BY THE ACF PLUGIN
        $translated = 'ファイルが選択されていません';
        break;
      case 'Choose File': // THIS IS THE TEXT GENERATED BY THE ACF PLUGIN
        $translated = 'ファイルを選ぶ';
        break;
    }
  endif;

  return $translated;
}

Notice: Capitalization matters!

Code goes to your functions.php of your active theme. Tested and works!

Wordpress translation filter hooks:
gettext
ngettext

over 4 years ago · Santiago Trujillo Report

0

If you want to translate any plugin first, check the .pot file. The file is inside wp-content>plugins>plugins-name>languages. You can edit the file with POedit. You can translate to any language.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!