【问题标题】:Is there a way to translate css selectors(::after, ::before) content using ngx-translate?有没有办法使用 ngx-translate 翻译 css 选择器(::after, ::before) 内容?
【发布时间】:2021-12-16 21:13:47
【问题描述】:

有没有办法使用 ngx-translate 翻译 css 选择器(::after, ::before) 内容?

.custom-file-label::after {
    content: "Browse"
}

【问题讨论】:

    标签: angular internationalization translate angular-translate ngx-translate


    【解决方案1】:

    在html中添加

     <div class="custom-file-label" [attr.your-custom] = "{{ 'Browse' | translate}}"></div>
    

    在css中

    .custom-file-label::after { 
            content: attr(your-custom);
     }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-15
      • 1970-01-01
      • 2019-06-10
      • 1970-01-01
      • 1970-01-01
      • 2013-11-02
      • 1970-01-01
      相关资源
      最近更新 更多