Adding @T resource and set the default message before adding

2 weeks ago
Hello,

In Completed.cshtml file, i want to add a new resource.
How can I revise my code in Completed.cshtml to display the default message "@:Please Comeback to check your order" if the resource key "Checkout.CombackMessage" hasn't been defined in the NopCommerce admin language page?


"<strong>
                            @if (T("Checkout.CombackMessage") is null)
                            {
                                @:"Please Comeback to check your order"
                            }
                            else
                            {
                                @T("Checkout.CombackMessage")
                            }
</strong>"

OR

"<strong>
  @(T("Checkout.CombackMessage", "@:Please Comeback to check your order"))
</strong>
"

Thank you
2 weeks ago
Just compare the "@T()" result with the same locale name ("Checkout.CombackMessage" in your case) instead of comparing to "null". If they equal, it means that it's not defined.

P.S. Wouldn't it be more simple to just add this locale in admin area?
2 weeks ago
Hi, thank you