[resolved] Translation (2 posts)

  1. boldt
    Posted 4 years ago #

    I can see that the theme is prepared for translation when looking in to the .php files.

    I have now made a Danish translation for my webpage using poEdit, but now I need to install my translation.

    1) what name shall I give the .mo file?
    2) where shall I place the .mo file?
    3) is there other things I shall be aware of?


  2. boldt
    Posted 4 years ago #

    The key is the function: load_theme_textdomain. This function is placed last in functions.php of the Theme.

    The .mo files must use language-only filenames, like languages/de_DE.mo in your theme directory.

    Unlike plugin language files, a name like my_theme-de_DE.mo will NOT work. Although plugin language files allow you to specify the text-domain in the filename, this will NOT work with themes. Language files for themes should include the language shortcut ONLY.

    I have changed a little in functions.php of the theme, so load_theme_textdomain now says:
    load_theme_textdomain ('veryplaintxt' get_template_directory().'/lang');
    Because then I can place my language file in the folder: themes/veryplaintxt/lang - I like to keep order

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic