我有一个字符串,可以用两种不同的方式在我的代码的varius部分进行翻译.
现在如果使用django-admin makemessages -l it
我进入django.po这个:
#: pingapi/ping.py:17 pingapi/nots.py:10
msgid "may"
msgstr "maggio"
Run Code Online (Sandbox Code Playgroud)
但我想要两种不同的翻译:
#: pingapi/ping.py:17
msgid "may"
msgstr "posso"
#: pingapi/nots.py:10
msgid "may"
msgstr "maggio"
Run Code Online (Sandbox Code Playgroud)
如果我运行django-admin compilemessage并发布翻译文件,我会得到:
Error: errors happened while running msgmerge
error 'duplicate message definition'
Run Code Online (Sandbox Code Playgroud)
任何提示?我正在使用Django.
哪个是将{{STATIC_URL}}传递给javascript文件的最佳解决方案?
我正在使用django和python.
提前致谢.问候.
我正在使用https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/?from=olddocs.
我有一个从api.mydomain.me为域生成的站点地图:mydomain.com.
我可以用django指定一个基本网址吗?
现在用location()方法返回:
api.mydomain.me/page/3123而不是mydomain.com/page/3123
这可能吗?谢谢.
我有这个问题:
No module named _imagingft
Run Code Online (Sandbox Code Playgroud)
我已经安装了PIL,但它仍然无法正常工作.我使用OSX.
我正在尝试为Django Simple Captcha安装这个模块.
我正在尝试反向代理一个内部有 N 重定向 301 的 URL。
\n我想跟踪所有页面,然后反向代理最后一个页面(fourth-url.php)。
Nginx 有双重功能吗?
\n\n这是场景
\n\n第一个网址:
\n\nhttp://first-domain.com/first-url.php
\n\n重定向至
\n\nhttp://first-domain.com/second-url.php
\n\n重定向至
\n\nhttp://first-domain.com/third-url.php
\n\n重定向至(最后一个)
\n\nhttp://first-domain.com/fourth-url.php
\n\n这是我到目前为止所做的文件配置:
\n\nserver {\n\n set $base_url \'http://first-domain.com\';\n set $page \'first-url.php\'\n\n location /myserver {\n resolver 8.8.8.8;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $remote_addr;\n proxy_set_header Host $host;\n proxy_pass $base_url/$page;\n proxy_intercept_errors on;\n error_page 301 302 307 = @handle_redirect;\n }\n\n location @handle_redirect {\n resolver 8.8.8.8;\n set $saved_redirect_location $upstream_http_location;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $remote_addr;\n proxy_set_header Host …Run Code Online (Sandbox Code Playgroud) 我有这个问题:当我在我的django应用程序中设置语言(它或en)时,使用此表单,javascript字符串将始终以英语转换.我的基础语言是意大利语.
这是我的配置:urls.py:
js_info_dict = {'domain':'djangojs','packages':('myproject',),}
urlpatterns + = patterns('',(r'^ jsi18n/$','django.views.i18n.javascript_catalog',js_info_dict),)
我运行了这个命令:
django-admin.py makemessages -d djangojs -l en
生成djangojs.mo/po文件.我已将其中的字符串翻译为该文件中的en.我跑了:
django-admin.py compilemessages
现在,当我进入包含此JS的页面时:
document.write(gettext('Questastringaèdatradurre'));
字符串总是返回'此字符串将被翻译',(这是'Questastringaèdatradurre'的翻译)
我在我的html文件中包含了这个js:
<script type ="text/javascript"src ="{%url django.views.i18n.javascript_catalog%}"> </ script>
我哪里错了?有任何想法吗?提前致谢.
我的应用程序中没有显示splashscreen,这是我的config.xml中有关splashscreen的部分,位于根目录中:
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
</feature>
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
</feature>
<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="10000" />
<gap:splash gap:density="ldpi" gap:platform="android" src="res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:density="mdpi" gap:platform="android" src="res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:density="hdpi" gap:platform="android" src="res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:density="xhdpi" gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />
Run Code Online (Sandbox Code Playgroud)
这是正确安装的插件:
smartbox:yo du$ phonegap local plugin list | grep splash
[phonegap] org.apache.cordova.splashscreen
Run Code Online (Sandbox Code Playgroud)
这些是文件: …
我想安装一个没有PIP的django-app.
我正在使用带有django的virtualenv.
该应用程序是这样的:https://github.com/garmoncheg/django_multiuploader
这不支持PIP.
提前致谢.问候.
django ×6
javascript ×2
python ×2
cordova ×1
django-apps ×1
dns ×1
heroku ×1
nginx ×1
redirect ×1
sitemap ×1
static ×1
translation ×1
virtualenv ×1