Search code examples
internationalizationsapui5globalization

Change sapui5 fileuploader browse button text


I'm looking for a way to change sapui5 language at runtime based on the loggedin user language. I have the i18n properties file in place. The challenge that I'm facing is to change the text on the FileUploader button. This text is not being picked up from the properties file. It is always 'Browse'

I'm using sap.ui.commons.FileUploader()

var FileUploader = new sap.ui.commons.FileUploader({
        id: "fileUploader_id",
        fileType: "zip",
        uploadOnChange: false,
        buttonText: oBundle.getText(FILEUPLOADER_BUTTON_TEXT),
        tooltip: oBundle.getText(FILEUPLOADER_BUTTON_TIP),
    });

Similar problem with the table when there is no data. The table displays 'No data' in english instead I want it to be in a user specific language.


Solution

  • In older versions of SAPUI5 (using commons library), the button Text can be changed by overwriting the standard buttonText parameter. i.e., in this case the standard "FILEUPLOAD_BROWSE" has to be overwritten in the local i18n.properties file. We cannot use the name that suites us (like FILEUPLOADER_BUTTON_TEXT).