Support » Theme: Deejay » Localization issue

  • Resolved sankari

    (@sankari)


    Dear Carolina,

    Thank you for this beautiful theme! I am trying to use it with another language (German, formal) in a child theme so I was happy to contribute with a translation. But on the website it still shows the English strings, e.g. in the post entry-meta and post entry-footer.

    So here is what I did:

    1. Translated the theme it into German formal at https://translate.wordpress.org/projects/wp-themes/deejay
    2. Downloaded .mo and .po files
    3. Renamed them: wp-themes-deejay.de.mo -> deejay.de_DE-formal.mo (same for .po)
    4. Uploaded them to /wp-content/languages/themes/
    5. Made sure German formal is selected in WordPress settings
    6. Made sure /wp-content/themes/deejay-child/functions.php contains the code below
    add_action('after_setup_theme', 'deejay_theme_setup');
    function deejay_theme_setup(){
        load_theme_textdomain('deejay', get_template_directory() . '/languages');
    }

    Could you please tell me how to make it work? Thank you in advance for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Correction:
    3. Renamed them: wp-themes-deejay-de.mo -> wp-themes-deejay-de_DE_formal.mo (same for .po)

    Theme Author poena

    (@poena)

    Hi!
    Thank you!

    I believe the language files should be named de_DE_formal, -without the theme name,
    and placed in the wp-content/themes/deejay-child/languages/ folder,
    not /wp-content/languages/themes/

    Also see https://developer.wordpress.org/themes/functionality/localization/

    Thanks for our reply, Carolina.

    Okay, I followed your advice and renamed the files to de_DE_formal.po and de_DE_formal.mo and placed them into /wp-content/themes/deejay-child/languages/ but to no avail.

    Then I added this to wp-config.php:
    define('WPLANG', 'de_DE_formal');

    It didn’t change the language of the theme either.

    Then I changed the code in /wp-content/themes/deejay-child/functions.php to:

    function deejaychild_theme_setup(){
        load_child_theme_textdomain('deejaychild', get_stylesheet_directory() . '/languages');
    }
    add_action('after_setup_theme', 'deejaychild_theme_setup');
    ?>

    Still not working… Sorry for bothering you, I’m quite new to this.

    Theme Author poena

    (@poena)

    Hi
    I haven’t done this before either.

    According to the example here, https://developer.wordpress.org/reference/functions/load_child_theme_textdomain/
    the handle needs to be the name of the parent theme. Try:

    load_child_theme_textdomain('deejay', get_stylesheet_directory() . '/languages');

    Good morning Carolina,
    Bullseye, it works! Thanks very much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Localization issue’ is closed to new replies.