Comments (8)
除了 jinja 的那個插件還需要 pelican 的 i18n-subsites 插件配合。
嘛不用的話,大概所有模板都要稍微改改,因爲所有文本都是可翻譯的……
不過好在要改的地方都有明確記錄:
https://github.com/farseerfc/pelican-bootstrap3/blob/master/translations/zh_CN/LC_MESSAGES/messages.po
照這裏改,需要改每個翻譯記錄,行號在文件名後面,把用 gettext 的地方都改成直接寫簡體中文的就可以了。
from farseerfc.
嗯是我的 fork 的 https://github.com/farseerfc/pelican-bootstrap3 。
要注意同時我有 fork 一堆插件 https://github.com/farseerfc/pelican-plugins ,配置文件也公開在這個 repo 裏了,用到了這些插件 https://github.com/farseerfc/farseerfc/blob/master/pelicanconf.py#L81 。寫的時候沒怎麼考慮兼容別的插件,或者沒考慮插件不在的情況,所以可能需要調整一下各種細節。
如果你用的時候遇到什麼報錯,把報錯貼過來,我可以看看問題在哪兒。
from farseerfc.
谢谢,我再试试。我写文章用的markdown,不是.rst,需要更改插件吗?
from farseerfc.
我用的大部分插件都是和 rst 無關的,"plantuml", "youku", "youtube", 'twitter_bootstrap_rst_directives' 這幾個可能是 rst 相關的。
from farseerfc.
CRITICAL: UndefinedError: 'gettext' is undefined
gettext在哪里?
from farseerfc.
jinja 的 i18n 插件 https://farseerfc.me/redesign-pelican-theme.html#id51
配置裏寫這個:
https://github.com/farseerfc/farseerfc/blob/master/pelicanconf.py#L111
from farseerfc.
我不需要翻译功能,只要简体中文就可以了,去掉i18n插件,需要改的文件多吗,除了base.html还有什么吗
from farseerfc.
我之前加了JINJA_EXTENSIONS = ['jinja2.ext.i18n']这行也报同样的错误
from farseerfc.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from farseerfc.