简体   繁体   English

ngx-translate 在 angular 8 中的 terinory 条件下

[英]ngx-translate in terinory condtion in angular 8

here the issue is ngx translate in ternary condtion.这里的问题是三元条件下的 ngx 翻译。

{{ (videoConfig === true) ? 'Disable Video' : 'Enable Video' }}

i want to translate the word disable video and enable video in that condtion.how it is possible please help...我想在那个条件下翻译禁用视频和启用视频这个词。如何可能,请帮助...

Try something like尝试类似的东西

{{ ((videoConfig == true) ? 'Disable Video' : 'Enable Video') | translate }}

or even甚至

{{ (videoConfig  ? 'Disable Video' : 'Enable Video') | translate }}

should work also也应该工作

Just wrap the ternary operator into () and it should be good.只需将三元运算符包装到 () 中就可以了。

{{ ((videoConfig === true) ? 'Disable Video' : 'Enable Video') | translate }}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular 4 Ngx-translate管不起作用 - Angular 4 Ngx-translate pipe not working 如何从 Angular 6 中的组件中提取文本进行翻译 (ngx-translate) - How to extract text from components in Angular 6 for translation (ngx-translate) 在 Angular 4+ 中使用 ngx-translate 进行本地化(国际化)? - Localization (internationalization) in Angular 4+ using ngx-translate? 如何使用参数动态翻译文本文件到 angular 中的 ngx-translate? - How to dynamic translate text file using parameter to the ngx-translate in angular? 从本地存储中获取数据并使用 ngx-translate 将其显示在视图中 | Angular - Get data from localstorage and display it in view using ngx-translate | Angular 使用组件作为 ngx-translate 键的参数 - Using a component as a parameter for a ngx-translate key Angular ngx-translate - 如何为翻译值中缺少的参数设置默认值 - Angular ngx-translate - How to set a default value for missing param in translation value 如何使用 ngx translate to angular 将数据转换为 ts - How to translate data to ts using ngx translate to angular NGX 翻译核心管道不适用于参数 - NGX Translate core pipe not working with param 根据条件在Angular JS中动态应用CSS样式属性 - Apply CSS style attribute dynamically in Angular JS based on condtion
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM