-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for sorting locale file keys in pre-commit #8806
Merged
khavinshankar
merged 2 commits into
develop
from
rithviknishad/feat/pre-commit-sort-locales
Oct 16, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"); | ||
} | ||
}); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
{ | ||
"username": "युजरनेम", | ||
"password": "पासवर्ड", | ||
"new_password": "नवीन पासवर्ड", | ||
"confirm_password": "पासवर्डची खात्री करा", | ||
"first_name": "नाव", | ||
"last_name": "आडनाव", | ||
"email": "ई-मेल पत्ता", | ||
"phone_number": "दूरध्वनी क्रमांक", | ||
"district": "जिल्हा", | ||
"gender": "लिंग", | ||
"age": "वय", | ||
"login": "लॉगिन", | ||
"field_required": "हे भरणे आवश्यक आहे", | ||
"password_mismatch": "\"पासवर्ड\" आणि \"पासवर्डची खात्री करा\" दोन्ही सारखे हवेत.", | ||
"enter_valid_age": "वैध वय प्रविष्ट करा", | ||
"invalid_username": "आवश्यक. १५० अक्षरे किंवा त्याहून कमी. फक्त अक्षरे, अंक आणि @/./+/-/_", | ||
"invalid_password": "पासवर्डसाठी आवश्यक बाबी नाहीत", | ||
"invalid_email": "वैध ईमेल पत्ता प्रविष्ट करा.", | ||
"invalid_phone": "वैध दूरध्वनी क्रमांक प्रविष्ट करा.", | ||
"register_hospital": "हॉस्पिटलचे नाव नोंदवा", | ||
"register_page_title": "हॉस्पिटल व्यवस्थापक म्हणून नोंदणी करा", | ||
"auth_login_title": "अधिकृत लॉगिन", | ||
"back_to_login": "लॉगिन पृष्ठावर परत या", | ||
"available_in": "उपलब्ध भाषा", | ||
"forget_password": "पासवर्ड विसरलात?", | ||
"forget_password_instruction": "युजरनेम प्रविष्ट करा आणि आम्ही तुम्हाला पासवर्ड रीसेट करण्यासाठी एक लिंक पाठवू.", | ||
"send_reset_link": "रीसेट लिंक पाठवा", | ||
"already_a_member": "आधीपासून सदस्य आहात?", | ||
"password_sent": "पासवर्ड रिसेट झाला इमेल पाठवला", | ||
"password_reset_success": "पासवर्ड यशस्वीपणे रिसेट झाला", | ||
"password_reset_failure": "पासवर्ड रिसेट झाला नाही", | ||
"reset_password": "रिसेट पासवर्ड", | ||
"sign_out": "साइन आउट", | ||
"goal": "डिजिटल साधनांचा वापर करून सार्वजनिक आरोग्य सेवांची गुणवत्ता आणि सुलभता सतत सुधारणे हे आमचे ध्येय आहे.", | ||
"something_wrong": "काहीतरी चूक झाली! पुन्हा प्रयत्न करा", | ||
"contribute_github": "Github वर योगदान द्या", | ||
"footer_body": "कोरोनासेफ नेटवर्क ही एक मुक्त-स्त्रोत सार्वजनिक सुविधा आहे जी केरळ सरकारच्या पूर्ण मदतीने आणि समर्थनासह सरकारच्या प्रयत्नांना पाठिंबा देण्यासाठी मॉडेलवर काम करणारे नवीन-स्वयंसेवक आणि स्वयंसेवकांच्या एकाधिक-शिस्तबद्ध टीमद्वारे डिझाइन केलेले आहे.", | ||
"reset": "रीसेट करा", | ||
"downloads": "डाउनलोड", | ||
"download_type": "डाउनलोड प्रकार", | ||
"State": "राज्य", | ||
"Assets": "मालमत्ता", | ||
"Dashboard": "डॅशबोर्ड", | ||
"District": "जिल्हा", | ||
"Facilities": "हॉस्पिटल", | ||
"Facility Type": "हॉस्पिटल प्रकार", | ||
"KASP Empanelled": "KASP समिती ", | ||
"Local Body": "स्थानिक संस्था", | ||
"Location": "स्थान", | ||
"Ward": "वॉर्ड", | ||
"Notice Board": "सूचना फलक", | ||
"Assets": "मालमत्ता", | ||
"Notifications": "अधिसूचना", | ||
"Facilities": "हॉस्पिटल", | ||
"Patients": "रुग्ण", | ||
"Profile": "प्रोफाइल", | ||
"Resource": "संसाधन", | ||
"Sample Test": "नमुना तपासणी ", | ||
"Shifting": "शिफ्टिंग", | ||
"Resource": "संसाधन", | ||
"State": "राज्य", | ||
"Users": "युजर्स", | ||
"Profile": "प्रोफाइल", | ||
"Dashboard": "डॅशबोर्ड", | ||
"facility_search_placeholder": "हॉस्पिटल / जिल्हा यानुसार शोध घ्या", | ||
"advanced_filters": "अद्ययावत फिल्टर ", | ||
"Facility Type": "हॉस्पिटल प्रकार", | ||
"KASP Empanelled": "KASP समिती ", | ||
"View Facility": "हॉस्पिटल पाहा", | ||
"Ward": "वॉर्ड", | ||
"advanced_filters": "अद्ययावत फिल्टर ", | ||
"age": "वय", | ||
"already_a_member": "आधीपासून सदस्य आहात?", | ||
"auth_login_title": "अधिकृत लॉगिन", | ||
"available_in": "उपलब्ध भाषा", | ||
"back_to_login": "लॉगिन पृष्ठावर परत या", | ||
"confirm_password": "पासवर्डची खात्री करा", | ||
"contribute_github": "Github वर योगदान द्या", | ||
"create_facility": "नवीन हॉस्पिटल सुविधा निर्माण करा", | ||
"district": "जिल्हा", | ||
"download_type": "डाउनलोड प्रकार", | ||
"downloads": "डाउनलोड", | ||
"email": "ई-मेल पत्ता", | ||
"enter_valid_age": "वैध वय प्रविष्ट करा", | ||
"facility_search_placeholder": "हॉस्पिटल / जिल्हा यानुसार शोध घ्या", | ||
"field_required": "हे भरणे आवश्यक आहे", | ||
"first_name": "नाव", | ||
"footer_body": "कोरोनासेफ नेटवर्क ही एक मुक्त-स्त्रोत सार्वजनिक सुविधा आहे जी केरळ सरकारच्या पूर्ण मदतीने आणि समर्थनासह सरकारच्या प्रयत्नांना पाठिंबा देण्यासाठी मॉडेलवर काम करणारे नवीन-स्वयंसेवक आणि स्वयंसेवकांच्या एकाधिक-शिस्तबद्ध टीमद्वारे डिझाइन केलेले आहे.", | ||
"forget_password": "पासवर्ड विसरलात?", | ||
"forget_password_instruction": "युजरनेम प्रविष्ट करा आणि आम्ही तुम्हाला पासवर्ड रीसेट करण्यासाठी एक लिंक पाठवू.", | ||
"gender": "लिंग", | ||
"goal": "डिजिटल साधनांचा वापर करून सार्वजनिक आरोग्य सेवांची गुणवत्ता आणि सुलभता सतत सुधारणे हे आमचे ध्येय आहे.", | ||
"invalid_email": "वैध ईमेल पत्ता प्रविष्ट करा.", | ||
"invalid_password": "पासवर्डसाठी आवश्यक बाबी नाहीत", | ||
"invalid_phone": "वैध दूरध्वनी क्रमांक प्रविष्ट करा.", | ||
"invalid_username": "आवश्यक. १५० अक्षरे किंवा त्याहून कमी. फक्त अक्षरे, अंक आणि @/./+/-/_", | ||
"last_name": "आडनाव", | ||
"login": "लॉगिन", | ||
"new_password": "नवीन पासवर्ड", | ||
"no_duplicate_facility": "बनावट हॉस्पिटल सुविधा मुळीच तयार करू नका", | ||
"no_facilities": "कोणतेही हॉस्पिटल नाही", | ||
"create_facility": "नवीन हॉस्पिटल सुविधा निर्माण करा" | ||
} | ||
"password": "पासवर्ड", | ||
"password_mismatch": "\"पासवर्ड\" आणि \"पासवर्डची खात्री करा\" दोन्ही सारखे हवेत.", | ||
"password_reset_failure": "पासवर्ड रिसेट झाला नाही", | ||
"password_reset_success": "पासवर्ड यशस्वीपणे रिसेट झाला", | ||
"password_sent": "पासवर्ड रिसेट झाला इमेल पाठवला", | ||
"phone_number": "दूरध्वनी क्रमांक", | ||
"register_hospital": "हॉस्पिटलचे नाव नोंदवा", | ||
"register_page_title": "हॉस्पिटल व्यवस्थापक म्हणून नोंदणी करा", | ||
"reset": "रीसेट करा", | ||
"reset_password": "रिसेट पासवर्ड", | ||
"send_reset_link": "रीसेट लिंक पाठवा", | ||
"sign_out": "साइन आउट", | ||
"something_wrong": "काहीतरी चूक झाली! पुन्हा प्रयत्न करा", | ||
"username": "युजरनेम" | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For performance we could have chosen just to do it for EN; others would be auto managed by crowdin; just a thought