Mridul Raj
Mridul Raj

Reputation: 999

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> 

Upvotes: 4

Views: 7907

Answers (3)

Vaibhav Pachauri
Vaibhav Pachauri

Reputation: 2671

If you can try the following way:

<button ng-click="editUserLoginCreditDetails()" ng-show="editLoginCredentialButton" translate>{{'BTN_EDIT' | uppercase}}</button>

I hope this would work. Let me know, if you face any difficulty.

Upvotes: 5

Nadeem Khoury
Nadeem Khoury

Reputation: 937

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

Upvotes: 5

Jerrad
Jerrad

Reputation: 5290

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>

Upvotes: 8

Related Questions