Filters MO file path for loading translations for a specific text domain.
Filtre le chemin d'accès au fichier MO pour le chargement des traductions pour un domaine textuel spécifique.
$mofile, $domain
Sortie :
@param string $mofile Path to the MO file. @param string $domain Text domain. Unique identifier for retrieving translated strings.
add_filter('load_textdomain_mofile', 'custom_translation_file', 10, 2);
function custom_translation_file($mofile, $domain) {
if ($domain === 'my-plugin') {
$custom = WP_PLUGIN_DIR . '/my-plugin/languages/custom-' . basename($mofile);
if (file_exists($custom)) return $custom;
}
return $mofile;
}
Chargement des actualités...