Angular2 i18n for placeholder text

后端 未结 3 1555
别跟我提以往
别跟我提以往 2021-02-12 13:42

Is there a way to translate the placeholder text for an input text field using Angular 2\'s i18n?

I

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-12 14:19

    There has been an example, but I can't seem to find it anymore.

    You should be able to use i18n-attributename. For example:

    
    

    That would need an entry like this:

    
      From
      Van
      From placeholder
    
    

    In your messages.xlf file. I couldn't get it to work without a translation though. So you will need to add the state=translated and a value.

    Even if we don't give value in i18n-placeholder then it is also fine. just do like:

    
    

    it will work fine.

提交回复
热议问题