i18n fixes for wiki templates.
This commit is contained in:
@@ -6,6 +6,8 @@ from django.conf import settings
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.shortcuts import redirect
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from wiki.core.exceptions import NoRootURL
|
||||
from wiki.models import URLPath, Article
|
||||
|
||||
@@ -79,12 +81,19 @@ def course_wiki_redirect(request, course_id):
|
||||
# recerate it.
|
||||
urlpath.delete()
|
||||
|
||||
content = cgi.escape(
|
||||
# Translators: this string includes wiki markup. Leave the ** and the _ alone.
|
||||
_("This is the wiki for **{organization}**'s _{course_name}_.").format(
|
||||
organization=course.display_org_with_default,
|
||||
course_name=course.display_name_with_default,
|
||||
)
|
||||
)
|
||||
urlpath = URLPath.create_article(
|
||||
root,
|
||||
course_slug,
|
||||
title=course_slug,
|
||||
content=cgi.escape(u"This is the wiki for **{0}**'s _{1}_.".format(course.display_org_with_default, course.display_name_with_default)),
|
||||
user_message="Course page automatically created.",
|
||||
content=content,
|
||||
user_message=_("Course page automatically created."),
|
||||
user=None,
|
||||
ip_address=None,
|
||||
article_kwargs={'owner': None,
|
||||
@@ -112,12 +121,12 @@ def get_or_create_root():
|
||||
pass
|
||||
|
||||
starting_content = "\n".join((
|
||||
"Welcome to the edX Wiki",
|
||||
"===",
|
||||
"Visit a course wiki to add an article."))
|
||||
_("Welcome to the edX Wiki"),
|
||||
"===",
|
||||
_("Visit a course wiki to add an article."),
|
||||
))
|
||||
|
||||
root = URLPath.create_root(title="Wiki",
|
||||
content=starting_content)
|
||||
root = URLPath.create_root(title=_("Wiki"), content=starting_content)
|
||||
article = root.article
|
||||
article.group = None
|
||||
article.group_read = True
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "main_django.html" %}
|
||||
{% load compressed %}{% load sekizai_tags i18n microsite %}{% load url from future %}{% load staticfiles %}
|
||||
|
||||
{% block title %}<title>{% block pagetitle %}{% endblock %} | Wiki | {% platform_name %}</title>{% endblock %}
|
||||
{% block title %}<title>{% block pagetitle %}{% endblock %} | {% trans "Wiki" %} | {% platform_name %}</title>{% endblock %}
|
||||
|
||||
{% block headextra %}
|
||||
{% compressed_css 'course' %}
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
{% elif revision.automatic_log %}
|
||||
{{ revision.automatic_log }}
|
||||
{% else %}
|
||||
({% trans "no log message" %})
|
||||
{% trans "(no log message)" %}
|
||||
{% endif %}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<li class="${"active" if selected_tab == "view" else ""}">
|
||||
<a href="${reverse('wiki:get', kwargs={'article_id' : article.id, 'path' : urlpath.path})}">
|
||||
<span class="icon-home icon"></span>
|
||||
View
|
||||
${_("{span_start}active{span_end}").format(span_start="<span class='sr'>(", span_end=")</span>") if selected_tab == "view" else ""}
|
||||
${_("View")}
|
||||
${_("{span_start}(active){span_end}").format(span_start="<span class='sr'>", span_end="</span>") if selected_tab == "view" else ""}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<li class="${"active" if selected_tab == "edit" else ""}">
|
||||
<a href="${reverse('wiki:edit', kwargs={'article_id' : article.id, 'path' : urlpath.path})}">
|
||||
<span class="icon-edit icon"></span>
|
||||
Edit
|
||||
${_("{span_start}active{span_end}").format(span_start="<span class='sr'>(", span_end=")</span>") if selected_tab == "edit" else ""}
|
||||
${_("Edit")}
|
||||
${_("{span_start}(active){span_end}").format(span_start="<span class='sr'>", span_end="</span>") if selected_tab == "edit" else ""}
|
||||
</a>
|
||||
</li>
|
||||
%endif
|
||||
@@ -26,8 +26,8 @@
|
||||
<li class="${"active" if selected_tab == "history" else ""}">
|
||||
<a href="${reverse('wiki:history', kwargs={'article_id' : article.id, 'path' : urlpath.path})}">
|
||||
<span class="icon-changes icon"></span>
|
||||
Changes
|
||||
${_("{span_start}active{span_end}").format(span_start="<span class='sr'>(", span_end=")</span>") if selected_tab == "history" else ""}
|
||||
${_("Changes")}
|
||||
${_("{span_start}(active){span_end}").format(span_start="<span class='sr'>", span_end="</span>") if selected_tab == "history" else ""}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<a href="${reverse('wiki:plugin', kwargs={'slug' : plugin.slug, 'article_id' : article.id, 'path' : urlpath.path}) }">
|
||||
<span class="${plugin.article_tab[1]} icon"></span>
|
||||
${plugin.article_tab[0]}
|
||||
${_("{span_start}active{span_end}").format(span_start="<span class='sr'>(", span_end=")</span>") if selected_tab == plugin.slug else ""}
|
||||
${_("{span_start}(active){span_end}").format(span_start="<span class='sr'>", span_end="</span>") if selected_tab == plugin.slug else ""}
|
||||
</a>
|
||||
</li>
|
||||
%endif
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
## mako
|
||||
<%! from django.core.urlresolvers import reverse %>
|
||||
<%!
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
%>
|
||||
|
||||
%if urlpath is not Undefined and urlpath:
|
||||
<header>
|
||||
@@ -29,7 +32,7 @@
|
||||
%if create_article_root:
|
||||
<a class="add-article-btn btn pull-left" href="${reverse('wiki:create', kwargs={'path' : create_article_root.path})}" style="padding: 7px;">
|
||||
<span class="icon-plus"></span>
|
||||
Add article
|
||||
${_("Add article")}
|
||||
</a>
|
||||
%endif
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{# Translators: Do not translate "edX" #}
|
||||
<h3>{% trans "edX Additions:" %}</h3>
|
||||
<pre>circuit-schematic:</pre>
|
||||
<pre>$LaTeX Math Expression$</pre>
|
||||
<pre>$LaTeX {% trans "Math Expression" %}$</pre>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<h3>{% trans "Useful examples:" %}</h3>
|
||||
<pre>
|
||||
http://wikipedia.org
|
||||
[Wikipedia](http://wikipedia.org)
|
||||
[edX Wiki](wiki:/edx/)
|
||||
[{% trans "Wikipedia" %}](http://wikipedia.org)
|
||||
[{% trans "edX Wiki" %}](wiki:/edx/)
|
||||
</pre>
|
||||
<pre>
|
||||
{% trans "Huge Header" %}
|
||||
|
||||
@@ -10,17 +10,18 @@
|
||||
<div class="main-article">
|
||||
{% if revision %}
|
||||
<div class="alert alert-info">
|
||||
<strong>{% trans "Previewing revision" %}:</strong>
|
||||
<strong>{% trans "Previewing revision:" %}</strong>
|
||||
{% include "wiki/includes/revision_info.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if merge %}
|
||||
<div class="alert alert-info">
|
||||
<strong>{% trans "Previewing merge between" %}:</strong>
|
||||
{% include "wiki/includes/revision_info.html" with revision=merge1 %}
|
||||
<strong>{% trans "and" %}</strong>
|
||||
{% include "wiki/includes/revision_info.html" with revision=merge2 %}
|
||||
<strong>{% trans "Previewing a merge between two revisions:" %}</strong>
|
||||
<ol>
|
||||
<li>{% include "wiki/includes/revision_info.html" with revision=merge1 %}</li>
|
||||
<li>{% include "wiki/includes/revision_info.html" with revision=merge2 %}</li>
|
||||
</ol>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user