在 v1.4.1 中,虽然修复了法语页面内容为空的问题,但仍然存在以下问题:
- Downloads 页面没有自动创建中文和法语版本
- Investor Relations 页面没有自动创建中文和法语版本
- 导致中文和法语菜单缺少对应的菜单项
在 inc/multilingual-content.php 的 rena_translate_pages() 函数中,$pages_to_translate 数组的键使用了错误的语言:
$pages_to_translate = [
'Home' => [...],
'Research' => [...],
'Téléchargements' => [ // ❌ 错误:应该使用英文 'Downloads'
'zh' => '下载',
'fr' => 'Téléchargements',
],
// ...
'Relations investisseurs' => [ // ❌ 错误:应该使用英文 'Investor Relations'
'zh' => '投资者关系',
'fr' => 'Relations investisseurs',
],
// ...
'Forgot Password' => [
'zh' => '忘记密码',
'fr' => 'Passwort vergessen', // ❌ 错误:这是德语,应该是法语
],
'My Profile' => [
'zh' => '我的资料',
'fr' => 'Mein Profil', // ❌ 错误:这是德语,应该是法语
],
];get_page_by_title($en_title) 函数根据英文页面标题来查找页面。因此:
- ✅
'Home'→ 能找到英文页面 "Home" - ✅
'Research'→ 能找到英文页面 "Research" - ❌
'Téléchargements'→ 找不到(因为英文页面标题是 "Downloads") - ❌
'Relations investisseurs'→ 找不到(因为英文页面标题是 "Investor Relations")
inc/multilingual-content.php
$pages_to_translate = [
'Home' => [
'zh' => '首页',
'fr' => 'Accueil',
],
'Research' => [
'zh' => '研究',
'fr' => 'Recherche',
],
'Downloads' => [ // ✅ 修复:使用英文标题
'zh' => '下载',
'fr' => 'Téléchargements',
],
'Contact Information' => [
'zh' => '联系信息',
'fr' => 'Informations de contact',
],
'Risk Warning' => [
'zh' => '风险警告',
'fr' => 'Avertissement sur les risques',
],
'Privacy Policy' => [
'zh' => '隐私政策',
'fr' => 'Politique de confidentialité',
],
'Investor Relations' => [ // ✅ 修复:使用英文标题
'zh' => '投资者关系',
'fr' => 'Relations investisseurs',
],
'Member' => [
'zh' => '会员',
'fr' => 'Membre',
],
'Register' => [
'zh' => '注册',
'fr' => 'Inscription',
],
'Forgot Password' => [
'zh' => '忘记密码',
'fr' => 'Mot de passe oublié', // ✅ 修复:改为法语
],
'My Profile' => [
'zh' => '我的资料',
'fr' => 'Mon profil', // ✅ 修复:改为法语
],
];'Téléchargements'→'Downloads''Relations investisseurs'→'Investor Relations'
'Passwort vergessen'→'Mot de passe oublié'(德语 → 法语)'Mein Profil'→'Mon profil'(德语 → 法语)
- 4 处修复
重要:必须清空数据并重新激活!
# 在 WordPress 后台
1. 删除所有页面
2. 删除所有菜单
3. 停用主题
4. 上传 v1.4.2
5. 激活主题检查后台 → 页面:
- Home
- Research
- Downloads ✅
- Contact Information
- Risk Warning
- Privacy Policy
- Investor Relations ✅
- Member
- Register
- Forgot Password
- My Profile
- 首页
- 研究
- 下载 ✅(新增)
- 联系信息
- 风险警告
- 隐私政策
- 投资者关系 ✅(新增)
- 会员
- 注册
- 忘记密码
- 我的资料
- Accueil
- Recherche
- Téléchargements ✅(新增)
- Informations de contact
- Avertissement sur les risques
- Politique de confidentialité
- Relations investisseurs ✅(新增)
- Membre
- Inscription
- Mot de passe oublié ✅(修复翻译)
- Mon profil ✅(修复翻译)
检查后台 → 外观 → 菜单:
- Home
- Research
- Downloads ✅
- Member
- 首页
- 研究
- 下载 ✅(新增)
- 会员
- Accueil
- Recherche
- Téléchargements ✅(新增)
- Membre
- Privacy Policy
- Risk Warning
- Contact Information
- Investor Relations ✅
- 隐私政策
- 风险警告
- 联系我们
- 投资者关系 ✅(新增)
- Politique de confidentialité
- Avertissement sur les risques
- Informations de contact
- Relations investisseurs ✅(新增)
- 顶部菜单:Home, Research, Downloads ✅, Member
- 页脚菜单:Privacy Policy, Risk Warning, Contact Information, Investor Relations ✅
- Downloads 页面有完整内容
- Investor Relations 页面有完整内容
- 顶部菜单:首页, 研究, 下载 ✅, 会员
- 页脚菜单:隐私政策, 风险警告, 联系我们, 投资者关系 ✅
- 下载页面有完整内容
- 投资者关系页面有完整内容
- 顶部菜单:Accueil, Recherche, Téléchargements ✅, Membre
- 页脚菜单:Politique de confidentialité, Avertissement sur les risques, Informations de contact, Relations investisseurs ✅
- Téléchargements 页面有完整内容
- Relations investisseurs 页面有完整内容
- ✅ Downloads 页面翻译(中文、法语)
- ✅ Investor Relations 页面翻译(中文、法语)
- ✅ Forgot Password 页面法语翻译
- ✅ My Profile 页面法语翻译
- ✅ 主导航菜单(中文、法语)
- ✅ 页脚菜单(中文、法语)
- ✅ 英语内容(完全正常)
- ✅ 其他页面翻译(完全正常)
- ✅ 翻译文件(fr_FR.po/mo)
- ✅ Elementor 预设数据
- 版本号:v1.4.1 → v1.4.2
- 发布日期:2025-10-26
- 修复类型:紧急修复(Hotfix)
- 严重程度:中(导致部分页面和菜单项缺失)
重要:必须清空数据并重新激活主题!
原因:v1.4.1 没有创建 Downloads 和 Investor Relations 的翻译页面,需要重新创建。
步骤:
- 备份数据库(如果有重要数据)
- 删除所有页面
- 删除所有菜单
- 停用主题
- 上传 v1.4.2
- 激活主题
- 手动绑定菜单(参考
MENU-SETUP-GUIDE.md)
- 问题:
$de_*变量名和_de()函数调用未替换 - 影响:法语页面内容为空
- 修复:替换所有变量名和函数调用
- 问题:
$pages_to_translate数组键使用了错误的语言 - 影响:Downloads 和 Investor Relations 页面未翻译
- 修复:将键改为英文页面标题
在德语→法语迁移过程中,需要注意:
- ✅ 翻译文件(.po/.mo)
- ✅ HTML 文件
- ✅ Elementor 预设数据函数
- ✅ 变量名(
$de_*→$fr_*) - ✅ 函数调用(
_de()→_fr()) - ✅ 配置数组的键(必须使用英文)← 本次修复
- ✅ 翻译值中的德语残留(如 "Passwort vergessen")← 本次修复
版本:v1.4.2
发布日期:2025-10-26
状态:✅ 已修复并验证