Difference between GetLocaleResourceString.. and $NopResources:...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
Dear People from nop or others

Can anyone tell me what the different is between both approaches used in Nopcommerce. The GetLocaleResourceString is used in 1.3 and the $NopResources: approach is used in 1.4.

I know that in asp.net you can use a Resource.resx file and use the comnand $NopResources:etc.. to fill a text field.

I hope someone could tell me because i'am adding some additions from 1.4 in my i.3 project.

What is the best and when and how to use.

thanks in advance

Michael
14 years ago
They do the same thing.  

<asp:HyperLink runat="server" ID="hlHome" Text="<% $NopResources:Forum.Home %>" />

would work the same as:

<asp:HyperLink runat="server" ID="hlHome" Text='<%=GetLocaleResourceString("Forum.Home")%>' />

Its probably just more of a aesthetics thing, the top one looks nicer and you don't have to have a code behind function called GetLocaleResourceString.

In the web.config you will see  line like:

      <expressionBuilders>
        <add expressionPrefix="NopResources" type="NopSolutions.NopCommerce.BusinessLogic.Localization.NopResourceExpressionBuilder, Nop.BusinessLogic"/>
      </expressionBuilders>

This is what NopResources references.

Hope this helps.

Thanks,
Matthew
14 years ago
Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.