* 获取翻译页面
()
| 80 | * 获取翻译页面 |
| 81 | */ |
| 82 | function getPage() { |
| 83 | // 先匹配 body 的 class |
| 84 | var page = document.body.className.match(I18N.conf.rePageClass); |
| 85 | |
| 86 | if (!page) { // 扩展 pathname 匹配 |
| 87 | page = location.pathname.match(I18N.conf.rePagePath); |
| 88 | } |
| 89 | |
| 90 | if (!page) { // 扩展 url 匹配 |
| 91 | page = location.href.match(I18N.conf.rePageUrl); |
| 92 | } |
| 93 | |
| 94 | return page ? page[1] : false; // 取页面 key |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * 翻译页面标题 |