<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>Enable “file” button for translation

[ad_1]

Replies: 1

The AVATAR block uses an input field of type “file”, which uses ALWAYS the deault language of browser. Thsi is a problem because it mixes languages when used in multilingual sites. Can you please use the following trick to fix this problem?

<div>
  <label 
    for="upload_avatar_field_button" 
    class="btn">
    <?php _e("Select Image", 'text-domain'); ?>
  </label>
  <input 
    type="file" 
    id="upload_avatar_field_button"
    name="simple_upload_avatar_field" 
    style="visibility:hidden;">
</div>

with

$("#upload_avatar_field_button").change(function() {
  filename = this.files[0].name;
  // Do what you want
});

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer