Why does Royal replace the default woocommerce textdomain?

This topic has 4 replies, 3 voices, and was last updated 6 years, 1 months ago ago by Olga Barlow

  • Avatar: Royalty
    Royalty
    Participant
    March 1, 2018 at 14:42

    Hello,
    I would like to know why you override the default woocommerce text strings with your own ones, p.e. in cart.php, there is by default:
    <?php esc_html_e( 'Product', 'woocommerce' ); ?>
    and you transform it to:
    <?php esc_html_e( 'Product', 'royal' ); ?>

    Replacing the ‘woocommerce’ textdomain with ‘royal’ means that I have to translate all strings again because Royal theme is not translated in my language (German). Leaving them just with the default ‘woocommerce’ text domain would be perfect because all the strings are already translated by woocommerce.
    So this makes no sense to me at all, maybe you can explain why you do this.
    Many thanks in advance.

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 1, 2018 at 15:06

    Hello,

    Text domain was changed only in files that were overwritten in our theme. If a WC file was added into royal/woocommerce folder, text domain should be changed for correct functionality. Please read about theme translation – https://xstore.helpscoutdocs.com/article/30-base-theme-translation (this for xstore theme, but you can use this information for the royal also). Let us know if you need any help with theme translation.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    March 1, 2018 at 15:10

    Hello,
    thanks but I still dont understand the reason. I changed all text strings (via child theme) back to woocommerce so that I dont have to translate everything again and I dont see any problems with functionality. I am using Loco translate and that works like a charm, so I need no help with translating, I just dont understand why the default text strings should affect the functionality?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    March 2, 2018 at 11:54

    Hello,

    If you need detailed information about theme localization read these articles
    https://developer.wordpress.org/themes/functionality/localization/
    https://premium.wpmudev.org/blog/how-to-localize-a-wordpress-theme-and-make-it-translation-ready/

    To avoid problems with translation we use theme text domain for all the strings included in our theme, even for the WC files because if they are included in theme folder they are part of the theme, not part of the plugin.

    Regards

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.