Conversation
…tils lib. Allow invoking from build-locale-data that operates in node
…pts locally via npm
| return langTag; | ||
| } | ||
|
|
||
| export function merge(obj1, obj2, keepOriginal = false) { |
There was a problem hiding this comment.
this is used in build-locale-data scripts, but failing like so:
> node ./build-locale-data/build-files.js
file:///C:/D2L/Code/intl/lib/document-locale-settings.js:1
const host = document.documentElement;
^
ReferenceError: document is not defined
at file:///C:/D2L/Code/intl/lib/document-locale-settings.js:1:14
at ModuleJob.run (node:internal/modules/esm/module_job:439:25)
at async node:internal/modules/esm/loader:643:26
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
so refactored it out, since they are more standalone util functions not dependent on DOM APIs
| "test:unit": "d2l-test-runner", | ||
| "test": "npm run lint && npm run test:unit" | ||
| "test": "npm run lint && npm run test:unit", | ||
| "build-locale-data": "node ./build-locale-data/build-files.js" |
There was a problem hiding this comment.
assuming there is a reason this wasn't already done this way? In which case, is a separate package.json for the build-locale-data more appropriate?
| "homepage": "https://github.com/BrightspaceUI/intl", | ||
| "devDependencies": { | ||
| "@brightspace-ui/testing": "^1", | ||
| "cldr": "^8.0.0", |
There was a problem hiding this comment.
assumed latest is fine*? I do think this kind of stuff needs to be version controlled so anyone could run these locale build scripts?
* It might be the cause for these changes I see... was I supposed to use a different version?
|
Thanks @boarnoah -- I've converted this into a draft for now so we can wait for @bearfriend to have a look. I'm not sure if everything is in a complete state or if there was more to do. |
|
I'm going to close this for now to get it off our "to review" list, but something Danny can review when he's back. |
Adding support for new locales involve running scripts
node /build-locale-data/build-files.jsBut that fails because it is missing
cldrdependency + node not having the document DOM API.I am not sure how @bearfriend typically runs this script so I might have misunderstood. The script is running file locally now, but it generates a lot of locale-data changes?
PS: I am associating this with the vulcan card to add Gaelic support, but this might be more appropriate under a Gaudi card re: improvements in this area?
https://desire2learn.atlassian.net/browse/VUL-1398