Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 06, 2011 07:01 PM by NickLocke
Member
92 Points
147 Posts
Apr 06, 2011 07:01 PM|LINK
This is a "best practice" kind of question. I have a string which, for example, reads
Please read more detail about our products.
To make that localisable, I need to use something like:
<asp:Localize runat="server" ID="ReadMore" text="Please read more detail about our products." />
So far so good, but now I need to create a hyperlink:
Please read <a href=".....>more detail</a> about our products.
To make that more manageable from a localisation point of view, I think I need to use some placeholders:
string.format("Please read {0}{2}{1} about our products.", "<a href=....">, "</a>", "more detail")
I guess I have two questions - is this the right way to do it (given that two parts of the hyperlink are static and the text within it isn't)? Secondly, how best to combine the Localize control with the string.format?
Thanks, Nick.
NickLocke
Member
92 Points
147 Posts
Combining the asp:Localize control with string.format
Apr 06, 2011 07:01 PM|LINK
This is a "best practice" kind of question. I have a string which, for example, reads
To make that localisable, I need to use something like:
So far so good, but now I need to create a hyperlink:
To make that more manageable from a localisation point of view, I think I need to use some placeholders:
string.format("Please read {0}{2}{1} about our products.", "<a href=....">, "</a>", "more detail")I guess I have two questions - is this the right way to do it (given that two parts of the hyperlink are static and the text within it isn't)? Secondly, how best to combine the Localize control with the string.format?
Thanks, Nick.