Skip to content

Commit

Permalink
Hard-coded strings are replaced with i18n strings in the main applica…
Browse files Browse the repository at this point in the history
…tion layout, RevisionList and CourseCreator.
  • Loading branch information
Cinnamy authored and ragesoss committed Nov 3, 2015
1 parent d19e601 commit 4e01812
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CourseCreator = React.createClass(
required=true
validation={/^[\w\-\s\,\']+$/}
editable=true
label='Course title'
label={I18n.t('course_creator.course_title')}
placeholder='Title'
/>
<TextInput
Expand All @@ -128,7 +128,7 @@ CourseCreator = React.createClass(
value_key='instructor_name'
required=true
editable=true
label='Instructor name'
label={I18n.t('course_creator.instructor_name')}
placeholder='Name'
/>
<TextInput
Expand All @@ -138,7 +138,7 @@ CourseCreator = React.createClass(
value_key='instructor_email'
required=true
editable=true
label='Instructor email'
label={I18n.t('course_creator.instructor_email')}
placeholder='hello@example.edu'
/>
<TextInput
Expand All @@ -149,7 +149,7 @@ CourseCreator = React.createClass(
required=true
validation={/^[\w\-\s\,\']+$/}
editable=true
label='Course school'
label={I18n.t('course_creator.course_school')}
placeholder='School'
/>
<TextInput
Expand All @@ -160,7 +160,7 @@ CourseCreator = React.createClass(
required=true
validation={/^[\w\-\s\,\']+$/}
editable=true
label='Course term'
label={I18n.t('course_creator.course_term')}
placeholder='Term'
/>
<TextInput
Expand All @@ -169,7 +169,7 @@ CourseCreator = React.createClass(
value={@state.course.subject}
value_key='subject'
editable=true
label='Course subject'
label={I18n.t('course_creator.course_subject')}
placeholder='Subject'
/>
<TextInput
Expand All @@ -179,7 +179,7 @@ CourseCreator = React.createClass(
value_key='expected_students'
editable=true
type='number'
label='Expected number of students'
label={I18n.t('course_creator.expected_number')}
placeholder='Expected number of students'
/>
</div>
Expand All @@ -190,7 +190,7 @@ CourseCreator = React.createClass(
value={@state.course.description}
value_key='description'
editable=true
label='Course description'
label={I18n.t('course_creator.course_description')}
autoExpand=false
/>
<TextInput
Expand All @@ -201,7 +201,7 @@ CourseCreator = React.createClass(
required=true
editable=true
type='date'
label='Start date'
label={I18n.t('course_creator.start_date')}
placeholder='Start date (YYYY-MM-DD)'
blank=true
isClearable=false
Expand All @@ -214,7 +214,7 @@ CourseCreator = React.createClass(
required=true
editable=true
type='date'
label='End date'
label={I18n.t('course_creator.end_date')}
placeholder='End date (YYYY-MM-DD)'
blank=true
date_props={minDate: moment(@state.course.start).add(1, 'week')}
Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/components/revisions/revision_list.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ RevisionList = React.createClass(

keys =
'rating_num':
'label': 'Class'
'label': I18n.t('revision.class')
'desktop_only': true
'title':
'label': 'Title'
'label': I18n.t('revision.title')
'desktop_only': false
'edited_by':
'label': 'Edited By'
'label': I18n.t('revision.edited_by')
'desktop_only': true
'characters':
'label': 'Chars added'
'label': I18n.t('revision.chars_added')
'desktop_only': true
'date':
'label': 'Date/Time'
'label': I18n.t('revision.date_time')
'desktop_only': true
'info_key': 'revisions.time_doc'

Expand Down
14 changes: 7 additions & 7 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<!-- Temporary Raven logging -->
<script src="//cdn.ravenjs.com/1.1.19/jquery,native/raven.min.js"></script>
<script>Raven.config("<%= ENV['sentry_public_dsn'] %>").install();</script>

<%= javascript_include_tag fingerprinted('/assets/javascripts/', 'main.js') %>
<%= csrf_meta_tags %>
</head>
Expand All @@ -41,23 +41,23 @@
</div>
<div class="home">
<p>
<%= link_to 'Home', root_url, class: 'inline' %>
<%= link_to I18n.t('application.home'), root_url, class: 'inline' %>
<% if current_user && current_user.admin? %>
<%= link_to 'Recent Activity', '/recent-activity', class: 'inline' %>
<%= link_to I18n.t('application.recent_activity'), '/recent-activity', class: 'inline' %>
<% end %>
</p>
</div>
<div class="search">
<%= form_tag("/ask", method: "get", target: '_blank') do %>
<%= text_field_tag(:q, '', placeholder: 'search ask.wikiedu.org') %>
<%= submit_tag("Help!") %>
<%= text_field_tag(:q, '', placeholder: I18n.t('application.search')) %>
<%= submit_tag(I18n.t('application.help')) %>
<% end %>
</div>
<div class="login">
<% if user_signed_in? %>
<p><b><%= link_to current_user.wiki_id, :root, class: 'inline' %></b>.&nbsp;&nbsp;&nbsp;<%= link_to "Log Out", :destroy_user_session %></p>
<p><b><%= link_to current_user.wiki_id, :root, class: 'inline' %></b>.&nbsp;&nbsp;&nbsp;<%= link_to I18n.t('application.log_out'), :destroy_user_session %></p>
<% else %>
<p><%= link_to "Login / Sign Up", user_omniauth_authorize_path(:mediawiki) %></p>
<p><%= link_to I18n.t('application.login_sign_up'), user_omniauth_authorize_path(:mediawiki) %></p>
<% end %>
</div>
</div>
Expand Down
21 changes: 21 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ en:

application:
dashboard: Wiki Ed Dashboard
help: Help!
home: Home
log_out: Log Out
login_sign_up: Login / Sign Up
recent_activity: Recent Activity
search: search ask.wikiedu.org

activity:
edited_by: Edited By
Expand Down Expand Up @@ -125,6 +131,16 @@ en:
course_creator:
create_new: Create a New Course
course_title: Course title
course_school: Course school
course_term: Course term
course_subject: Course subject
course_description: Course description
expected_number: Expected number of students
instructor_name: Instructor name
instructor_email: Instructor email
start_date: Start date
end_date: End date
intro: >
The title, school, and term create your course page’s URL, and can't be
changed. Everything else, you can edit later. Click “Create my Course!” to
Expand Down Expand Up @@ -159,9 +175,14 @@ en:
user_ns: User

revisions:
date_time: Date/Time
chars_added: Chars added
class: Class
edited_by: Edited by
loading: Loading revisions...
none: This course has no recent Wikipedia editing activity.
time_doc: The time of each revision in your local time
title: Title

# These are maintenance script messages.
tasks:
Expand Down
45 changes: 44 additions & 1 deletion config/locales/qqq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
qqq:
application:
dashboard: Application name.
help: Help
home: The main page
log_out: Log out (for registered users)
login_sign_up: Login (for registered users) or sign up
recent_activity: Last actions (for registered users)
search: Search on ask.wikiedu.org

activity:
edited_by: Column label for username of user who made an edit
all: '{{Identical|Activity}}'

articles:
none: Message stating that no articles have been edited.
loading: Placeholder message indicating that article data is still loading
Expand Down Expand Up @@ -41,6 +49,7 @@ qqq:
view_doc: Documentation for the view count.
views_added: Maintenance script message stating how many view counts have been
added to an article.

assignments:
assignees: '{{Identical|Assignee}}'
reviewers: '{{Identical|Reviewer}}'
Expand All @@ -49,12 +58,15 @@ qqq:
confirm_addition: Confirmation dialog for adding a new assignment. %{title} is
the Wikipedia page title. %{username} is the username of the assignee.
confirm_deletion: Confirmation dialog for an assignment should be deleted

blocks:
milestones:
title: Label for the Milestone section of a course page
empty: Message indicating that there are no milestones for a course

cohort:
view_other: Command to view another cohort.

courses:
activity: Label for link to the 'recent activity' list for a course
articles: Label for link to list of articles worked on by a course
Expand Down Expand Up @@ -87,8 +99,21 @@ qqq:
error:
exists: Error message indicating that a course with the same title, school and
term already exists.

course_creator:
create_new: Create a New Course
course_title: New course title
course_school: New course school
сourse_term: New course term
course_subject: New course subject
course_description: New course description
expected_number: Expected number of students
instructor_name: Instructor name
instructor_email: Instructor email
start_date: Start date of the course
end_date: End date of the course
intro: Description of the course creator form

metrics:
activity: Label for activity feed.
articles_created: Label for the number of articles created.
Expand All @@ -103,12 +128,24 @@ qqq:
student_editors: Label for number of editors participating as students in a course
view: Label for the number of article views.
view_count_description: Long label for the number of article views.

namespace:
main: Long label for the Main namespace.
main_char_added: Label for number of characters added to the Main namespace.
user: Long label for the User namespace.
user_char_added: Label for number of characters added to the User namespace.
user_ns: Wiki title for the User namespace.
user_ns: Wiki title for the user namespace.

revisions:
date_time: Date/Time
chars_added: Number of added chars
class: Class
edited_by: Author of the last edition
loading: Loading revisions
none: This course has no recent Wikipedia editing activity.
time_doc: The time of each revision in your local time
title: Title

users:
already_enrolled: Message indicating that a user is already enrolled in the course
and cannot be enrolled again.
Expand All @@ -131,6 +168,7 @@ qqq:
training_doc: Explanation of what it means to have completed training and how
completion is measured. The entire message should be customized to describe
the on-wiki training (if any) available in each language.

wiki_edits:
notify_untrained:
confirm: Confirmation dialog before talk page messages are sent
Expand All @@ -140,6 +178,7 @@ qqq:
training. This is a wikitext message.
summary: Edit summary for a talk page message indicating that the user has not
completed training. This is a wikitext message.

wizard:
assignment_dates: Header for the assignment dates section of the wizard
assignment_type: Header for the assignment type section of the wizard
Expand All @@ -158,16 +197,20 @@ qqq:
summary: |-
Header for the summary section
{{Identical|Summary}}
error_404:
header: Message indicating that a page doesn't exist.
explanation: Message explaining why a user may have reached a page that doesn't
exist.

error_422:
header: Message indicating a 422 unprocessable entity error.
explanation: Explanation of what to do after encountering this error.

error_500:
header: Message indicating a 500 internal server error.
explanation: Explanation of what to do after encountering this error.

timeline:
title: '{{Identical|Timeline}}'
...
Loading

0 comments on commit 4e01812

Please sign in to comment.