Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I created a child theme for the twentyfourteen theme which I'm also busy translating into Afrikaans. I've named the file

pietergoosen-af_AF.po

and placed it into the languages file and I've added the following into my respective files functions.php and wp-config.php

    function pietergoosen_language_file_registration() {
    load_child_theme_textdomain( 'pietergoosen', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'pietergoosen_language_file_registration' );

and

define('WPLANG', 'af_AF');

All the plugins I've translated shows the Afrikaans words, but my theme not. I've checked out all tutorials and answers on this site, but can't get the thing to work. To assist, here are the headers for my stylesheet and po file

   /*
Theme Name:             pietergoosen
Theme URI:              http://pietergoosen.com
Description:            Spesiaal geskep deur Pieter Goosen vir sy webtuistes.
Author:                 Pieter Goosen
Author URI:             http://pietergoosen.com
License:                GNU General Public License v2 or later
License                 URI: http://www.gnu.org/licenses/gpl-2.0.html
Template:               twentyfourteen
Version:        1.0
*/

@import url("../twentyfourteen/style.css");

and

   msgid ""
msgstr ""
"Project-Id-Version: Pieter Goosen v1.0\n"
"POT-Creation-Date: 2014-02-03 19:25+0200\n"
"PO-Revision-Date: 2014-02-03 21:32+0200\n"
"Last-Translator: Pieter Goosen <goosen_p@yahoo.com>\n"
"Language-Team: Private <goosen_p@yahoo.com>\n"
"Language: af\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-KeywordsList: gettext;gettext_noop;__;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: ..\n"

#: ../404.php:17
msgid "Not Found"
msgstr "Niks gevind"

Here is the header for my pietergoosen.pot and the first string

 msgid ""
msgstr ""
"Project-Id-Version: Pieter Goosen v1.0\n"
"POT-Creation-Date: 2014-02-03 19:19+0200\n"
"PO-Revision-Date: 2014-02-03 19:22+0200\n"
"Last-Translator: Pieter Goosen <goosen_p@yahoo.com>\n"
"Language-Team: Private <goosen_p@yahoo.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-KeywordsList: gettext;gettext_noop;__;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"Language: English\n"
"X-Poedit-SourceCharset: UTF-8\n"

#: ../404.php:17
msgid "Not Found"
msgstr ""
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Found my solution here

in the following line after hours of researching for an answer. This little line is one thing that is left out by all tutorials and most answers

Remember that your filenames have to be fr_FR.po & fr_FR.mo (depending on your language) and not domain-fr_FR.xx like the plugins do.

So I just changed the po and mo filenames accordingly

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.