How can I internationalize the button text of the file picker? For example, what this code presents to the user:
<input type="file" .../>
Just add an label tag and wrap input tag inside label and hide input and give it a id which will be used on label for attribute. You can remove the for="..." if the input element is inside the label.
It is normally provided by the browser and hard to change, so the only way around it will be a CSS/JavaScript hack,
See the following links for some approaches:
Pure CSS solution:
.inputfile { /* visibility: hidden etc. wont work */ width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; position: absolute; z-index: -1; } .inputfile:focus + label { /* keyboard navigation */ outline: 1px dotted #000; outline: -webkit-focus-ring-color auto 5px; } .inputfile + label * { pointer-events: none; }
<input type="file" name="file" id="file" class="inputfile"> <label for="file">Choose a file (Click me)</label>
source: http://tympanus.net/codrops
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With