'Change text language of InputFile in blazor

I have a blazor application that accept multi languages, I want to change the language of InputFile depends of CultureInfo.CurrentCulture.

Razor page

string CultureLang = CultureInfo.CurrentCulture.Name.Split('-') 
  [0].ToString();
 <InputFile class="form-control" OnChange="async (e) => await 
   LoadFiles(e)" multiple lang="@CultureLang"></InputFile>

I get the the right CultureInfo but UI of InputFile is still in English
enter image description here

Thanks.



Solution 1:[1]

I used the bootstrap and fontawesome to delete the default style of InputFile:

<label for="filePicker" class="label">
  <i class="fas fa-paperclip"></i>
  <span class="title">@Label</span>
  <InputFile id="filePicker" class="invisible" OnChange="async (e) => await LoadFiles(e)" multiple></InputFile>
</label>

Css

.label {
    width: 15rem;
    height: 2.5rem;
    border: 2px dashed;
    border-radius: 5px;
    display: block;
    padding: 0.5em;
    transition: border 300ms ease;
    cursor: pointer;
    text-align: center;
}
i{
    display: block;
    font-size: 42px;
    padding-bottom: 16px;
}

.title {
    transition: 200ms color;
}

.label:hover {
    border: 2px solid;
}

Note that Label is text that will be translated depends on CurrentCulture, I used here IStringLocalizer to get the right translation from the resource.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user13256346