I made a custom theme named testTheme
having these files:
And I wanted to put some translation on it therefore I created the required .po and .mo files for greek language via poedit as seen in the following image:
But I cannot make it load the custom translations I created via poedit. Do you have any idea how I will load them?
Edit 1
The functions.php
as asked:
<?php
if(!function_exists('loadThemerequirements')):
function loadThemerequirements()
{
load_theme_textdomain( 'testTheme', get_template_directory() . '/languages' );
}
endif;
add_action( 'after_setup_theme', 'loadThemerequirements' );
Update1
The translations files were moved and renamed like that:
Still Same result.
Edit 2:
This is not a child theme but a from-scratch made one.
Edit 3:
I tried renaming the .po and .mo files as el_GR.po
and el_GR.mo
still same result. I also tried to rename them in to testTheme/el_GR.po
and testTheme/el_GR.mo
without any success.
Update 2
The theme is in this git repository: https://github.com/pc-magas/testTheme
Edit 1
I changed my 404 page (that has some text to be translated into greek) like that:
<?php
get_header();
?>
<div class="fullpage_center">
<div>
<h1>404</h1>
<p><?php _e('The requested page does not exist.','testTheme');?></p>
</div>
</div>
<?php
wp_reset_query(); //resetting the page query
get_footer();
?>
A sample of my page and the translated text is:
As you can see still no result.
functions.php
to load the translationstestTheme-el
totestTheme-el_GR
2. set your textdomain in_e
or__
functions