Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uppercase filter not working inside angular translate

I'm trying to display the text of a button in upper-case . There is localisation involved, so the button text will be fetched from the corresponding language files. Language switching works fine , however the upper-case conversion doesn't . If the value of BTN_EDIT is a lower-case text in language file , the text is always shown in lower-case .

 <button ng-click="editUserLoginCreditDetails()" ng-show="editLoginCredentialButton" translate="{{'BTN_EDIT'|uppercase}}"></button> 
like image 661
Mridul Raj Avatar asked Dec 02 '22 19:12

Mridul Raj


2 Answers

The translate directive apparently doesn't allow a filter in that way. Try this:

<button ng-click="editUserLoginCreditDetails()" ng-show="editLoginCredentialButton">{{'BTN_EDIT' | translate | uppercase}}</button>
like image 142
Jerrad Avatar answered Dec 27 '22 18:12

Jerrad


I know it is too much late, just in case anyone who face this issue. to solve this issue, you have to use css property style="text-transform:lowercase;" and this will solve your problem.

Cheers

like image 24
Nadeem Khoury Avatar answered Dec 27 '22 16:12

Nadeem Khoury