Angular 2+ localization (i18n) rtl support

前端 未结 3 1423
时光说笑
时光说笑 2020-12-31 19:54

What is the best practice for adding right to left (rtl) support into a localized Angular 2+ app (e.g. for Hebrew and Arabic languages)? I looked through several tutorials i

3条回答
  •  伪装坚强ぢ
    2020-12-31 20:36

    As of 2017, it appears that the Angular team is too busy and too few to add right-to-left (rtl) support to the angular-translate module (https://github.com/angular-translate/angular-translate/issues/260).

    Not a big deal though, because it's pretty easy to do this with just native JS...

    document.body.setAttribute("dir", "rtl");
    

    In my experience, HTML5 does a pretty good job of getting rtl support done correctly.

提交回复
热议问题