• For instance, I have a Woocommerce product translation needs, to simplify the explanation, just focus on post content.

    For the theme rendering, it just use the Woocommerce default template with default WordPress function “the_content()” to render the post content(description).

    The default language is set to be zh_HK and the secondary language is en_US.
    Version: WP 5.8.3/TRP 2.1.8

    The post content is

    <ul>
    <li>雞手語戊卜視日木收許您,寫上海裏夕成實因戊山里抓,瓜坡示夏友三再兄比說浪事采遠手哪。冰那訴會林清十。到現乞反息七喝家多飛美文亭兔。</li>
    <li>雞手語戊卜視日木收許您,寫上海裏夕成實因戊山里抓,瓜坡示夏友三再兄比說浪事采遠手哪。冰那訴會林清十。到現乞反息七喝家多飛美文亭兔。</li>
    <li>雞手語戊卜視日木收許您,寫上海裏夕成實因戊山里抓,瓜坡示夏友三再兄比說浪事采遠手哪。冰那訴會林清十。到現乞反息七喝家多飛美文亭兔。</li>
    <li>雞手語戊卜視日木收許您,寫上海裏夕成實因戊山里抓,瓜坡示夏友三再兄比說浪事采遠手哪。冰那訴會林清十。到現乞反息七喝家多飛美文亭兔。</li>
    <li>雞手語戊卜視日木收許您,寫上海裏夕成實因戊山里抓,瓜坡示夏友三再兄比說浪事采遠手哪。冰那訴會林清十。到現乞反息七喝家多飛美文亭兔。</li>
    </ul>

    According to the discussion in this page: https://translatepress.com/translate-dynamic-strings-wordpress/
    The user content belongs to dynamic content. So I suppose in the preview, it display the description as “Original Strings”. However it splits the string into lines of translation. Then I try echo and “_e()” gettext function to output the content directly.

    While echo give the same result as “the_content” as expected because “the_content” is just echo + apply a filter to the content.
    Conversely, _e() belongs to gettext but it display the text as original string in one string instead of splitting into strings.

    So I wonder what situation is actually making it displaying as original string and what situation is splitting the text into lines.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘The definition of Dynamic String seems not matching the practical implementation’ is closed to new replies.