Skip to content

Commit

Permalink
[zh_CN] change folder back to zh, but keep language as zh_CN
Browse files Browse the repository at this point in the history
  • Loading branch information
blackpuppy committed Sep 21, 2014
1 parent ae85605 commit 72c5bd2
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ES_HOST =
.PHONY: all clean html latexpdf epub htmlhelp website website-dirs

# Languages that can be built.
LANGS = en es fr ja pt ru ro sr zh_CN
LANGS = en es fr ja pt ru ro sr zh

# pdflatex does not like ja or ru for some reason.
PDF_LANGS = en es fr pt ro
Expand Down
14 changes: 12 additions & 2 deletions config/cakei18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ def lang_link(lang, path):
dots = []
for p in path.split(SEP):
dots.append('..')
return SEP.join(dots) + SEP + lang + SEP + path + app.builder.link_suffix
tokens = lang.split('_')
if len(tokens) > 1:
folder = tokens[0]
else:
folder = lang
return SEP.join(dots) + SEP + folder + SEP + path + app.builder.link_suffix

def has_lang(lang, path):
"""
Check to see if a language file exists for a given path/RST doc.:
"""
possible = '..' + SEP + lang + SEP + path + app.config.source_suffix
tokens = lang.split('_')
if len(tokens) > 1:
folder = tokens[0]
else:
folder = lang
possible = '..' + SEP + folder + SEP + path + app.config.source_suffix
full_path = os.path.realpath(os.path.join(os.getcwd(), possible))

return os.path.isfile(full_path)
Expand Down
2 changes: 1 addition & 1 deletion zh_CN/Makefile → zh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../build
PYTHON = python
LANG = zh_CN
LANG = zh

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion zh_CN/index.rst → zh/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CakePHP CookBook 是一个公开地开发和社区可以编辑的文档项目。
您几乎可以在任何地方阅读本书,当前提供的格式有 PDF 和 EPUB,您可以在更多设备上阅读它,也可以(把它下载下来)离线阅读。

- `PDF <../_downloads/en/CakePHPCookbook.pdf>`_
- `EPUB <../_downloads/zh_CN/CakePHPCookbook.epub>`_
- `EPUB <../_downloads/zh/CakePHPCookbook.epub>`_
- `原文出处 <http://github.com/cakephp/docs>`_

入门指南
Expand Down
File renamed without changes.

0 comments on commit 72c5bd2

Please sign in to comment.