dongyushen9063 2015-05-26 15:44
浏览 86
已采纳

从WordPress删除.po和.mo文件?

I have several themes that contain .mo and .po files for translations.

The only reference to these files in the code is similar to this:

load_theme_textdomain('ThemeName',$template_dir.'/lang');

Would it be safe to delete the lang directory from these themes if I don't need to translate the theme for any reason? There are language files for English (en_US), but it doesn't look like they are actually used by the themes since the text is directly in the PHP files...

Sorry if this is a dumb question, I'm just not really sure how these files work with WordPress.

  • 写回答

2条回答 默认 最新

  • douji9184 2015-05-26 16:03
    关注

    In your code you will see commands like

    __('Some text','Themename');
    _e('Some text','Themename');
    

    If you set WP_LANG to "de_DE" in case you are in Germany, your WordPress installation will look for the file Themename-de_DE.mo in the /lang folder to find a translation.

    If you remove the files/folder I would also remove the load_theme_textdomain('ThemeName',$template_dir.'/lang'); command. The files can all be removed but as mentioned in the comments, they will return on update.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置