• R

    (@rreisdasilvagmailcom)


    Hi guys,

    I need your help. I keep having this problem and can’t seem to find a way to fix it online…

    I mainly use woocommerce in Portuguese and I have changed a bit the official translation to better suit my needs. I have placed the file woocommerce-pt_PT.mo at

    wp-content/languages/plugins

    and the personalize translation works fine. The problem is that it gets overwritten at each new update. Where shall I place the file so I can keep my translation ? I have tried at wp-content/languages/plugins/woocommerce but then the translation doesn’t work.

    Any help is very welcomed 🙂

    Thanks

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The key is using the ‘load_textdomain_mofile’ filter to alter the file’s path used. To protect the filter code from being lost during updates you need to place it in a child theme or your own site specific plugin. You can place your custom MO file there as well.

    Once your filter callback verifies the file to load is woocommerce-pt_PT.mo, return the preferred path, otherwise return the passed path unaltered.

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce localization’ is closed to new replies.