Created
June 3, 2012 07:20
-
-
Save miya0001/2862420 to your computer and use it in GitHub Desktop.
load_textdomain_mofileフックで翻訳ファイルのパスを変えてテキストを変更する。(たとえば関西弁にするとか。笑)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('load_textdomain_mofile', 'kansaiben', false, 2); | |
function kansaiben($mo, $domain){ | |
$lang = dirname(__FILE__).'/langs/'.basename($mo); | |
if (is_file($lang)) { | |
return $lang; | |
} else { | |
return $mo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment