instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.53k stars 2.45k forks source link

i18n errors on most files in public/javascripts and some others #370

Closed selllikesybok closed 9 years ago

selllikesybok commented 10 years ago

rake canvas:compile_assets fails during the a certain step (the execution of generate_js from the i18n.rake file).

It recommends running i18n:check, so I have done so, producing the following output (oddly, after apparently successful execution, there is a rake aborted error message!

But I don't care why i18n:check throws an error at the end, unless its relevant to the issue with canvas:compile_assets).

* Invoke i18n:check (first_time) * Invoke environment (first_time) * Execute environment * Execute i18n:check ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...........................................................................................................................................................................................................................FFFFF..FF...FFFFFFFFFF.......................................................................................................................................................................................................................................................................................................

1) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/user.js

2) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/user_logins.js

3) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/user_name.js

4) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/user_notes.js

5) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/wikiSidebar.js

6) unable to "parse" I18n scope on line 2 (require(...) ./public/javascripts/account_add_course.js

7) unable to "parse" I18n scope on line 2 (require(...) ./public/javascripts/account_add_user.js

8) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/account_authorization_configs.js

9) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/account_settings.js

10) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/account_statistics.js

11) unable to "parse" I18n scope on line 2 (require(...) ./public/javascripts/add_assignment_group.js

12) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/ajax_errors.js

13) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/alerts.js

14) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/assignments.js

15) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/attendance.js

16) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/calcCmd.js

17) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/calendar.js

18) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/calendar_event.js

19) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/calendar_move.js

20) unable to "parse" I18n scope on line 3 (define(...) ./public/javascripts/choose_content.js

21) unable to "parse" I18n scope on line 3 (define(...) ./public/javascripts/choose_course.js

22) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/collaborations.js

23) unable to "parse" I18n scope on line 2 (require(...) ./public/javascripts/communication_channels.js

24) unable to "parse" I18n scope on line 3 (define(...) ./public/javascripts/conferences.js

25) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/content_exports.js

26) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/content_imports.js

27) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/content_locks.js

28) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/content_tags_index.js

29) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/context_inbox.js

30) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/context_modules.js

31) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/course.js

32) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/course_settings.js

33) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/edit_rubric.js

34) unable to "parse" I18n scope on line 29 (define(...) ./public/javascripts/eportfolio.js

35) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/find_outcome.js

36) unable to "parse" I18n scope on line 22 (define(...) ./public/javascripts/full_files.js

37) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/gradebook-history.js

38) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/gradebooks.js

39) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/gradebook_uploads.js

40) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/grade_summary.js

41) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/grading_standards.js

42) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/groups.js

43) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/instructure.js

44) unable to "parse" I18n scope on line 22 (define(...) ./public/javascripts/instructure_helper.js

45) unable to "parse" I18n scope on line 18 (define(...) ./public/javascripts/jquery.disableWhileLoading.js

46) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/jquery.doc_previews.js

47) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/jquery.instructure_date_and_time.js

48) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/jquery.instructure_forms.js

49) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/jquery.instructure_misc_helpers.js

50) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/jquery.instructure_misc_plugins.js

51) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/ldap_settings_test.js

52) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/link_enrollment.js

53) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/manage_avatars.js

54) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/manage_groups.js

55) unable to "parse" I18n scope on line 15 (define(...) ./public/javascripts/mathquill.js

56) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/media_comments.js

57) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/message_students.js

58) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/moderate_quiz.js

59) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/plugins.js

60) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/prerequisites_lookup.js

61) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/profile.js

62) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/question_bank.js

63) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/question_banks.js

64) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/quizzes.js

65) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/quiz_arrows.js

66) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/quiz_index.js

67) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/quiz_rubric.js

68) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/quiz_show.js

69) unable to "parse" I18n scope on line 2 (require(...) ./public/javascripts/quiz_statistics.js

70) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/quiz_timing.js

71) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/rubric_assessment.js

72) unable to "parse" I18n scope on line 2 (define(...) ./public/javascripts/section.js

73) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/select_content_dialog.js

74) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/sis_import.js

75) unable to "parse" I18n scope on line 19 (define(...) ./public/javascripts/site_admin.js

76) unable to "parse" I18n scope on line 22 (define(...) ./public/javascripts/speed_grader.js

77) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/submissions.js

78) unable to "parse" I18n scope on line 3 (define(...) ./public/javascripts/submission_download.js

79) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/submit_assignment.js

80) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/sub_accounts.js

81) unable to "parse" I18n scope on line 20 (define(...) ./public/javascripts/supercalc.js

82) unable to "parse" I18n scope on line 21 (define(...) ./public/javascripts/take_quiz.js

83) unable to "parse" I18n scope on line 35 (define(...) ./public/javascripts/tinymce.editor_box.js

84) unable to "parse" I18n scope on line 52 (define(...) ./public/javascripts/vendor/scribd.view.js

85) unable to "parse" I18n scope on line 24 (define(...) ./public/javascripts/tinymce/jscripts/tiny_mce/plugins/instructure_embed/editor_plugin.js

86) unable to "parse" I18n scope on line 24 (define(...) ./public/javascripts/tinymce/jscripts/tiny_mce/plugins/instructure_external_tools/editor_plugin.js

87) unable to "parse" I18n scope on line 3 (define(...) ./public/javascripts/tinymce/jscripts/tiny_mce/plugins/instructure_image/editor_plugin.js

88) unable to "parse" I18n scope on line 24 (require(...) ./app/views/assignments/peer_reviews.html.erb

89) unable to "parse" I18n scope on line 41 (require(...) ./app/views/assignments/_assignments_list_content.html.erb

90) unable to "parse" I18n scope on line 368 (require(...) ./app/views/files/full_index.html.erb

91) unable to "parse" I18n scope on line 4 (require(...) ./app/views/groups/_add_group_category.html.erb

92) unable to "parse" I18n scope on line 8 (require(...) ./app/views/pseudonym_sessions/new.html.erb

93) unable to "parse" I18n scope on line 143 (require(...) ./app/views/question_banks/show.html.erb

94) unable to "parse" I18n scope on line 108 (require(...) ./app/views/quizzes/_quiz_submission.html.erb

95) unable to "parse" I18n scope on line 51 (require(...) ./app/views/rubrics/index.html.erb

96) unable to "parse" I18n scope on line 34 (require(...) ./app/views/rubrics/show.html.erb

97) unable to "parse" I18n scope on line 51 (require(...) ./app/views/rubrics/user_index.html.erb

98) unable to "parse" I18n scope on line 42 (require(...) ./app/views/shared/_add_assignment.html.erb

99) unable to "parse" I18n scope on line 7 (require(...) ./app/views/shared/_login.html.erb

100) unable to "parse" I18n scope on line 63 (require(...) ./app/views/terms/index.html.erb

101) unable to "parse" I18n scope on line 11 (require(...) ./app/views/users/registered.html.erb

Finished in 112.132971664 seconds

2304 files, 8613 strings, 101 failures rake aborted! check command encountered errors /vagrant/canvas-lms/lib/tasks/i18n.rake:135:in block (2 levels) in <top (required)>' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:236:incall' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:236:in block in execute' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:231:ineach' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:231:in execute' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:175:inblock in invoke_with_call_chain' /home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:168:ininvoke_with_call_chain' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:161:in invoke' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:149:ininvoke_task' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in block (2 levels) in top_level' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:ineach' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in block in top_level' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:115:inrun_with_threads' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:100:in top_level' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:78:inblock in run' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:165:in standard_exception_handling' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:75:inrun' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/bin/rake:33:in <top (required)>' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/bin/rake:19:inload' /home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/bin/rake:19:in <main>' /home/vagrant/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:ineval' /home/vagrant/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `

' Tasks: TOP => i18n:check

jenseng commented 10 years ago

@selllikesybok it looks like it's actually failing for you on every (vanilla) javascript file and js_block (in erb) that uses i18n, but interestingly enough not on any compiled javascript files (from coffeescript). a couple questions to help track this down:

  1. do you have any local modifications (even as trivial as whitespace changes), or is this a pristine canvas checkout?
  2. are there any js files in public/javascripts/compiled?
selllikesybok commented 10 years ago

@jenseng Yes, that was my impression. I think I cloned master, not stable, but I diffed the i18n.rake files from both branches and they appear identical, so it doesn't seem like that would be the issue?

As far as I know this is a completely clean pull - I have not edited anything. Took a long, long time to get all the dependencies installed and figured out, but AFAIK at not point in that process did I modify anything from the canvas repo.

The public/javascripts/compile has many files in it, and several directories:

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----        11/11/2013   2:27 PM            arr
d----        11/11/2013   2:28 PM            backbone-ext
d----        11/11/2013   2:28 PM            behaviors
d----        11/11/2013   2:28 PM            bundles
d----        11/11/2013   2:28 PM            calendar
d----        11/11/2013   2:28 PM            class
d----        11/11/2013   2:28 PM            collections
d----        11/11/2013   2:28 PM            conversations
d----        11/11/2013   2:28 PM            discussions
d----        11/11/2013   2:28 PM            editor
d----        11/11/2013   2:29 PM            ember
d----        11/11/2013   2:29 PM            fn
d----        11/11/2013   2:29 PM            gradebook2
d----        11/11/2013   2:29 PM            jquery
d----        11/11/2013   2:29 PM            models
d----        11/11/2013   2:29 PM            notifications
d----        11/11/2013   2:29 PM            object
d----        11/11/2013   2:29 PM            presenters
d----        11/11/2013   2:29 PM            profile
d----        11/11/2013   2:29 PM            regexp
d----        11/11/2013   2:29 PM            registration
d----        11/11/2013   2:29 PM            str
d----        11/11/2013   2:29 PM            util
d----        11/11/2013   2:30 PM            views
d----        11/11/2013   2:30 PM            widget
d----        11/11/2013   2:30 PM            xhr
-a---        11/11/2013   2:27 PM       2620 AssignmentDetailsDialog.js
-a---        11/11/2013   2:27 PM       3368 AssignmentMuter.js
-a---        11/11/2013   2:28 PM        680 badge_counts.js
-a---        11/11/2013   2:28 PM       1308 bookmarklet_source.js
-a---        11/11/2013   2:28 PM        849 dashboardToggle.js
-a---        11/11/2013   2:28 PM       3613 developer_keys.js
-a---        11/11/2013   2:29 PM      13265 grade_calculator.js
-a---        11/11/2013   2:29 PM      14028 handlebars_helpers.js
-a---        11/11/2013   2:29 PM       5555 helpDialog.js
-a---        11/11/2013   2:29 PM      14584 jobs.js
-a---        11/11/2013   2:29 PM       4975 jquery.kylemenu.js
-a---        11/11/2013   2:29 PM       2387 jquery.rails_flash_notifications.js
-a---        11/11/2013   2:29 PM        843 jquery.whenAll.js
-a---        11/11/2013   2:29 PM       3733 license_help.js
-a---        11/11/2013   2:29 PM        785 ModuleItemTypes.js
-a---        11/11/2013   2:29 PM       2461 multi_grid.js
-a---        11/11/2013   2:29 PM       3789 PaginatedList.js
-a---        11/11/2013   2:29 PM       5324 SubmissionDetailsDialog.js
-a---        11/11/2013   2:29 PM       1462 teacher_activity_report.js
-a---        11/11/2013   2:29 PM        782 Template.js
-a---        11/11/2013   2:29 PM       1135 tinymce.js
-a---        11/11/2013   2:29 PM        586 tours.js
-a---        11/11/2013   2:29 PM       1138 userSettings.js
-a---        11/11/2013   2:29 PM      10434 user_lists.js

Each of those directories has files in them as well.

selllikesybok commented 10 years ago

@jenseng Also, just based on the lines it's failing on, it looks like they are all like this:

    'i18n!accounts' /* I18n.t */,

Because the errors are all like 'line 2' or 'line 3' and in these files that's the first element of the define or require block at the top of the file.

The i18n.js file has a comment at the top which seems to indicate these are no longer necessary? Something about previously having required specific scope into the module. So I don't actually know if i18n!accounts is defined anywhere for the require to pick it up, or if that's the problem?

I'm a novice with Javascript and this is my first ever exposure to ruby (well, other than setting up a Heroku instance some time ago), so this is a bit tough for me to follow.

jenseng commented 10 years ago

@selllikesybok i'll keep digging a bit more, but those lines are still necessary. the reason i asked about the compiled javascripts is that those generally have the same kind of define/require blocks, the only real difference is that it's all on one line. so for some reason, it appears the I18n extractor doesn't like the multi-line requires/defines on your system

jenseng commented 9 years ago

although i was never able to repro, this should be working now, as the i18n tools were completely replaced with i18nliner ... reopen if this is still an issue