Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET: localize content with mixed HTML formatting
    primarykey
    data
    text
    <p>In my application I have paragraphs with mixed static text and HTML formatting and links. I'm looking for a good localization solution that keeps resources decoupled from markup. Let's say we have the following paragraph:</p> <pre><code>&lt;p&gt;Let's have a &lt;a href="someURL"&gt;cup of coffee&lt;/a&gt; and get &lt;b&gt;energized&lt;/b&gt;.&lt;/p&gt; </code></pre> <p>Using the standard resx solution forces me to embed the HTML markup and the link destinations in the resx string. This is bad because it couples markup/CSS/app structure with resources.</p> <p>The next best thing is to split the paragraph such that localized content never contains markup. In the above example I would have 4 para fragments: 1) "Let's have a" as plain text 2) "cup of coffee" as a link 3) "and get" as plain text 4) "energized" as bold text</p> <p>The problem with this solution is that fragmentation makes maintenace of resources a complete nightmare plus it forces a certain order of the paragraph fragments which might not fit the grammar of all cultures. For instance, in the translated language the proper translation might be</p> <pre><code>&lt;p&gt;Let's get &lt;b&gt;energized&lt;/b&gt; with a &lt;a href="someURL"&gt;cup of coffee&lt;/a&gt;.&lt;/p&gt; </code></pre> <p>I don't think I can quite get away with not embedding markup into resources and that might not be a huge deal. Using proper markup/CSS (span, div, id, class) I can create abstractions that would lessen the impact of coupling.</p> <p>What do I do about the link URLs though? Thanks,</p> <p>Stefan</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload