-
Notifications
You must be signed in to change notification settings - Fork 4.3k
i18n: externalize strings in discussion forums templates and python code... #2169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,7 +131,7 @@ def inline_discussion(request, course_id, discussion_id): | |
| cohorts_list = list() | ||
|
|
||
| if is_cohorted: | ||
| cohorts_list.append({'name': 'All Groups', 'id': None}) | ||
| cohorts_list.append({'name': _('All Groups'), 'id': None}) | ||
|
|
||
| #if you're a mod, send all cohorts and let you pick | ||
|
|
||
|
|
@@ -309,7 +309,7 @@ def single_thread(request, course_id, discussion_id, thread_id): | |
| 'cohorted_commentables': cohorted_commentables | ||
| } | ||
|
|
||
| return render_to_response('discussion/single_thread.html', context) | ||
| return render_to_response('discussion/index.html', context) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't an i18n change. I'll assume it's no big deal?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, the reason it's here is b/c the two html files were essentially identical, so it made more sense to drop one of them than externalize its messages. |
||
|
|
||
|
|
||
| @login_required | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,10 +36,10 @@ | |
| <div class="right-column"> | ||
| <div class="form-row"> | ||
| <label class="sr" for="new-inline-post-title">${_("new post title")}</label> | ||
| <input type="text" id="new-inline-post-title" class="new-post-title" name="title" placeholder="Title"> | ||
| <input type="text" id="new-inline-post-title" class="new-post-title" name="title" placeholder="${_('Title')}"> | ||
| </div> | ||
| <div class="form-row"> | ||
| <div class="new-post-body" name="body" placeholder="Enter your question or comment…"></div> | ||
| <div class="new-post-body" name="body" placeholder="${_(u'Enter your question or comment…')}"></div> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the ellipsis character means the file needs a coding comment
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that's true for Mako templates? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I was thinking this was Python code (because it sort of is). Mako does require that the encoding be specified but allows it to be done in the template call, which we do, so no encoding is necessary here. |
||
| <!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>--> | ||
| </div> | ||
| <input type="submit" id="new-inline-post-submit" class="submit" value="${_("Add post")}"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ | |
| <div class="topic_menu_wrapper"> | ||
| <div class="topic_menu_search" role="menu"> | ||
| <label class="sr" for="browse-topic-newpost">${_("Filter List")}</label> | ||
| <input type="text" id="browse-topic-newpost" class="form-topic-drop-search-input" placeholder="Filter discussion areas"> | ||
| <input type="text" id="browse-topic-newpost" class="form-topic-drop-search-input" placeholder="${_("Filter discussion areas")}"> | ||
| </div> | ||
| <ul class="topic_menu" role="menu"> | ||
| ${render_form_filter_dropdown(category_map)} | ||
|
|
@@ -67,10 +67,10 @@ | |
| <ul class="new-post-form-errors"></ul> | ||
| <div class="form-row"> | ||
| <label class="sr" for="new-post-title">${_("new post title")}</label> | ||
| <input type="text" id="new-post-title" class="new-post-title" name="title" placeholder="Title"> | ||
| <input type="text" id="new-post-title" class="new-post-title" name="title" placeholder="${_("Title")}"> | ||
| </div> | ||
| <div class="form-row"> | ||
| <div class="new-post-body" name="body" placeholder="Enter your question or comment…"></div> | ||
| <div class="new-post-body" name="body" placeholder="${_(u"Enter your question or comment…")}"></div> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||
| <!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>--> | ||
| </div> | ||
| <input type="submit" id="new-post-submit" class="submit" value="${_("Add post")}"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,10 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%! from django_comment_client.helpers import pluralize %> | ||
| <%! from django_comment_client.permissions import has_permission, check_permissions_by_view %> | ||
| <%! from operator import attrgetter %> | ||
|
|
||
|
|
||
| <%! from django.utils.translation import ugettext as _, ungettext %> | ||
| <%def name="span(num)"><span>${num}</span></%def> | ||
| <div class="user-profile"> | ||
| <% | ||
| role_names = sorted(set(map(attrgetter('name'), django_user.roles.all()))) | ||
| %> | ||
| <div class="sidebar-username">${django_user.username | h}</div> | ||
| <div class="sidebar-user-roles"> | ||
| ${", ".join(role_names)} | ||
| ${_(', ').join(sorted(set(map(_, [role.name for role in django_user.roles.all()]))))} | ||
| </div> | ||
| <div class="sidebar-threads-count"><span>${profiled_user['threads_count'] | h}</span> ${pluralize('discussion', profiled_user['threads_count']) | h} started</div> | ||
| <div class="sidebar-comments-count"><span>${profiled_user['comments_count'] | h}</span> ${pluralize('comment', profiled_user['comments_count']) | h}</div> | ||
| <div class="sidebar-threads-count">${ungettext('%s discussion started', '%s discussions started', profiled_user['threads_count']) % span(profiled_user['threads_count']) | h}</div> | ||
| <div class="sidebar-comments-count">${ungettext('%s comment', '%s comments', profiled_user['comments_count']) % span(profiled_user['comments_count']) | h}</div> | ||
| </div> |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this message shown to users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theoretically yes, JsonError messages may be shown to users. The trigger for seeing this particular error would be a weird configuration mistake on the server admin's part, but it seems worth extracting strings consistently for our immediate purposes.