CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization: Difference between revisions
Line 17: | Line 17: | ||
===Relevant Files=== | ===Relevant Files=== | ||
config/locales | config/locales/ | ||
en.yml | * en.yml | ||
hi_IN.yml | * hi_IN.yml | ||
config/ | |||
* routes.rb | |||
* application.rb | |||
app/controllers/applcation_controller.rb | |||
Student View Files: | Student View Files: | ||
* app/views/ | |||
* student_review/list | |||
* grades/review_team | |||
* participants/change_handle | |||
* grades/view_my_scores | |||
== Project Description == | == Project Description == |
Revision as of 17:52, 3 December 2018
Introduction
Team Members
Jonathan Gill (jtgill@ncsu.edu)
Hasham Mukhtar (hmukhta@ncsu.edu)
Abhilasha Saini (asaini4@ncsu.edu)
Reddy Aravind Karnam Ganesh (rkarnam@ncsu.edu)
Mentor
Zhewei Hu (zhu6@ncsu.edu)
Relevant Files
config/locales/
- en.yml
- hi_IN.yml
config/
- routes.rb
- application.rb
app/controllers/applcation_controller.rb
Student View Files:
- app/views/
- student_review/list
- grades/review_team
- participants/change_handle
- grades/view_my_scores
Project Description
Currently Expertiza only supports creating courses in the English language. Many Expertiza users are from other countries. We aim to allow instructors to create courses in other languages. This will be done by internationalizing static strings in Expertiza to another language (ex: Hindi or Chinese). Instructors will have the ability to change the language for a course in the Edit Course page through a dropdown. We will not be affecting any strings that are dynamically shown and are not changing any English strings in the actual code.
Project Design
Technical Design
Allowing instructor to change language for a course
- We will add a
language
column to theCourses
Table. - Then we will add a dropdown of languages to the Edit Course page for an instructor to use.
- When an instructor updates the Edit Course page with a chosen language picked, it will translate all the static strings in the Expertiza application to that new language.
Adding Multi-Language Support
- For this project, we will be adding support for one language right now, Hindi.
- We are using Google Translate to convert the words to Hindi.
- We will be using the Rails Internationalization (I18n) API to help us add multi language support.
- There will be two
yaml
files in theconfig/locales
directory representing the different languages that can be used in Expertiza.- One for English, which will be the default language used, and another for Hindi.
en.yml
hi_IN.yml
- These
yaml
files contain the translated strings for their respective language.
- One for English, which will be the default language used, and another for Hindi.
- We will be editing the
routes.rb
file and all the view files so that it can read from theyaml
files to show other languages.
Example Output
Original Page
Language Dropdown
Translated Page
Test Plan
Overview
- Plan to test translated pages to see if Hindi is shown instead of English
- Using rspec and/or capybara
Scenarios
1. Log in to Expertiza as an instructor. Go to the Edit Course Page for a course. Go to language dropdown and choose Hindi. Click update. Check to see if Edit Course Page English strings are translated to Hindi
2. While still logged in as an instructor, check if the Edit Assignment page is also translated.
3. While still logged in as an instructor, check if other pages are also translated.
Links/References
Project Links
- Pull Request: https://github.com/expertiza/expertiza/pull/1286
- Github: https://github.com/mukhtar23/expertiza
- Video:
Support Material
- https://guides.rubyonrails.org/i18n.html#how-i18n-in-ruby-on-rails-works
- https://guides.rubyonrails.org/i18n.html#setting-the-locale-from-url-params
- https://guides.rubyonrails.org/i18n.html#abstracting-localized-code
- https://guides.rubyonrails.org/i18n.html#providing-translations-for-internationalized-strings
- https://guides.rubyonrails.org/i18n.html#passing-variables-to-translations