1

I created file upload function using lightning-file-upload. Its buttons are showed "uplopadFiles" and "ordrop files". I would like to change those to proper Japanese. Could you tell me how to? I found some post to change the button label for <lightning:input type=“file”>. Is it possible to change for < lightning-file-upload> as well?

2 Answers 2

1

the documentation indicates how to change the label

The button label is "Upload Files" by default. Use the label attribute to add a descriptive label above the Upload Files button.

this is of course only for what is displayed above the button, I don't believe there are other modifiable attributes though

3
  • You can use Style Hooks to change many of the colors and things for most components. The docs don't reflect all the possibilities as of yet.
    – sfdcfox
    May 14, 2021 at 2:36
  • for labels as well? I knew about using hooks for colors and so on
    – glls
    May 14, 2021 at 3:07
  • 1
    I just thought you meant no further customizations at all. You're right though, part of it can't be customized at all.
    – sfdcfox
    May 14, 2021 at 4:05
0

As you mentioned there are other approaches to change label which will require moving from lightning-file-upload to lightning-input. Like the one mentioned in the following blogs or similar questions:-

  1. https://www.salesforcetroop.com/custom_file_upload_using_lwc &

  2. Lightning:input type="file" change the "Upload Files" text

However, it is recommended to use lightning-file-upload as it provides the functionality without much of server side handling part. Use of Lightning-input will require lot of custom apex code. Hope in future releases , salesforce provides flexibility to change "Upload Files" button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.