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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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
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>
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>
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>