• Hi,

    When we want to make some modifications to OceanWP, it’s advised to use a child theme and not modify the core files of OceanWP.

    My question is: if I want to change some few default language strings, instead of editing the core OceanWP .po/.mo files, can I…
    – add a /languages/ subfolder to my child theme
    – with the 2 language files (.po/.mo) concerned by the modifications in it
    – files that will themselves only include the few strings that need to overwrite the default language strings?

    Or is there any other method that’s recommended to use in this particular case?

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Yes, please use the child theme instead of the parent theme. Follow the link to translate it – https://docs.easydigitaldownloads.com/article/1228-how-do-i-translate-my-theme-from-child-theme

    Thread Starter ftpwp

    (@ftpwp)

    Thanks, I’ll have a look!

    I was close. Was just missing the code in functions.php.
    But I still need to find out if we can set .po/.mo files that includes only the modified strings, not all the strings.

    If we can include only the modified strings, it’s perfect.
    But if it works only with all the strings, then it’s close to pointless.
    It would mean that for each update of OceanWP I would have to control its .po/.mo files and update the one of the child theme.
    I’m not will to translate a whole theme, but just adjust/improve some few strings.

    Thread Starter ftpwp

    (@ftpwp)

    It’s not working. The child language strings are just ignored.
    Have you tested this method for OceanWP?

    Is this function correct?

    function child_theme_slug_setup() {
        load_child_theme_textdomain( 'parent-theme-slug', get_stylesheet_directory() . '/languages' );
    }
    add_action( 'after_setup_theme', 'child_theme_slug_setup' );

    I have not tested it but it should work. Have you tried editing the pot file using a PoEdit tool?

    Thread Starter ftpwp

    (@ftpwp)

    Yes.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can we overwrite language strings via a child theme?’ is closed to new replies.