Closes FOO-2801
flag=none
Translation files used to be generated into JS files which then
wound up in the webpack build so that they could be dynamically
imported by the engine's I18n capability. But those JS files were
basically nothing but definitions of huge JS objects with all
the string translations for the locale. There's no reason to have
those in JS files that need import.
It makes a lot more sense to generate them as JSON files, handle
them as regular old assets, and then have the I18n capability
use the fetch API to pull them in. Then webpack is no longer
involved in dealing with translation files at all.
Test plan:
* Try out Canvas in English and one other locale.
* Look in the network tab for the fetch load of a file named
something like `en-xxxxxxxxxx.json` (or whatever locale
identifier you have Canvas set to)
* Translations inside the Canvas front end should all work as
always, in any locale
* Must be checked in CD after merge to be sure there are not
any additional issues related to the CDN
Change-Id: I3ed03b6adda720c78c84b005e07a8a28b815f06f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/296080
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
fixes FOO-2770
flag = none
problem was the moment initializer for Catalan was trying to lookup a
phrase before the translations file was loaded, now it waits for the
signal
additionally, i've installed a guard around the lookup routine to track
any such violations and report them to Sentry to help us clean them up
~ test plan ~
- switch to Catalan and go to account settings
- verify the page loads
- (optional) edit ca.js and call "apply" instead of the new function,
verify the error gets logged to Sentry (u can just use the debugger if
u don't have Sentry set up locally)
Change-Id: Iaa35b76b17f4b1f0a6ab8ec8050c0020fb36fcc8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287210
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
refs FOO-2697
flag = none
stop relying on @instructure/ui-babel-preset and instead use exactly the
transforms that we still need today from Babel
transformations that appear to be no longer necessary:
- plugin-transform-destructuring
- plugin-proposal-decorators
- plugin-proposal-class-properties
- plugin-proposal-export-default-from
- plugin-proposal-object-rest-spread
- plugin-proposal-optional-chaining
- plugin-syntax-dynamic-import
- plugin-proposal-private-methods
- postcss et al (we only import 3-4 css sources and they all come from
node_modules, we don't use themeable on core)
transformations that i don't think are necessary:
- babel-plugin-transform-undefined-to-void: because if there is code
that is re-assigning `undefined`, the solution would be not to humor
it but to stop using it and perhaps file a lawsuit
babel deps were pinned to avoid semver upgrading, because upgrading
within the 7 line is already breaking us and i'll deal with that
another day
~ TEST PLAN ~
\ ---- ---- /
- you can run webpack locally and see no visual artifacts
Change-Id: I64eb9a7ac94e17f730686f579cf67cd8bd4e12f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283142
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Sean Scally <sean.scally@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
fixes FOO-2493
flag = none
test plan:
• compile assets and ensure Rails and Webpack are ran with
the following ENV variable: RAILS_LOAD_ALL_LOCALES=1
• change your language via profile/course/account to:
• Thai (ไทย)
• verify _most_ strings are being translated properly
• see Thai within our Style Guide for verifications below
• https://instructure.atlassian.net/wiki/spaces/ENG/pages/134802178/ \
Style+Guide+-+Instructure#StyleGuide-Instructure-Thai
• verify the RCE is localized
• verify assignment edit date picker (JQuery) works as expected
• selecting specific days, hours/minutes, and typing
• verify we're formatting the numbers as expected by punching in a
large number into "Points"
• verify the assignment index date picker(React) is localized
• go to calendar and verify the month/day names look appropriate
for the Thai locale
Change-Id: I9de044775b3ee492b8cc96e6d1234d64462c94b6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276201
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>