Skip to content

misc: read locale files without using require#12721

Merged
connorjclark merged 3 commits into
masterfrom
locales-norequire
Jul 23, 2021
Merged

misc: read locale files without using require#12721
connorjclark merged 3 commits into
masterfrom
locales-norequire

Conversation

@connorjclark

Copy link
Copy Markdown
Collaborator

ref #12689

preliminary change for converting this file (way down the line) to ES modules.

importing JSON modules won't be a thing for quite awhile, so we have to switch to fs. Must do all these reads w/o abstraction (no function for DRY) so that bundler can inline the contents for LR.

@connorjclark connorjclark requested a review from a team as a code owner June 29, 2021 21:40
@connorjclark connorjclark requested review from adamraine and removed request for a team June 29, 2021 21:40
@google-cla google-cla Bot added the cla: yes label Jun 29, 2021

@adamraine adamraine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM

Comment thread lighthouse-core/lib/i18n/locales.js Outdated
const fs = require('fs');

/** @type {Record<string, LhlMessages>} */
const l = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name is too short, maybe something like localeFiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants