我想你可以把语言文件夹移到/wp-content/languages/
然后阻止主题更新主题的翻译。然后您可以添加自己的小插件来更改load_theme_textdomain
wp内容中新文件夹的路径:
将此作为插件添加到/wp-content/plugins/buttercream-lang.php中
/**
* Plugin Name: Buttercream Custom Language
* Plugin URI: https://github.com/pontusab/buttercream-custom-language
* Text Domain: buttercream
* Domain Path: /wp-content/languages/
* Description: Add your own languages to Buttercream without losing when update.
* Author: Pontus Abrahamsson <[email protected]>
* Author URI: http://pontusab.se
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
add_action( \'after_setup_theme\', \'wpse_load_languages\' );
function wpse_load_languages()
{
load_theme_textdomain( \'buttercream\', WP_CONTENT_DIR . \'/languages\' );
}