小编And*_*eOn的帖子

Github-Pages 上的多语言

很长一段时间我没有访问我的页面http://andeon.github.io/askey/apps/gimp/所以,昨天我检查了翻译对键盘页面不起作用,github-pages 上有更新吗?

存储库结构:github.com/andeon/askey/tree/gh-pages

- |-- _includes/      # Html rendered 
- |-- _layouts/       # Templates of the website
-   |--  dic/         # keyboards translation
- |-- index.html      # Default html file (EN)
- |-- pt              # Portuguese Language files
- |-- (...)
- |-- _config.yml     # Jekyll configuration file
Run Code Online (Sandbox Code Playgroud)

文件“_includes/gimp_keyboard.html”使用变量page.t[page.lang].($variable)来链接“dic/gimp_en.md”或“dic/gimp_pt.md”等中的翻译,这就是翻译键和弹出窗口的工具提示。

Gimp_en.yml 的结构:

layout: main_gimp
t:
 en:
  tooltip_esc: "Close Dialogs"
  tooltip_f1: "Help"
Run Code Online (Sandbox Code Playgroud)

例如:gimp_keyboard.html Esc 键工具提示:

<a href="#popup_esc" class="key c27 fn" data-tooltip="{{ page.t[page.lang].tooltip_esc }}"><span>esc</span>

和弹出键 w

<div id="popup_w" class="overlay"> …

github jekyll github-pages

5
推荐指数
1
解决办法
1859
查看次数

标签 统计

github ×1

github-pages ×1

jekyll ×1