Skip to content
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

feat: add unused translations check to CI #938

Closed
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ca58471
feat: add unused translations check to CI
devin-ai-integration[bot] Jan 28, 2025
fdaadb0
refactor: remove unused translation keys and update script to use asy…
devin-ai-integration[bot] Jan 28, 2025
3977c63
refactor: remove unused translation keys
devin-ai-integration[bot] Jan 29, 2025
50a5215
refactor: remove unused translation keys and update script
devin-ai-integration[bot] Jan 29, 2025
9568b89
refactor: remove all unused translation keys
devin-ai-integration[bot] Jan 29, 2025
e8339f8
fix: restore required translation keys for tests
devin-ai-integration[bot] Jan 29, 2025
d99ebc2
fix: update register.json with all supported address placeholders
devin-ai-integration[bot] Jan 29, 2025
29a73af
fix: update steps.json to remove duplicate translation keys
devin-ai-integration[bot] Jan 29, 2025
336f90b
fix: remove empty placeholder object from steps.json
devin-ai-integration[bot] Jan 29, 2025
60d71bb
fix: improve unused translations detection to handle duplicate keys
devin-ai-integration[bot] Jan 29, 2025
5a317b4
fix: improve unused translations detection to handle empty files
devin-ai-integration[bot] Jan 29, 2025
a47472c
fix: remove unused address placeholder translations
devin-ai-integration[bot] Jan 29, 2025
15268e8
fix: restore address placeholders required by tests
devin-ai-integration[bot] Jan 29, 2025
d4f2619
fix: restore address label required by tests
devin-ai-integration[bot] Jan 29, 2025
8cfd027
refactor: remove hardcoded translation keys from removeUnusedTranslat…
devin-ai-integration[bot] Jan 29, 2025
b403d61
feat: improve error messaging for unused translation keys
devin-ai-integration[bot] Jan 29, 2025
7f23ab5
fix: improve key removal logic in removeUnusedTranslations script
devin-ai-integration[bot] Jan 29, 2025
bbadbc0
fix: remove unused translation key profile.options.groups.address.label
devin-ai-integration[bot] Jan 29, 2025
7277bd8
fix: only flag leaf nodes as unused translation keys
devin-ai-integration[bot] Jan 29, 2025
d9acc85
feat: add unused translations check to build process
devin-ai-integration[bot] Jan 29, 2025
eb25a1f
fix: restore translation files and selectively remove unused keys
devin-ai-integration[bot] Jan 29, 2025
854a1ac
fix: remove all unused translation keys
devin-ai-integration[bot] Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove all unused translation keys
Co-Authored-By: Leon Talbert <[email protected]>
devin-ai-integration[bot] and LeonmanRolls committed Jan 29, 2025
commit 9568b89fec482fbd08c2a34292d5750e55d1524b
8 changes: 1 addition & 7 deletions public/locales/en/address.json
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
{
"meta": {
"title": "{{address}} on ENS",
"description": "All names for {{address}} on the Ethereum Name Service"
},
"nameCount": "{{count}} names"
}
{}
216 changes: 1 addition & 215 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,215 +1 @@
{
"title": "Your web3 username",
"description": "Your identity across web3, one name for all your crypto addresses, and your decentralised website.",
"loading": "Loading",
"unsupportedNetwork": "Unsupported network",
"notFound": "404 Not Found",
"etherscan": "Etherscan",
"action": {
"cancel": "Cancel",
"close": "Close",
"save": "Save",
"view": "View",
"learnMore": "Learn more",
"next": "Next",
"add": "Add",
"search": "Search",
"back": "Back",
"continue": "Continue",
"confirm": "Confirm",
"done": "Done",
"delete": "Delete",
"sort": "Sort",
"claim": "Claim",
"understand": "I understand"
},
"unit": {},
"navigation": {
"names": "My Names",
"settings": "Settings",
"language": "Language",
"currency": "Currency",
"syncMessage": "Syncing with the network. Changes from your transaction may not be visible yet."
},
"wallet": {
"myProfile": "Profile",
"disconnect": "Disconnect",
"connect": "Connect",
"viewProfile": "View Profile",
"viewDetails": "View Details"
},
"name": {
"registered": "Registered",
"noExpiry": "No expiry",
"noParent": "No parent",
"owner": "Owner",
"notOwned": "Not Owned",
"manager": "Manager",
"copy": "Copy name",
"yourPrimaryName": "Your primary name"
},
"address": {
"label": "Address",
"viewAddress": "View address",
"copyAddress": "Copy address"
},
"records": {
"label": "Records"
},
"errors": {
"noResults": "No results found",
"emailRequired": "Email is required",
"emailInvalid": "Invalid email address",
"invalidAddress": "Invalid address",
"addressRequired": "Address required",
"indexingErrors": {
"title": "Error syncing data",
"message": "This data may be out of date. Please use caution.",
"message_datetime": "This data was last update at {{datetime}} and may be out of date. Please use caution"
},
"networkError": {
"title": "Error syncing data",
"message": "This data may be out of date. Please use caution.",
"blurb": "This button is currently disabled due to data sync issues."
},
"networkLatency": {
"title": "Slow data syncing",
"message": "The ENS app is experiencing slow downs due to network latency issues."
}
},
"transaction": {
"info": {
"sendName": "Set the controller and registrant of the name",
"migrateProfile": "Set existing records on new resolver",
"wrapName": "Wrap the name",
"updateResolver": "Change resolver to",
"updateProfile": "Update records on existing resolver",
"setPrimaryName": "Set the primary name for your address",
"updateEthAddress": "Update ETH address to this address",
"createSubname": "Create a new subname on the name",
"burnFuses": "Burn the chosen permissions until name expiry",
"commitName": "Start timer to register name",
"approveNameWrapper": "Approve the NameWrapper to manage your names"
},
"itemLabel": {
"name": "Name",
"address": "Address",
"action": "Action",
"info": "Info",
"to": "To",
"subname": "Subname",
"duration": "Duration",
"cost": "Cost",
"update": "Update",
"resolver": "Resolver",
"records": "Records",
"record": "Record"
},
"itemValue": {
"records_one": "{{count}} record",
"records_other": "{{count}} records"
},
"status": {
"pending": {
"regular": "Pending"
},
"confirmed": {
"regular": "Confirmed",
"notifyTitle": "Transaction Successful",
"notifyMessage": "Your \"{{action}}\" transaction was successful"
},
"failed": {
"regular": "Failed",
"notifyTitle": "Transaction Failure",
"notifyMessage": "Your \"{{action}}\" transaction failed and was reverted"
}
},
"dialog": {
"intro": {
"trailingButton": "Start",
"trailingButtonResume": "Resume",
"step": "Step {{step}}"
},
"confirm": {
"title": "Confirm Details",
"message": "Double check these details before confirming in your wallet.",
"waitingForWallet": "Waiting for Wallet",
"openWallet": "Open Wallet",
"insufficientFunds": "Insufficient funds"
},
"sent": {
"title": "Transaction Sent",
"message": "Your transaction is now in progress, you can close this and come back later.",
"progress": {
"title": "Sent",
"message": "Taking longer than expected"
},
"learn": "Learn about long running transactions"
},
"complete": {
"title": "Transaction Complete",
"message": "Your transaction is now complete!",
"progress": {
"title": "Done"
}
},
"failed": {
"title": "Transaction Failed",
"progress": {
"title": "Failed"
}
},
"error": {
"gasLimit": "The gas limit on your transaction wasn't high enough, please try again."
}
},
"error": {
"unknown": "An unknown error occurred"
},
"viewEtherscan": "View on Etherscan",
"viewMore": "View More"
},
"search": {
"label": "Name search",
"placeholder": "Search for a name",
"emptyText": "Type a name or address to search...",
"address": "Address",
"errors": {
"tooShort": "Name too short",
"invalid": "Invalid format for name"
},
"status": {
"registered": "Registered",
"gracePeriod": "Grace Period",
"premium": "Temporary Premium",
"available": "Available",
"notOwned": "Not Owned",
"notImported": "Not Imported",
"short": "Too Short",
"invalid": "Invalid"
}
},
"selectableInput": {
"add": "Add",
"placeholder": "Select an option",
"empty": "No options found"
},
"roles": {
"manager": {
"title": "manager",
"description": "An address or contract that can change the profile, settings, and profile managers."
}
},
"verification": {
"verifiedBy": "Verified by {{ issuer }}",
"personhoodVerified": "Personhood verified",
"verificationFailed": "Verification failed, please reverify your profile"
},
"verificationErrorDialog": {
"title": "Verification failed",
"resolverRequired": "A valid resolver is required to complete the verification flow",
"ownerNotManager": "You must be connected as the Manager of this name to set the verification record. You can view and update the Manager under the Ownership tab.",
"wrongAccount": "You must be connected as <strong>{{ nameOrAddress }}</strong> to set the verification record.",
"default": "We could't verify your account. Please return to Dentity and try again."
}
}
{}
70 changes: 1 addition & 69 deletions public/locales/en/dnssec.json
Original file line number Diff line number Diff line change
@@ -1,69 +1 @@
{
"title": "Import {{name}} into ENS",
"error": {
"unknown": "An unknown error occurred"
},
"status": {
"checking": "Checking...",
"error": "An error occurred while checking"
},
"steps": {
"selectType": {
"title": "Claim {{name}}",
"subtitle": "Importing domain names allows them to be used as ENS names.",
"select": {
"heading": "How would you like to import your domain?",
"offchain": {
"name": "Offchain",
"description": "Your name will not have an onchain token.<br/>This does not affect it's ability to receive transactions or be used as a primary name.<br/><b>You will not be able to edit your profile from within the ENS app.</b>"
},
"onchain": {
"name": "Onchain",
"description": "Your name will have an onchain token."
}
}
},
"enableDnssec": {
"title": "Enable DNSSEC",
"status": {
"enabled": "DNSSEC is enabled on this domain.",
"disabled": {
"heading": "You'll need to visit your domain registrar to enable DNSSEC.",
"message": "DNSSEC is not enabled"
}
}
},
"verifyOwnership": {
"title": "Verify Ownership",
"status": {
"disconnected": "Connect your wallet to verify ownership.",
"mismatching": {
"heading": "Add the DNS record below to verify your ownership of this domain.",
"message": "No record found"
},
"matching": "A record matching your connected address was found."
}
},
"transaction": {
"mismatching": {
"title": "Import this domain",
"subtitle": "Your ownership has <b>not</b> been verified. You can still import this domain."
},
"matching": {
"title": "Claim your domain",
"subtitle": "Your ownership has been verified."
}
},
"complete": {
"title": "Congratulations!",
"import": {
"subtitle": "<gradient>{{name}}</gradient> has been imported",
"description": "This domain has been successfully imported into ENS. You can now view this name."
},
"claim": {
"subtitle": "You are now the owner of <gradient>{{name}}</gradient>",
"description": "Your domain has been successfully claimed. You can now view and manage your name."
}
}
}
}
{}
29 changes: 1 addition & 28 deletions public/locales/en/ensv2.json
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
{
"title": "Namechain is a Layer 2 designed for onchain identity",
"caption": "Built for everyone tired of addresses, numbers, and complexity. Namechain lets users and developers create onchain identities through the power of names, not numbers.",
"accessible": {
"title": "Making ENS accessible to more people",
"gas": {
"title": "Lower Gas Costs",
"text": "Layer 2 reduces gas fees, making .eth registrations and renewals cheaper and faster."
},
"control": {
"title": "Enhanced Control",
"text": "ENSv2 gives each .eth name its own registry, offering more flexibility and control."
}
},
"learn-more": {
"title": "Want to learn more?",
"caption": "If you’re interested in learning more and building on Namechain, join the ENS Developer Telegram.",
"button": "Developer Telegram"
},

"footer": {
"title": "Got questions?",
"learn": {
"title": "Learn",
"plan": "ENSv2 Project Plan"
}
}
}
{}
5 changes: 1 addition & 4 deletions public/locales/en/names.json
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"title": "Names",
"empty": "No names found for this address"
}
{}
97 changes: 1 addition & 96 deletions public/locales/en/profile.json
Original file line number Diff line number Diff line change
@@ -1,96 +1 @@
{
"meta": {
"title": "{{name}} on ENS",
"description": "{{name}}'s profile on the Ethereum Name Service"
},
"title": "Profile",
"yourWallet": "Your wallet",
"yourProfile": "Your profile",
"accounts": "Accounts",
"addresses": "Addresses",
"otherRecords": "Other Records",
"verifications": "Verifications",
"editProfile": "Edit Profile",
"ownership": "Ownership",
"viewDetails": "View Details",
"banner": {
"empty": {
"title": "Personalize your profile",
"description": "Add crypto addresses, social links, an avatar and more!",
"action": "Get started"
}
},
"tabs": {
"profile": {
"name": "Profile",
"actions": {
"setAsPrimaryName": {
"label": "Set as primary name",
"title": "Set your primary name",
"description": "To set your primary name to this name, the ETH address must match this address."
},
"deleteSubname": {
"label": "Delete subname"
},
"extend": {
"label": "Extend name"
},
"editProfile": {
"label": "Edit profile"
},
"verifyProfile": {
"label": "Verifications"
}
},
"warnings": {
"wrappedDNS": "DNS names can be reclaimed by the DNS owner at any time. Do not purchase DNS names.",
"offchain": "Offchain names do not currently appear in your 'Names' list. <a>Learn more</a>"
}
},
"records": {
"name": "Records"
},
"ownership": {
"name": "Ownership",
"warning": {},
"sections": {
"roles": {
"title": "Roles"
}
}
},
"subnames": {
"name": "Subnames"
}
},
"details": {
"title": "Name Details",
"notWrapped": "Not wrapped",
"tabs": {
"records": {
"label": "Records",
"text": "Text",
"contentHash": "Content Hash"
},
"subnames": {
"label": "Subnames",
"loading": "Loading subnames",
"empty": "No subnames have been added",
"noResults": "No results",
"addSubname": {
"title": "Subnames let you create additional names from your existing name.",
"action": "New subname"
}
}
}
},
"errors": {
"invalidName": "This name is invalid.",
"invalidAddress": "Not a valid address",
"unknown": "Unknown error",
"keyInUse": "{{value}} is already in use",
"hasSubnames": "This name has subnames",
"isOwnerCannotEdit": "You must be the manager in order to edit the profile",
"cannotEdit": "You do not have permission to update to an authorised resolver"
}
}
{}
107 changes: 1 addition & 106 deletions public/locales/en/register.json
Original file line number Diff line number Diff line change
@@ -1,106 +1 @@
{
"title": "Register {{name}} on ENS",
"subtitle": "Register",
"heading": "Register {{name}}",
"invoice": {
"estimatedNetworkFee": "Est. network fee",
"transactionFees": "Transaction fees",
"temporaryPremium": "Temporary premium",
"total": "Estimated total",
"expiry": "Name expires"
},
"error": {
"nameTooLong": "The name you want to register is too long. Please choose a shorter name."
},
"steps": {
"pricing": {
"insufficientBalance": "Insufficient Balance",
"multipleYearsMessage": "Extending for multiple years will save money on network costs by avoiding yearly transactions.",
"primaryName": "Use as primary name",
"premium": {
"heading": "This name has a temporary premium",
"subheading": "To give fair opportunity to recently expired names, the premium starts at $100,000,000 and reduces to $0 over 21 days. You can calculate the premium on a date below.",
"targetPrice": "Target price"
}
},
"profile": {
"title": "Create your profile",
"title2": "Edit your profile",
"default": "Default",
"advanced": "Advanced",
"permissions": "Permissions",
"resolver": "Resolver",
"visibilityMessage": "Your profile information will be stored on the blockchain. Anything you add will be publicly visible.",
"addProfile": "Add profile fields",
"addMore": "Add more to profile",
"options": {
"groups": {
"address": {
"label": "Address",
"itemLabel": "{{coin}} address",
"placeholder": {
"default": "Add address here",
"eth": "0xb8c2C2...",
"btc": "3FZbgi29...",
"sol": "D4kA7VzHnmV...",
"op": "0xb8c2C2...",
"arb1": "0xb8c2C2...",
"base": "0xb8c2C2...",
"matic": "0xb8c2C2...",
"linea": "0xb8c2C2...",
"scr": "0xb8c2C2..."
}
}
}
},
"errors": {
"labelRequired": "A record key is required",
"duplicateRecord": "Duplicate record key"
},
"confirmations": {
"publicNotice": {
"title": "Your details are public",
"description": "Anything you add to your profile will be publicly viewable on the blockchain.",
"confirm": "I understand",
"decline": "Back"
}
},
"actions": {
"skipProfile": "Skip profile"
}
},
"complete": {
"heading": "Congratulations!",
"subheading": "You are now the owner of ",
"registerAnother": "Register another"
},
"info": {
"heading": "Before we start",
"subheading": "Registering your name takes three steps",
"ethItems": [
"Complete a transaction to begin the timer",
"Wait 60 seconds for the timer to complete",
"Complete a second transaction to secure your name"
],
"setupProfile": "I'd like to set up my profile first",
"notEnoughEth": "Not enough ETH in wallet",
"ethereum": "Ethereum"
},
"transactions": {
"heading": "Almost there",
"subheading": {
"default": "You will need to complete two transactions to secure your name. The second transaction must be completed within 24 hours of the first.",
"commitSent": "<strong>Your first transaction is in progress.</strong><br> The second transaction must be completed within 24 hours of the first.",
"commiting": "This wait prevents others from <tooltip>front running</tooltip> your transaction. You will be prompted to complete a second transaction when the timer is complete.",
"commitComplete": "<strong>Your name is not registered until you've completed the second transaction.</strong><br> You have {{duration}} remaining to complete it."
},
"startTimer": "Start timer",
"wait": "Wait",
"completeRegistration": "Complete registration"
},
"cancelRegistration": {
"heading": "You will lose your transaction",
"contentOne": "Going back will reset your first transaction. If you go back you will need to complete the transaction again and pay the associated fees."
}
}
}
{}
17 changes: 1 addition & 16 deletions public/locales/en/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
{
"title": "Settings",
"section": {
"privacy": {
"title": "Privacy",
"action": {
"clearHistory": "Clear search history"
}
},
"primary": {
"title": "Primary Name",
"noNameDescription": "A primary name links your address to a name, allowing dApps to display a name as your profile when connected to them. Learn about primary names",
"choosePrimaryName": "Choose primary name"
}
}
}
{}

Unchanged files with check annotations Beta

const hasTranslation = supportedAddresses.every((coin) => {
const key =
coin as keyof typeof registerI18n.steps.profile.options.groups.address.placeholder
return !!registerI18n.steps.profile.options.groups.address.placeholder[key]

Check failure on line 431 in src/hooks/useProfileEditorForm.test.ts

GitHub Actions / coverage

src/hooks/useProfileEditorForm.test.ts > useProfileEditorForm > supportedAddress > should have a custom placeholder for supported address record

TypeError: Cannot read properties of undefined (reading 'profile') ❯ src/hooks/useProfileEditorForm.test.ts:431:37 ❯ src/hooks/useProfileEditorForm.test.ts:428:49
})
expect(hasTranslation).toBe(true)
})