Reputation: 747
Is there anyway to change the caption of the upload button from "UPLOAD FILES" to whatever is required?
Thanks a lot in advance
Upvotes: 0
Views: 493
Reputation: 15518
Initial reply - for basic Vaadin
As per the docs you can use upload.setButtonCaption("My custom caption");
. Am I missing something?
Later update - for Vaadin elements
In this case you can use its i18n
localization property. Unfortunately, for me the suggestion in the book to change a certain part with
document.querySelector('vaadin-upload#en').i18n.addFiles.many = 'Add Files;
did not work. However,
document.querySelector('vaadin-upload#en').set('i18n.addFiles.many', 'Add Files');
as seen in their github samples seems to work just fine. Below a sample and screenshot
<body>
<vaadin-upload id="en"></vaadin-upload>
<script>
document.querySelector('vaadin-upload#en').set('i18n.addFiles.many', 'Add Files');
</script>
</body>
Result:
Upvotes: 1