0

Goal: Get certain text to appear with ngIF condition.

Problem: It doesn't appear even though the value of the condition exists This sentence does not appear (on Spanish site): Your subscription will change from a Family Subscription to an Individual Subscription on {{subscriptionInfo?.CurrentSubscriptionEndDate}}.

If I am on the English version of the site, it works fine.

  <span i18n="@@MoMsCoHd_H1_121" *ngIf="subscriptionInfo?.CurrentSubscriptionPlan =='Family Subscription'">Your subscription will change from a Family Subscription to an Individual Subscription on {{subscriptionInfo?.CurrentSubscriptionEndDate}}. </span> <br />

Sentence is there

When I am on the Spanish version of the site, it doesn't work

<span i18n="@@MoMsCoHd_H1_121" *ngIf="subscriptionInfo?.CurrentSubscriptionPlan =='Suscripción familiar'">Your subscription will change from a Family Subscription to an Individual Subscription on {{subscriptionInfo?.CurrentSubscriptionEndDate}}. </span> <br />

Missing Sentence

What I've tried: I've tried simplifying the condition to just one property. I've tried printing variable to console to make sure the value exists (it does) I've tried printing the value of variable to the screen itself to make sure the value exists when I am trying to access itself (it does) I've also tried using booleans in the typescript instead of strings I've also tried moving the logic into the typescript instead of the html

HTML:

<span i18n="@@MoMsCoHd_H1_121" *ngIf="subscriptionInfo?.CurrentSubscriptionPlan =='Suscripción familiar'">Your subscription will change from a Family Subscription to an Individual Subscription on {{subscriptionInfo?.CurrentSubscriptionEndDate}}. </span> <br />
<span>subscriptionInfo?.CurrentSubscriptionPlan: {{subscriptionInfo?.CurrentSubscriptionPlan}}</span><br />
<span>subscriptionInfo?.NewSubscriptionPlan: {{subscriptionInfo?.NewSubscriptionPlan}}</span><br />
<span i18n="@@MoMsCoHd_H1_3">If you did not make a change to your plan, please contact customer service at <span class="no-wrap">512-421-5678</span>. </span>
<a class="no-wrap" (click)="getLastOrderSummary()" style="cursor: pointer;" i18n="@@MoMsCoHd_H1_4">Download Order Summary</a>

Typescript:

public subscriptionInfo: ISubscriptionInfo;

this.patientService.GetSubscriptionInfo(patientId.toString()).subscribe(subscriptionResponse => 
        { 
            this.subscriptionInfo = subscriptionResponse;

I've spent a few days on this, so looking for a fresh perspective on what I could possibly be missing? How can I get that condition to show?

angleUr
  • 449
  • 1
  • 8
  • 27
  • have you checked what is value of CurrentSubscriptionPlan in spanish website? – Shabbir Dhangot Jul 26 '20 at 19:03
  • Have you checked the strings out ouf app in order to be sure it is not a case of [confusables unicode characters](http://www.unicode.org/Public/security/latest/confusables.txt). Try this: `"Suscripción familiar" == "Suscripciόn familiar"` – Shlang Jul 26 '20 at 22:03
  • @ShabbirDhangot Yes, i printed to console, and as you can see in the screenshot I printed it to the page itself. Its directly under the missing sentence. – angleUr Jul 27 '20 at 02:54
  • @Shlang good idea since Spanish has those special characters. I compared what I had in the DB and typescript to what was in the HTML. I pasted them into notepad to look. They all looked identical. Not sure what else it could be at this point? – angleUr Jul 27 '20 at 03:10
  • @angleUr did you try to put these values to the browser console and compare there with `==`? – Shlang Jul 27 '20 at 10:54

0 Answers0