-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove cldr dependency due to excessive size
- Loading branch information
Showing
5 changed files
with
48 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env node | ||
|
||
/* eslint-disable import/no-commonjs, import/no-extraneous-dependencies, quote-props */ | ||
|
||
// Usage: `npm i cldr && node ./src/build && npm uninstall cldr` | ||
// @see https://github.com/papandreou/node-cldr/issues/99 | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const cldr = require('cldr'); | ||
|
||
const dayNames = {}; | ||
|
||
for (const localeId of cldr.localeIds) { | ||
const dictionary = cldr.extractFields(localeId); | ||
|
||
dayNames[localeId] = { | ||
'-1': dictionary.day.relative['-1'], | ||
'0': dictionary.day.relative['0'], | ||
'1': dictionary.day.relative['1'], | ||
}; | ||
} | ||
|
||
fs.writeFileSync(path.resolve(__dirname, 'locale.json'), JSON.stringify(dayNames)); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters