I have a web page which has an
input type="file" for allowing the user to browse and select a file to upload. My machine's culture is
en-GB, the website culture should be
nb-NO. How can I tell browsers to localize the button text?
- Firefox says "Browse..."
- Safari says "Choose File"
I have tried
<html lang="nb-NO"> but the buttons remain in English.
Browsers automatically localize the text - e.g. a French browser would use naviger.
it gets the settings from the machine locale settings, not the html page.
makes sense really?
So, what I'm saying is that your form elements will change based on the locale of the machine viewing them.
if you want to see what they'd look like you just need to change your locale.
This may depend on the locale setting on the client machine as the browse button is not technically part of the page (even though it's on the page, it's added automatically by the browser and I believe the text on the button varies between browsers too).
If you can localise this button text independantly of the locale setting on the users machine, you'll probably have to configure the server or platform, e.g. this tutorial shows how to set the culture and UI culture for an ASP.NET site