我正在尝试在 Ubuntu 上设置 Pootle 翻译服务。不幸的是,我只能运行 Pootle 服务器。
我已经手动安装了所有必需的软件包(pootle、translate-toolkit 和其他软件包)。然后,如果我从安装目录运行 ./PootleServer,它就可以完美运行。
/usr/src/Pootle-2.1.5# ./PootleServer
Starting server, listening on port 8080.
2011-03-14 21:53:56,001 INFO Starting Django server, listening on port 8080
但是当我尝试使用“PootleServer”命令运行 PootleServer 时,我收到以下错误。显然 Pootle 需要 /usr/share/pootle 目录存在,但实际上不存在。/usr/share/pootle 丢失了。您知道原因吗?
/usr/src/Pootle-2.1.5# PootleServer
Starting server, listening on port 8080.
Traceback (most recent call last):
File "/usr/local/bin/PootleServer", line 32, in <module>
PootleServer.main()
File "/usr/local/lib/python2.6/dist-packages/pootle/PootleServer.py", line 103, in main
run_pootle(options, args)
File "/usr/local/lib/python2.6/dist-packages/pootle/PootleServer.py", line 87, in run_pootle
handler = AdminMediaHandler(WSGIHandler(), path)
File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 652, in __init__
self.media_url = settings.ADMIN_MEDIA_PREFIX
File "/usr/local/lib/python2.6/dist-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 40, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 73, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.6/dist-packages/pootle/settings.py", line 200, in <module>
LANGUAGES = override.find_languages(LOCALE_PATHS[0])
File "/usr/local/lib/python2.6/dist-packages/pootle/i18n/override.py", line 38, in find_languages
dirs = os.listdir(locale_path)
OSError: [Errno 2] No such file or directory: '/usr/share/pootle/mo'
我无法解决此错误。请帮助我正确设置 PootleServer。
已安装的软件
/usr/src/Pootle-2.1.5# PootleServer --version
Pootle 2.1.5
Translate Toolkit 1.8.1
Django 1.2.5
Ubuntu 9.04
答案1
我猜mo
你缺少的目录与mo
引用的目录相同这里,这表明setup.py
有一个build_mo
命令。
话虽如此,pootle 的其余部分似乎是使用 PREFIX 安装的/usr/local
,因此 mo 目录很可能位于类似的某个地方/usr/local/share/pootle/mo
,您需要跟踪配置并修复它,或者如果没有配置,则对项目提交错误报告以遵守安装 PREFIX(如果您安装在默认位置以外的其他位置(并将文件夹移动到/usr/share
)。