Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change language input type=file

I´m using for my app spring-mvc and I have managed go up file to server, with label: <form:input path="file" type="file" id="file"/>, but I have a problem when my app changes of language, because this input type=file doesn´t change of language and I´m doing a lot of proof but I don´t get it.

does somebody know like it doing?

for to change the language of all labels, I do this:
<fmt:message key="device.registerFormFile"/>

Thanks.

like image 827
Ltcs Avatar asked Dec 11 '13 10:12

Ltcs


People also ask

What is input type file?

Definition and Usage. The <input type="file"> defines a file-select field and a "Browse" button for file uploads. To define a file-select field that allows multiple files to be selected, add the multiple attribute. Tip: Always add the <label> tag for best accessibility practices!

How do I get the value of an input type file?

The value property returns the path or the name of the file selected with the <input type="file"> element. This property returns the name of the selected file with a fake path in IE, Google Chrome, and Opera, and the name of the selected file in Firefox and Safari.

How do you translate choose file and no file chosen?

Unfortunately, it is not possible to change the "Choose File" and "No File Chosen", since we use a standard file input element for single upload fields. That element is not controlled by us, it is a native browser element, so it even looks different on each browsers.


1 Answers

It's not possible to translate "Choose file" and "no file chosen" labels, as those are native browser elements and depend on browser's language.

However, you may try some tricks like putting image instead of button or making file input transparent (and add text input below).
Browse through those answers to choose if any is suitable:

How to change the button text of <input type=“file” />?
Change default text in input type=“file”?

like image 94
Michał Rybak Avatar answered Sep 23 '22 02:09

Michał Rybak