Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
  • #1120309

    Hi Enfold Team,

    we are using Enfold for a lot of projects (at least over 20) and are having trouble translating our child themes.

    We tried to fix this issue by ourselves for quite some time now, but couldn’t succeed.

    Our Setup:

    Main Issues:

    • Translations for our text domain are being loaded correctly
    • Translations for the Enfold parent theme are not being loaded (e.g. 404 page, enfold widgets, etc)
    • When updating poedit, all enfold translations are being removed from the files, just leaving the child theme translations. Could this be the reason?


    add_action( 'after_setup_theme', 'avia_lang_setup' );
    function avia_lang_setup() {
    	$lang = get_stylesheet_directory() . '/lang';
    	load_child_theme_textdomain( 'mytextdomain', $lang );


    Theme Name: mytheme
    Description: A <a href=''>Child Theme</a> for ClientXYZ.
    Version: 1.0
    Template: enfold
    Text Domain: mytextdomain
    Domain Path: /lang

    As documented here

    The text domain name must use dashes and not underscores and be lowercase.

    -> We made sure not to use underscores in our text domains (as opposed to the stackexchange question)
    -> BUT the Enfold text domain is “avia_framework” (could this be an / the issue?)


    Hey Chris,

    Thank you for using Enfold.

    Are you trying to use your own translation in the child theme? Please remove the current code in the functions.php file and replace it with the following snippet.

    function overwrite_language_file_child_theme() {
        $lang = get_stylesheet_directory().'/lang';
        return $lang;
    add_filter('ava_theme_textdomain_path', 'overwrite_language_file_child_theme');

    Which texts in particular are you trying to translate?

    Best regards,


    Hi Ismael,

    Thanks for your help, but the code you provided unfortunately couldn’t solve the problem. Actually after embedding your code no translation was loaded at all.

    There are a lot of strings we’d like to translate like
    – “Share this entry”
    – “You might also like”
    – “Leave a reply”
    – Placeholder “Search” in the search bar
    – and so on.

    Basically we can say that only child theme strings which are comprised in the child theme po/mo files are being translated, while none of the parent theme strings are.

    Looking forward to your reply.

    Thanks a lot in advance!



    Thank you for the update.

    Did you put the language files (.po|.mo) inside the “lang” folder of the child theme? The purpose of the filter above is to redirect the theme text domain directory to the child theme’s “lang” folder.

    You can also use this plugin.


    Best regards,


    Hi Ismael,

    yes, we have the po/mo files in the child theme /lang/ folder.

    As we have really a lot of enfold installs in this configuration we’d love not to use a plugin.

    If you need any server access please just let me know.

    Thanks a lot again in advance!



    Thank you for the update.

    Yes, please post the WP and FTP details in the private field. Can you provide the corresponding translations for the texts so that I can add them?

    Best regards,


    Thanks for your reply Ismael!

    Please find the login data attached.



    Thank you for the update.

    We disabled the “avia_lang_setup” function in your child theme and reactivated the “avf_overwrite_language_file_child_theme” function. (see private field)

    Best regards,


    Hi Ismael,

    Thanks a lot for your help!

    We have a 1:1 copy of the environment you just made the changes.

    When just activating the “avf_overwrite_language_file_child_theme” there we still have the same issue.

    Did you do anything else (no matter how unimportant) ???

    Thanks again a lot in advance!



    Did you update the language files? Sorry, I forgot to mention that I also updated the language files in the “lang” folder using the latest version from the parent theme.

    Thank you for the update.

    Best regards,


    Hi Ismael,

    Thanks a lot for your help.

    Updating the language files might be part of the solution. Could you explain to me in detail how you updated them?

    We use Poedit and it automatically scans our child theme for new strings matching our text domain.

    When doing so it also automatically removes all strings which have a different text domain from the po/mo files, which means all the strings with “avia_framework” as text domain (enfold strings) are being removed.

    We always thought that this step is how it’s supposed to be, but now we get the feeling that this might be part of the problem.

    Is there a way to manually add the strings to our language files?



    We just copied the latest version from the parent theme and place it in the child theme’s lang folder. You need to use the “avia_framework” text domain because the strings that you’re trying to translate belongs to it. The underscores in the text domain name may not be in accordance with the I18n standards but it’s still going to work. If you want to use POEdit, try to manually open the PO file in the lang folder, translate the strings, then compile the MO file.

    Best regards,


    Hey Ismael,

    Thanks for your latest reply!

    We just realized that this code here works for us:

    add_action( 'after_setup_theme', 'avia_lang_setup' );
    function avia_lang_setup() {
    	$lang = apply_filters('enfold', get_template_directory()  . '/lang');
    	load_theme_textdomain('avia_framework', $lang);
    	load_child_theme_textdomain( 'child-theme-text-domain', get_stylesheet_directory() . '/lang' );


    Great! Did you need additional help or shall we close this topic?

    Best regards,
    Jordan Shannon


    Hi Jordan,

    all good now, you can close the topic.




    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 16 posts - 1 through 16 (of 16 total)

The topic ‘Translation with Poedit and Child Theme’ is closed to new replies.