-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
4,179 additions
and
4,101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,8 @@ | |
"prepare": "husky install", | ||
"lint": "eslint ./src", | ||
"lint-fix": "eslint ./src --fix", | ||
"format": "prettier ./src --write" | ||
"format": "prettier ./src --write", | ||
"sort-locales": "node ./scripts/sort-locales.js" | ||
}, | ||
"dependencies": { | ||
"@fontsource/figtree": "^5.1.0", | ||
|
@@ -163,10 +164,13 @@ | |
"prettier --write --ignore-unknown --plugin prettier-plugin-tailwindcss", | ||
"eslint --fix", | ||
"git update-index --again" | ||
], | ||
"src/Locale/*.json": [ | ||
"npm run sort-locales" | ||
] | ||
}, | ||
"engines": { | ||
"node": ">=20.12.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
} | ||
} |
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,26 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const fs = require("fs"); | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const path = require("path"); | ||
|
||
const directory = "src/Locale"; | ||
|
||
fs.readdir(directory, (err, files) => { | ||
if (err) throw err; | ||
|
||
files.forEach((file) => { | ||
if (file.endsWith(".json")) { | ||
const filePath = path.join(directory, file); | ||
const data = JSON.parse(fs.readFileSync(filePath, "utf8")); | ||
|
||
const sortedData = Object.keys(data) | ||
.sort() | ||
.reduce((acc, key) => { | ||
acc[key] = data[key]; | ||
return acc; | ||
}, {}); | ||
|
||
fs.writeFileSync(filePath, JSON.stringify(sortedData, null, 2) + "\n"); | ||
} | ||
}); | ||
}); |
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
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
Oops, something went wrong.