Commit Graph

82 Commits

Author SHA1 Message Date
Cody Cutrer bec3c7d33b RuboCop: Lint/UnusedMethodArgument gems
all manual. a few cascaded to cleaning up leaky consts in specs

Change-Id: Ia77478b92f23e06d1023f4e3cfa02a751593a368
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276484
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-25 18:57:24 +00:00
Cody Cutrer dbd8c46655 RuboCop: Lint
[skip-stages=Flakey]

auto corrections applied:
 * Lint/AmbiguousOperator
 * Lint/AmbiguousOperatorPrecedence
 * Lint/AmbiguousRegexpLiteral
 * Lint/DeprecatedClassMethods
 * Lint/DeprecatedOpenSSLConstant
 * Lint/NonDeterministicRequireOrder
 * Lint/ParenthesesAsGroupedExpression
 * Lint/RedundantRequireStatement
 * Lint/RedundantSafeNavigation
 * Lint/RedundantSplatExpansion
 * Lint/RedundantStringCoercion
 * Lint/RedundantWithIndex
 * Lint/SendWithMixinArgument
 * Lint/SymbolConversion

Change-Id: I222ec19978033544513bb99755994d109435abad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:38:23 +00:00
Cody Cutrer fe29b5cb34 RuboCop: Lint/AssignmentInCondition config, db and doc
Change-Id: I95317f45626ccc6cd7efcd17abb93aeb7e3a50f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274583
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 03:33:05 +00:00
Cody Cutrer 685f1d9791 RuboCop: Style/Encoding
[skip-stages=Flakey]

Change-Id: I4b16b64f7abb3769bb3ff3dd6146a1be03487a83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274547
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-27 20:52:15 +00:00
Cody Cutrer 2d7a070910 RuboCop: Bundler and Gemspec
Change-Id: I3077a90ba421f5996bb7ef2d4b7d85c2134b4c11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274193
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:02:32 +00:00
Cody Cutrer dd8fc67c41 RuboCop: Layout gems
Change-Id: Ie49d89234f4ffed27236a1713d072a00f637a253
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274064
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 15:35:24 +00:00
Jacob Burroughs 374503c52d Don't let nulls get into locale javascript
Change-Id: Iaf6226d4f4fed7d838bcd4ef916a404d59c08e4a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270756
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-08-04 23:26:46 +00:00
Jacob Burroughs 9584d88b25 Support translated community links
Community links should never be added to the codebase itself anymore.
Instead they should be referenced as a translation with a key of
'community.#{key}'.  The links should be stored in config/locales/community.csv,
which is a download of the 'canvas-import' tab of the
'Canvas Translated Guides Mapping' sheet managed by the community team.

There are a few links that the community team says should be updated, that
will be done in a followup commit.

test plan:
- Spot check the various types of files (js/handlebars/erb/plain js)
- Try English, Spanish (or another non-english language in community.csv,
  and Catalan (or another language not in community.csv)

fixes FOO-1771

Change-Id: I67534204c2236a3ff05642cb2d13b8f546da9498
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270622
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-08-04 21:22:12 +00:00
Ahmad Amireh 22abe2565c remove Proc values from generated locale files
fixes FOO-1614

Procs can't be serialized and they caused us issues recently in the
upgrade to Rails 6, now the generator will omit any phrase that has
a value of that type, instead of selectively omitting hard-coded phrases

TEST PLAN
---- ----

run "rake i18n:generate" and verify config/locales/generated/en.yml
does not have any Proc values, alternative diff the file before this
patch and after and verify they are identical

Change-Id: Icc8bfa32c2d667518727d732d689a8b2865be1bd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265444
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-05-24 22:02:24 +00:00
Ahmad Amireh 4243097b21 rename some things
fixes FOO-1265

[skip-eslint=true]
[pin-commit-analytics=7e49eefd7f59cbf43fd03bf8957bbbfa76f8d9d5]
[pin-commit-demo_site=adade2e38e46a358a4643cd3db2fe5ccffe39ec5]
[pin-commit-instructure_misc_plugin=47a3161102b0611af56d134fbd0c828ddc1b8abf]
[pin-commit-migration_tool=0dbac2f5b421d894395605ce4b583ef0f7d60b22]
[pin-commit-multiple_root_accounts=cc96d28c0d59bbe47acc64de4fdd8e1d2b029805]

Change-Id: I14c07f20bd260cf0de1f48ceb70b3c2313edf2d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258807
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-04-06 01:12:49 +00:00
Cody Cutrer 6d14259077 add frozen_string_literal comment to engines and gems
Change-Id: Ifb661509145c16937c9f1c28803687b7cec4b3a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261815
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-03-30 18:14:15 +00:00
Ahmad Amireh 09e6058f72 sort auto-generated en.yml locale file
fixes FOO-1569
flag  = none

The tree of phrases coming out of the i18n:generate rake task is now in
alphabetical order. This should have absolutely no effect on the
structure of the tree, only on the order in which the keys appear in
each branch.

:: test plan ::

There are no surprises related to text in the UI; any page should do,
things should look the same, you don't see "bar" in place of "foo"

Change-Id: I683c5ee352149128a05e36bcb07646aca15ad3a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258170
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-03-10 17:11:26 +00:00
Simon Williams 54b40993e6 i18n: fix typo in excluded key
refs FOO-1614
flag = none

test plan: `bundle exec rake i18n:generate` does not include any values
like `!ruby/object:Proc {}`

Change-Id: I5013f759f5274573e60264e6aa844fabff6a7ad6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259241
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-02-22 19:36:07 +00:00
Cody Cutrer 62fb86ea50 raise bundler minimum requirement
because of nokogiri, we rely on multi-platform gem caching, which
only works right in bundler 2.2

Change-Id: Id207278946e849abec3418807c71e4650506a0cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259142
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-02-19 22:49:02 +00:00
Ahmad Amireh 5e4cd4ceb8 manually remove Proc translations in en.yml
refs FOO-1614
flag = none

this is a stop-gap measure to remove the two offending keys that are
present in en.yml and have a value of a Ruby Proc, the ideal fix would
be to tune the scanner to not pick up such phrases in the first place

test plan::

run "rake i18n:generate" and verify the translations file at
config/locales/generated/en.yml does not contain any value that starts
with `!ruby/`:

- en.number.nth.ordinals
- en.number.nth.ordinalize

Change-Id: Ia5edbdcd75617835b34c7634fd30a9ecc4866d83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258906
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2021-02-17 18:38:08 +00:00
Michael Ziwisky 7e5eda6ae9 speed up app boot with lazy translations
fixes FOO-1170

Some old code that was intended to reduce app boot/initialization time
by skipping loading of non-english strings had its heart in the right
place, but after a series of tweaks, its head got screwed up and it
hasn't actually been having any effect on language loading for some time
now. So this removes that code in favor of a new strategy -- don't
eagerly load _any_ languages, rather lazy-load them all on first access.
This is accomplished by a new `LazyPresumptuousI18nBackend`.

On local benchmarks, this change reduces app boot time by about 35%
(from ~44s to ~28s on Rails 5.2, and from ~52s to ~34s on Rails 6.0).

Also drops `CalculateDeprecatedFallbacks` as we no longer have any
`deprecated_for` flags in our translations files.

test plan:
 - make sure canvas still runs and it still shows strings
 - observe that it boots 35% faster! e.g., when you run a spec. 30
   seconds is still a bummer, but it's less of a bummer than 45 seconds!

Change-Id: If92a99a32c94b24e20f5ac074ae568357811b899
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251613
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2020-11-18 00:40:13 +00:00
Cody Cutrer d6e044ff76 add # frozen_string_literal: true for embedded gems
Change-Id: Ib49bc8939cf1706e758429e531a87c57d0231a37
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251156
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-28 22:08:40 +00:00
Ryan Shaw b99068d79c speed up translations loading
According to https://v8.dev/blog/cost-of-javascript-2019#json
If you use JSON.parse instead of object literals for large objects like
our i18n strings, it is faster.

Testing this locally in prod mode it made the time to evaluate main.js
go from 783ms (https://cl.ly/371ceb866fe4) 
to 607ms (https://cl.ly/c2ce9eb82f7e)

Test plan:
* i18n strings should work the same as they always have
* pages should load a tiny bit faster in prod

Change-Id: Icc3dbd07e87f60d40e523d454917f865fdb39d7d
Reviewed-on: https://gerrit.instructure.com/199209
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-07-01 15:25:30 +00:00
Ryan Shaw 83eca54a7f Make i18n scope string file loading faster
by replacing $.extend(true I18n, {translations: …}), we can speed up
the amount of time we spend loading the i18n string files. 

From profiling, a non-trivial amount of the javascript run time was
Spent just in these calls to $.extend(true, …)

Test plan:
* in a prod build
* set your language to something non-english like spanish
* everything should still be translated the same as before
* pages should load a little faster, especially on low powered devices
  like mobiles

Change-Id: I9ac4a7b67cf14498ee1b972ba083db952ad7f314
Reviewed-on: https://gerrit.instructure.com/194234
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-05-23 21:17:58 +00:00
James Williams 0ee36b92a0 generate locale yaml without line wrapping
Change-Id: Idd1c56b4a9f98e6d90f5d865f192ab9f06b74064
Reviewed-on: https://gerrit.instructure.com/182323
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams <jamesw@instructure.com>
2019-02-21 20:16:25 +00:00
James Williams a5a9b26e42 encode i18nliner translation hash as a standard hash
refs #CORE-2352

Change-Id: I06510403b5f7f99de75e28f2655f1fa24ecc0e9d
Reviewed-on: https://gerrit.instructure.com/180026
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2019-01-31 17:20:51 +00:00
James Williams f3fdc6da4f add rake task to import new locale from s3
refs #CORE-2350

Change-Id: I2ecc201651e0e00864db9033d858243323a8df2c
Reviewed-on: https://gerrit.instructure.com/179657
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-01-30 17:32:29 +00:00
James Williams c7609ba733 use psych to export locale yml
closes #CORE-2352

Change-Id: I3f910893e407c9ebcafe0d1bf784170405de489e
Reviewed-on: https://gerrit.instructure.com/179685
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-01-30 12:42:13 +00:00
Brent Burgoyne 96b11b7cf5 bulk update of localized date/time formats
including better test coverage for parsing/formatting and fixes for
bugs exposed by changes to the formats.

closes CORE-1557

test plan:
- spot check datepicker in each locale
- try dates in multiple months
- try current year and future/past
- make sure string below datepicker field shows correct date

Change-Id: I9857b6f84c4e98fdaff5a6d8e90568602f42e689
Reviewed-on: https://gerrit.instructure.com/164724
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-09-19 15:24:00 +00:00
Brent Burgoyne fd31869bbe prevent translators from changing date formats
also include a rake task to "lock" other keys in the future.

refs CORE-1557

test plan:
- sanity check date inputs/formats in other locales

Change-Id: I10557ab71012219540b722032ae46950595d2266
Reviewed-on: https://gerrit.instructure.com/155936
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-07-02 20:33:49 +00:00
Simon Williams 90c823b4b8 delete dead code
Change-Id: Iafd0eb92aae8992e30ae6159ee8e5620ed33bde7
Reviewed-on: https://gerrit.instructure.com/148611
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2018-04-30 21:07:05 +00:00
James Williams 7423e4fb94 rails 5.2
closes #CORE-1301 #CORE-1302

Change-Id: I687132b066d12cf35e3c7a593dff9b2a91337f33
Reviewed-on: https://gerrit.instructure.com/147220
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-04-25 19:15:20 +00:00
Cody Cutrer 85445065e1 bump i18n
all the way to 1.0, under rails 5.2. the 1.0.0 change is just dropping
ruby 1.9.3 support

Change-Id: Ibf075bb45ff088d8cb132f96ae7e310140dd5bbb
Reviewed-on: https://gerrit.instructure.com/144617
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2018-03-23 16:27:26 +00:00
Cody Cutrer 2023e3d591 i18n: add islandic
fixes CNVS-35911

Change-Id: Ia2be4e137e8c0f2fb23e1403713b731b7bbbafcd
Reviewed-on: https://gerrit.instructure.com/121015
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-07-31 20:23:09 +00:00
Cody Cutrer e151b9c6f7 bump lots of minor gem versions
Change-Id: Ife54e460d9cf61890b3e3a8850686f62f2597a96
Reviewed-on: https://gerrit.instructure.com/120718
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-27 22:02:15 +00:00
Cody Cutrer 68f5e6065c prep for Rails 5.1
several gem bumps for versions compatible with rails 5.1, and loosening
requirements on in-repo gems.

Change-Id: I4849b053690527e812bb1042fde8142520452123
Reviewed-on: https://gerrit.instructure.com/115650
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-06-16 02:54:20 +00:00
Ryan Shaw b2700d45b6 [ci coverage] convert public/js w/ no ‘export’s to ‘import’
closes: CNVS-35922

now that we pass all of public/javascripts through
babel, istanbul/esprima should not choke on `import`
in our JS tooling.

test plan:
* run `yarn test` w/ COVERAGE=1
* it should work

Change-Id: Ia19deb547350245b7cae54e76e56ae6355f61b2c
Reviewed-on: https://gerrit.instructure.com/105962
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-05-19 19:11:12 +00:00
Landon Wilkins c5b5cc786d da licença part 53
add consistent license headers to all source files

Change-Id: I405d2def01ad68c76533b9254983497485cd7073
Reviewed-on: https://gerrit.instructure.com/110160
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-01 21:06:11 +00:00
Jon Jensen be84615841 bump simplecov, fixes SD-2056
test plan:
see coverage in previous rspec/selenium builds, same numbers as before

Change-Id: I331bf5102914da00a5d350f32b74b4bc9d49c5f8
Reviewed-on: https://gerrit.instructure.com/106895
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-04-04 18:06:25 +00:00
Ryan Shaw cda5e37e20 Speed up i18n:check by doing js & ruby at same time
On my local machine, this cut the time roughly in 
half since the js strings and the ruby strings
took about the same amount of time.

Test plan:

* rake i18n:check
* it should work exactly the same as before but
  be faster

Change-Id: I7a03e6f1b0480fbee86ed2d9515e97609714affd
Reviewed-on: https://gerrit.instructure.com/103626
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-03-07 16:11:35 +00:00
Jon Jensen cfc2ef675f remove i18nema and syck
fixes CNVS-34164

test plan:
 * basic smoke test that translations still work

Change-Id: Ia88fc88de8b52aeaa92b65ea43b93eef5adb1dcc
Reviewed-on: https://gerrit.instructure.com/95065
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-01-06 19:34:55 +00:00
Simon Williams 359c6dea13 upgrade many canvas gems to rspec 3 syntax
as of this commit, all canvas gems should be on rspec 3.5, and pass
without deprecation warnings.

closes CNVS-34040

test plan: specs should pass without deprecation warnings

Change-Id: I556b1a4a5aeb791c6ddd50ee35b51c513e025019
Reviewed-on: https://gerrit.instructure.com/98414
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-12-27 18:44:23 +00:00
Dan Minkevitch 3af0d6b676 Update ruby_parser for Ruby 2.3
Change-Id: Ib3508783c65270fcfb14657f5ed092db8b71954c
Reviewed-on: https://gerrit.instructure.com/96971
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-12-07 19:21:05 +00:00
Cody Cutrer d6f9064c3a allow Rails 5 for in-repo gems
Change-Id: Iebb04b73dfdd9c19ca51273b3bfa2b8f7bc1bb3a
Reviewed-on: https://gerrit.instructure.com/95407
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-11-17 15:07:58 +00:00
Jon Jensen 3f36c05513 fix locale fallbacks in JS land, fixes CNVS-29506, refs SD-71
in JS land, if a locale doesn't provide all strings, ensure we fall back
to its ancestor locales (if any) before we try `en`. this already works
correctly in ruby land.

also don't dump empty locales, since this hasn't been necessary since
cd8cd591ac

test plan:
1. run canvas without RAILS_LOAD_ALL_LOCALES or USE_OPTIMIZED_JS
2. switch to spanish
3. you should see english everywhere and not get js errors or missing
   translation messages
4. run canvas with RAILS_LOAD_ALL_LOCALES and USE_OPTIMIZED_JS
5. you should see spanish
6. ensure you have a custom en-GB-* locale per CNVS-29506
7. switch to that locale
8. ensure you see its strings, and en-GB where it doesn't specify any,
   e.g. "colour" in the Theme Editor instead of "color"

Change-Id: I349ef79ca3bb300a83cd45a11cf3b7ffd0fc2cf9
Reviewed-on: https://gerrit.instructure.com/80094
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2016-05-20 20:56:19 +00:00
Jon Jensen 51457d4166 fix i18n testing with LOLCALIZE=true
test plan:
1. run canvas w/ LOLCALIZE=true
2. there should be lols

Change-Id: I5e557518c29d0c024c0ffdfb0155e9efc7523b30
Reviewed-on: https://gerrit.instructure.com/78997
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-05-06 22:14:07 +00:00
Cody Cutrer 0da27c55b7 add env var to include locales from plugins in i18n:generate_js
refs CNVS-28112

test plan:
 * have a plugin with additional locales
 * run `RAILS_LOAD_ALL_LOCALES=1 rake i18n:generate_js`
 * ensure the locale shows up in _core_en.js

Change-Id: Ia2f96fbc39bb2060abe6936ad2f7b1e8e74c0b89
Reviewed-on: https://gerrit.instructure.com/77846
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-04-27 16:52:49 +00:00
Cody Cutrer 1a8f9f4bbb centralize locale conversions to locales.yml
refs CNVS-28112

test plan:
 * translations should still be correct, especially check
   - date and time pickers
   - calendar
   - RCE

Change-Id: I283c7eb1ee24bca3878ae331b8419379bef434db
Reviewed-on: https://gerrit.instructure.com/74823
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-04-25 22:46:30 +00:00
Simon Williams 260691f1d1 i18n: add hebrew (crowd-sourced)
There have been some inconsistencies in date and time formats. However,
by standardizing our own translation config files on 24 hour time
formats and including the Hebrew Geresh symbol (׳) in our day and month
name abbreviations we have found a configuration that seems to work well
(or at least consistently).

closes CNVS-26264

test plan:
- enable translations locally and set your language to hebrew
- make sure both ruby and javascript translations work
- check a datetime field specifically

Change-Id: I07128071fb89d7129a1fbdc1e0c446866850f3f5
Reviewed-on: https://gerrit.instructure.com/69911
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
2016-03-02 19:10:58 +00:00
Strand McCutchen ca5631a53e Use RFC-5646 language codes
fixes CNVS-26357
refs  CNVS-19910
fixes CNVS-27098
fixes CNVS-27099
fixes CNVS-27100

A few of our language codes were somewhat inaccurate, either
lacking an appropriate suffix or using underscores and not
hyphens. This change uses more accurate language codes.

When language codes were passed to the JavaScript layer, one of
the languages, zh_Hant, did not conform to RFC-5646.
When it was consumed later in the JS, its underscore caused
an issue which prevented editing in the Gradebook.

Test plan:
 0. Create and publish course. Create and publish an assignment.
 1. Add a user named "匿名" to the course.
 2. Give the user a grade in the gradebook.
 3. In the course settings (`/courses/:id/settings`) set the
    course language to zh_hant (2nd from bottom).
 4. Navigate to Gradebook and verify that you can still edit
    grades.

Revert "rollback aba0de7 and its effects"

This reverts commit 7339952ea4.

Change-Id: I9de7c3a6d5f046c6e06671a44b1f77dc47d62954
Reviewed-on: https://gerrit.instructure.com/72753
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
2016-02-24 20:53:40 +00:00
James Williams 1ce5a75400 rails 4.2: fix i18n tasks
refs #CNVS-26056

Change-Id: I0cb3c3c46ccee9e26972853aa0f08db0f0fffcce
Reviewed-on: https://gerrit.instructure.com/70967
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-26 20:35:54 +00:00
Cody Cutrer f552f4fc00 simplify gem test harnesses
rely on test_all_gems.sh to output header and trailer,
and use `set -e` in each test.sh to simplify passing
through errors

Change-Id: I3ba724ad2539ddfe31195394c43f646acfc73920
Reviewed-on: https://gerrit.instructure.com/70469
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-19 17:52:58 +00:00
James Williams d2833299d7 remove rails 3 support
also add initial rails 4.2 scaffold

refs #CNVS-25988

Change-Id: Ifd7aecaffb6cfc8a3e41bc3fb011fb6ce0664ea6
Reviewed-on: https://gerrit.instructure.com/69129
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-23 21:36:43 +00:00
Cody Cutrer 421cfafabb allow rails 4.2 on gems that pass specs with it
Change-Id: I55b1ea783d924ffad60d1ce8de3be030b36bf519
Reviewed-on: https://gerrit.instructure.com/69155
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-12-17 22:50:17 +00:00
Jacob Fugal 7339952ea4 rollback aba0de7 and its effects
until we can update transifex at the same time as we merge the rename.

this reverts commits:

 * f2cbb3e76e
   (Updated zh_Hant translation)

 * 9ab70066fd
   (Updated zh translation)

 * d861ceca74
   (Updated fa-IR translation)

 * aba0de7b96
   (rename some locales)

Change-Id: I130a0a14e366274c86026bbaccad985a24bb4f1f
Reviewed-on: https://gerrit.instructure.com/63496
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2015-09-21 14:51:24 +00:00