angular icon indicating copy to clipboard operation
angular copied to clipboard

[Question] Translated fields

Open fzucaro opened this issue 5 years ago • 3 comments

Is possible to set translation for field in file upload ? Es. File Name , Size , Type or "Drop files to attach, or browse"

fzucaro avatar Mar 17 '20 14:03 fzucaro

Yes it should be possible since all of our strings (at least I think) are passed through the translate function.

travist avatar Mar 18 '20 14:03 travist

And where i cha find the label for translations ? In issue comments i found only an object (see attach). I also open a problem (#496) for translation..there is documentation abount manage translation in formio ?

fzucaro avatar Mar 18 '20 17:03 fzucaro

If this is still an issue for someone, I found a solution that works with "@formio/angular": "5.3.0" You have to translate all three parts separately in your translation JSON, for e.g.:

export const FORM_RENDERER_LANGUAGE = {
    lt: {
        'browse': 'pasirinkite',
        'Drop files to attach,': 'Įkelkite failus, kuriuos norite pridėti,',
        'or': 'arba'
    }
};

then provide that translation for your renderer or builder:

      [renderOptions]="{
        language: 'lt',
        i18n: {
          lt: FORM_RENDERER_LANGUAGE.lt
        }
      }"

and it translates nicely: image

pmatulionis avatar Sep 27 '22 13:09 pmatulionis

We're currently addressing a backlog of GitHub issues, and as part of this effort, some inactive issues may be marked as closed. This isn't a dismissal, but a step toward more efficient tracking.

If you feel the issue is still relevant, please re-open and we'll ensure it gets the attention it deserves. Your understanding is appreciated as we work to enhance our open-source responsiveness.

Sidiro23 avatar Feb 07 '24 14:02 Sidiro23