-
Notifications
You must be signed in to change notification settings - Fork 33
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
[SLT-145] feat(synapse-interface): Adds internationalization #3096
Conversation
* /messages folder to hold translations * getStaticProps across pages to fetch locales
WalkthroughThe changes introduce internationalization support across various components of the Synapse interface by integrating the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant LanguageSelector
participant App
participant Translations
User->>LanguageSelector: Selects language
LanguageSelector->>App: Update locale
App->>Translations: Fetch translations for selected language
Translations-->>App: Return localized strings
App->>User: Render UI with localized content
Tip New featuresWalkthrough comment now includes:
Notes:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Deploying sanguine-fe with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3096 +/- ##
=============================================
Coverage 90.56974% 90.56974%
=============================================
Files 54 54
Lines 1018 1018
Branches 82 82
=============================================
Hits 922 922
Misses 93 93
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Bundle ReportChanges will increase total bundle size by 70.0kB (0.2%) ⬆️. This is within the configured threshold ✅ Detailed changes
ℹ️ *Bundle size includes cached data from a previous commit |
Deploying sanguine with Cloudflare Pages
|
62a1334
to
d53bec9
Compare
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.
Actionable comments posted: 14
Outside diff range, codebase verification and nitpick comments (9)
packages/synapse-interface/components/ApyTooltip.tsx (1)
39-39
: Missing translation keys in JSON filesThe translation keys 'Rewards', 'Daily APR', 'Weekly APR', 'Yearly APR', and 'Yearly APY' are not present in the translation JSON files located in
packages/synapse-interface/messages/
. Please ensure these keys are added to the translation files for all supported languages to avoid missing translations in the UI.
- Files to update: All JSON files in
packages/synapse-interface/messages/
Analysis chain
Proper use of translation hook and keys.
The
useTranslations
hook is correctly scoped to 'Pools', and the translation keys for various APR and APY terms are used appropriately. Ensure that the translation keys for 'Rewards', 'Daily APR', 'Weekly APR', 'Yearly APR', and 'Yearly APY' exist in the JSON files for all supported languages.Also applies to: 43-43, 54-54, 59-59, 64-64, 69-69
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of APR and APY translation keys in all JSON files. # Test: Search for the APR and APY keys in all JSON files. Expect: Keys should exist in all files. fd '.*\.json$' messages --exec grep -H '"Rewards"|"Daily APR"|"Weekly APR"|"Yearly APR"|"Yearly APY"' {}Length of output: 204
Script:
#!/bin/bash # Step 1: Locate JSON files in the repository to find the correct directory for translations. fd --extension json # Step 2: Once the directory is found, search for the translation keys within those files. # This step will be executed after identifying the correct directory.Length of output: 13319
Script:
#!/bin/bash # Search for the translation keys in the identified JSON files within the messages directory. grep -H '"Rewards"|"Daily APR"|"Weekly APR"|"Yearly APR"|"Yearly APY"' packages/synapse-interface/messages/*.jsonLength of output: 386
packages/synapse-interface/pages/_app.tsx (1)
49-77
: Proper integration ofNextIntlClientProvider
with dynamic locale handling.The
NextIntlClientProvider
is correctly set up to use the router's locale and messages frompageProps
, which is essential for dynamic internationalization support. ThetimeZone
is set to "UTC", which is a common practice but consider allowing user-specific time zones if your application requires such flexibility.packages/synapse-interface/pages/landing/sections/IntegrationSection.tsx (1)
Missing Translation Keys in JSON Files
The translation keys "Widely integrated", "Synapse is", and "Layer" are not defined in the JSON files within the
packages/synapse-interface/messages
directory. This absence may lead to missing translations in the application. Please ensure these keys are added to the relevant translation files for all supported languages.
- Files to update: All JSON files in
packages/synapse-interface/messages
.Analysis chain
Line range hint
21-120
: Effective use ofuseTranslations
for dynamic localization.The integration of the
useTranslations
hook and the replacement of hardcoded strings with translation keys inIntegrationSection
andNetworkCard
are well-implemented. This change enhances the flexibility and accessibility of the interface for multiple languages.Ensure that all translation keys used (
Widely integrated
,Synapse is
,Layer
) are defined in the corresponding JSON files for each supported language to avoid missing translations.Run the following script to verify the completeness of translation keys across all JSON files:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all translation keys are defined in each JSON file. # Test: Search for missing translation keys in JSON files. Expect: No missing keys. fd '.*\.json$' messages --exec jq 'has("Widely integrated", "Synapse is", "Layer")'Length of output: 181
Script:
#!/bin/bash # Locate JSON files that might contain translation keys and verify the presence of specific keys. # Find all JSON files in the repository. fd --extension json # Verify the presence of translation keys in the located JSON files. fd --extension json --exec jq 'has("Widely integrated", "Synapse is", "Layer")'Length of output: 23464
Script:
#!/bin/bash # Verify the presence of translation keys in the specific messages directory. # Check for the presence of translation keys in the messages directory. fd --extension json packages/synapse-interface/messages --exec jq 'has("Widely integrated", "Synapse is", "Layer")'Length of output: 563
Script:
#!/bin/bash # Correctly search for JSON files in the messages directory and verify translation keys. # Use a match-all pattern to find JSON files in the messages directory. fd . packages/synapse-interface/messages --extension json --exec jq 'has("Widely integrated", "Synapse is", "Layer")'Length of output: 245
packages/synapse-interface/pages/pool/poolManagement/WithdrawButton.tsx (1)
Missing Translation Keys in JSON Files
The translation keys
insufficientBalance
,connectWallet
,switchChain
,approveToken
, andwithdraw
are missing in all the JSON files located inpackages/synapse-interface/messages
. Please ensure these keys are added to each language file to provide the intended localized messages for theWithdrawButton
component.
- Files to update:
packages/synapse-interface/messages/ar.json
packages/synapse-interface/messages/en-US.json
packages/synapse-interface/messages/es.json
packages/synapse-interface/messages/fr.json
packages/synapse-interface/messages/jp.json
packages/synapse-interface/messages/tr.json
packages/synapse-interface/messages/zh-CN.json
Analysis chain
Line range hint
16-85
: Dynamic label internationalization inWithdrawButton
.The use of
useTranslations
to dynamically set labels and pending labels based on the button state is correctly implemented. This enhances the user experience by providing localized messages based on the current state of the button.Ensure that all translation keys used (
insufficientBalance
,connectWallet
,switchChain
,approveToken
,withdraw
) are defined in the corresponding JSON files for each supported language to avoid missing translations.Run the following script to verify the completeness of translation keys across all JSON files:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all translation keys are defined in each JSON file. # Test: Search for missing translation keys in JSON files. Expect: No missing keys. fd '.*\.json$' messages --exec jq 'has("insufficientBalance", "connectWallet", "switchChain", "approveToken", "withdraw")'Length of output: 220
Script:
#!/bin/bash # Locate JSON files in the repository to find the correct directory for translations. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Verify that all translation keys are defined in each JSON file in the correct directory. # Define the translation keys to check keys=("insufficientBalance" "connectWallet" "switchChain" "approveToken" "withdraw") # Check each JSON file in the messages directory for the presence of all keys for file in packages/synapse-interface/messages/*.json; do echo "Checking $file" for key in "${keys[@]}"; do if ! jq -e "has(\"$key\")" "$file" > /dev/null; then echo "Missing key: $key in $file" fi done doneLength of output: 10380
packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx (1)
88-88
: Missing 'Router' Translation Key in JSON FilesThe 'Router' translation key is not present in any of the JSON files under
packages/synapse-interface/messages/
. This absence could affect the functionality of theRouter
component if it relies on this key for translations. Please ensure that the 'Router' key is added to the translation files to maintain consistency and functionality.
- Files Checked: All JSON files in
packages/synapse-interface/messages/
Analysis chain
Verify translation keys for Router component.
The translation key
'Router'
used in theRouter
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Also applies to: 91-91
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Router' translation key in all JSON files under `/messages`. fd '.json$' messages/ --exec jq 'has("Router")' {}Length of output: 151
Script:
#!/bin/bash # Step 1: Locate JSON files in the repository to find the directory containing translation files. fd '.json$' # Step 2: Once the directory is identified, verify the presence of the 'Router' key in those files. # This step will be executed after identifying the correct directory.Length of output: 13311
Script:
#!/bin/bash # Verify the presence of the 'Router' translation key in all JSON files under `packages/synapse-interface/messages/`. fd '.json$' packages/synapse-interface/messages/ --exec jq 'has("Router")' {}Length of output: 123
packages/synapse-interface/components/Activity/Activity.tsx (2)
74-74
: Missing Translation Key: "No transactions in last 30 days."The translation key "No transactions in last 30 days." is not present in any of the JSON files under
packages/synapse-interface/messages/
. Please ensure that this key is added to the relevant translation files to maintain consistency and accuracy in translations.
- Files to update: All JSON files in
packages/synapse-interface/messages/
.Analysis chain
Verify translation key for "No transactions in last 30 days.".
The translation key
'No transactions in last 30 days.'
used in theActivity
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'No transactions in last 30 days.' translation key in all JSON files under `/messages`. fd '.json$' messages/ --exec jq 'has("No transactions in last 30 days.")' {}Length of output: 177
Script:
#!/bin/bash # Search for JSON files in the repository to identify potential directories for translation files. fd '.json$'Length of output: 13311
Script:
#!/bin/bash # Verify the presence of the 'No transactions in last 30 days.' translation key in JSON files under `packages/synapse-interface/messages/`. fd '.json$' packages/synapse-interface/messages/ --exec jq 'has("No transactions in last 30 days.")' {}Length of output: 149
80-80
: Translation Key "Recent" Missing in All Language FilesThe translation key "Recent" is not present in any of the JSON files under
packages/synapse-interface/messages/
. Please ensure that this key is added to all relevant translation files to maintain consistency and accuracy in translations.
- Files checked:
ar.json
,en-US.json
,es.json
,fr.json
,jp.json
,tr.json
,zh-CN.json
Analysis chain
Verify translation key for "Recent".
The translation key
'Recent'
used in theActivity
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Recent' translation key in all JSON files under `/messages`. fd '.json$' messages/ --exec jq 'has("Recent")' {}Length of output: 151
Script:
#!/bin/bash # Search for JSON files in the repository that might contain translation keys. fd '.json$' --exec echo {}Length of output: 13798
Script:
#!/bin/bash # Check for the presence of the 'Recent' translation key in each JSON file under `packages/synapse-interface/messages/`. for file in packages/synapse-interface/messages/*.json; do echo "Checking $file" jq 'has("Recent")' "$file" doneLength of output: 1718
packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx (1)
101-101
: Approve the addition of theLanguageSelector
and suggest reviewing its placement.The inclusion of the
LanguageSelector
in both the desktop and mobile versions of the navigation bar is a positive step towards enhancing accessibility for users with different language preferences. Consider reviewing the placement and integration of theLanguageSelector
to ensure it does not disrupt the overall layout and user experience.Also applies to: 145-145
packages/synapse-interface/pages/pool/poolManagement/DepositButton.tsx (1)
Add null check for
targetChain
usageThe
targetChain
variable is accessed without a null check in theDepositButton.tsx
file. To prevent potential runtime errors, ensure thattargetChain
is notundefined
before accessing its properties, such astargetChain.name
.
- File:
packages/synapse-interface/pages/pool/poolManagement/DepositButton.tsx
- Lines: Ensure a null check is added before accessing
targetChain.name
.Analysis chain
Line range hint
17-113
: Approved internationalization enhancements with a suggestion.The integration of the
useTranslations
hook and the introduction of thetargetChain
variable are well-implemented. However, ensure thattargetChain
is notundefined
before accessing its properties to avoid runtime errors.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for null checks around `targetChain` usage. # Test: Search for null checks around `targetChain` usage. Expect: Proper null checks. rg --type typescript -A 5 $'targetChain'Length of output: 74
Script:
#!/bin/bash # Description: Check for null checks around `targetChain` usage. # Test: Search for null checks around `targetChain` usage. Expect: Proper null checks. rg --type ts -A 5 $'targetChain'Length of output: 11996
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (105)
- packages/synapse-interface/.eslintrc-i18n.js (1 hunks)
- packages/synapse-interface/README.md (4 hunks)
- packages/synapse-interface/components/Activity/Activity.tsx (2 hunks)
- packages/synapse-interface/components/Activity/Transaction/components/Completed.tsx (3 hunks)
- packages/synapse-interface/components/Activity/Transaction/components/EstimatedDuration.tsx (3 hunks)
- packages/synapse-interface/components/Activity/Transaction/components/TransactionExplorerLink.tsx (2 hunks)
- packages/synapse-interface/components/ApyTooltip.tsx (5 hunks)
- packages/synapse-interface/components/ConnectionIndicators.tsx (6 hunks)
- packages/synapse-interface/components/InteractiveInputRow.tsx (4 hunks)
- packages/synapse-interface/components/LanguageSelector.tsx (1 hunks)
- packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx (3 hunks)
- packages/synapse-interface/components/Pools/PoolActionOptions.tsx (3 hunks)
- packages/synapse-interface/components/Pools/PoolHeader.tsx (4 hunks)
- packages/synapse-interface/components/Portfolio/components/ConnectWalletButton.tsx (2 hunks)
- packages/synapse-interface/components/Portfolio/components/EmptyPortfolioContent.tsx (2 hunks)
- packages/synapse-interface/components/Portfolio/components/GasTokenAsset.tsx (3 hunks)
- packages/synapse-interface/components/Portfolio/components/NoSearchResultContent.tsx (1 hunks)
- packages/synapse-interface/components/Portfolio/components/PortfolioAssetActionButton.tsx (3 hunks)
- packages/synapse-interface/components/Portfolio/components/PortfolioConnectButton.tsx (6 hunks)
- packages/synapse-interface/components/Portfolio/components/PortfolioContent.tsx (2 hunks)
- packages/synapse-interface/components/Portfolio/components/PortfolioTabManager.tsx (2 hunks)
- packages/synapse-interface/components/Portfolio/components/PortfolioTokenAsset.tsx (4 hunks)
- packages/synapse-interface/components/Portfolio/components/SearchBar.tsx (2 hunks)
- packages/synapse-interface/components/Portfolio/components/SingleNetworkPortfolio.tsx (3 hunks)
- packages/synapse-interface/components/Portfolio/components/ViewSearchAddressBanner.tsx (3 hunks)
- packages/synapse-interface/components/StateManagedBridge/AvailableBalance.tsx (2 hunks)
- packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx (10 hunks)
- packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx (5 hunks)
- packages/synapse-interface/components/StateManagedBridge/BridgeWarnings.tsx (2 hunks)
- packages/synapse-interface/components/StateManagedBridge/DestinationAddressInput.tsx (5 hunks)
- packages/synapse-interface/components/StateManagedBridge/FromChainSelector.tsx (2 hunks)
- packages/synapse-interface/components/StateManagedBridge/MaxButton.tsx (2 hunks)
- packages/synapse-interface/components/StateManagedBridge/OutputContainer.tsx (3 hunks)
- packages/synapse-interface/components/StateManagedBridge/SettingsSlideOver.tsx (5 hunks)
- packages/synapse-interface/components/StateManagedBridge/SettingsToggle.tsx (1 hunks)
- packages/synapse-interface/components/StateManagedBridge/hooks/useFromChainListArray.ts (3 hunks)
- packages/synapse-interface/components/StateManagedBridge/hooks/useFromTokenListArray.ts (3 hunks)
- packages/synapse-interface/components/StateManagedBridge/hooks/useToChainListArray.ts (2 hunks)
- packages/synapse-interface/components/StateManagedBridge/hooks/useToTokenListArray.ts (3 hunks)
- packages/synapse-interface/components/StateManagedSwap/SwapExchangeRateInfo.tsx (3 hunks)
- packages/synapse-interface/components/StateManagedSwap/SwapInputContainer.tsx (6 hunks)
- packages/synapse-interface/components/StateManagedSwap/SwapTransactionButton.tsx (4 hunks)
- packages/synapse-interface/components/Wallet.tsx (5 hunks)
- packages/synapse-interface/components/Warning.tsx (4 hunks)
- packages/synapse-interface/components/_Transaction/_Transaction.tsx (4 hunks)
- packages/synapse-interface/components/_Transaction/components/TimeRemaining.tsx (3 hunks)
- packages/synapse-interface/components/_Transaction/components/TransactionSupport.tsx (3 hunks)
- packages/synapse-interface/components/icons/LandingIcons/FauxBridge.tsx (6 hunks)
- packages/synapse-interface/components/input/DeadlineInput.tsx (2 hunks)
- packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx (6 hunks)
- packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx (8 hunks)
- packages/synapse-interface/components/layouts/StandardPageContainer.tsx (3 hunks)
- packages/synapse-interface/components/ui/ChainSelector.tsx (3 hunks)
- packages/synapse-interface/components/ui/NewTag.tsx (1 hunks)
- packages/synapse-interface/components/ui/SearchResults.tsx (1 hunks)
- packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx (1 hunks)
- packages/synapse-interface/components/ui/SelectorWrapper.tsx (3 hunks)
- packages/synapse-interface/components/ui/TranslatedText.tsx (1 hunks)
- packages/synapse-interface/messages/ar.json (1 hunks)
- packages/synapse-interface/messages/en-US.json (1 hunks)
- packages/synapse-interface/messages/es.json (1 hunks)
- packages/synapse-interface/messages/fr.json (1 hunks)
- packages/synapse-interface/messages/jp.json (1 hunks)
- packages/synapse-interface/messages/tr.json (1 hunks)
- packages/synapse-interface/messages/zh-CN.json (1 hunks)
- packages/synapse-interface/next.config.js (1 hunks)
- packages/synapse-interface/package.json (3 hunks)
- packages/synapse-interface/pages/_app.tsx (2 hunks)
- packages/synapse-interface/pages/index.tsx (2 hunks)
- packages/synapse-interface/pages/landing/index.tsx (2 hunks)
- packages/synapse-interface/pages/landing/sections/BridgeSection.tsx (1 hunks)
- packages/synapse-interface/pages/landing/sections/ExplorerSection.tsx (4 hunks)
- packages/synapse-interface/pages/landing/sections/HeroSection.tsx (3 hunks)
- packages/synapse-interface/pages/landing/sections/HowItWorksSection.tsx (2 hunks)
- packages/synapse-interface/pages/landing/sections/IntegrationSection.tsx (6 hunks)
- packages/synapse-interface/pages/landing/sections/ResourcesSection.tsx (1 hunks)
- packages/synapse-interface/pages/landing/sections/SecuritySection.tsx (1 hunks)
- packages/synapse-interface/pages/landing/sections/UseCasesSection.tsx (3 hunks)
- packages/synapse-interface/pages/pool/NoPoolBody.tsx (3 hunks)
- packages/synapse-interface/pages/pool/PoolBody.tsx (4 hunks)
- packages/synapse-interface/pages/pool/PoolInfoSection/CurrencyReservesCard.tsx (2 hunks)
- packages/synapse-interface/pages/pool/PoolInfoSection/index.tsx (5 hunks)
- packages/synapse-interface/pages/pool/[poolId].tsx (2 hunks)
- packages/synapse-interface/pages/pool/components/LiquidityManagementTabs.tsx (3 hunks)
- packages/synapse-interface/pages/pool/components/PriceImpactDisplay.tsx (3 hunks)
- packages/synapse-interface/pages/pool/components/ReceivedTokenSection.tsx (3 hunks)
- packages/synapse-interface/pages/pool/poolManagement/DepositButton.tsx (5 hunks)
- packages/synapse-interface/pages/pool/poolManagement/Withdraw.tsx (3 hunks)
- packages/synapse-interface/pages/pool/poolManagement/WithdrawButton.tsx (4 hunks)
- packages/synapse-interface/pages/pools/PoolCard.tsx (5 hunks)
- packages/synapse-interface/pages/pools/index.tsx (5 hunks)
- packages/synapse-interface/pages/returntomonke/ImageUploader.tsx (3 hunks)
- packages/synapse-interface/pages/returntomonke/PfpGeneratorCard.tsx (1 hunks)
- packages/synapse-interface/pages/returntomonke/index.tsx (2 hunks)
- packages/synapse-interface/pages/stake/StakeCard.tsx (10 hunks)
- packages/synapse-interface/pages/stake/[routerIndex].tsx (3 hunks)
- packages/synapse-interface/pages/stake/index.tsx (3 hunks)
- packages/synapse-interface/pages/state-managed-bridge/index.tsx (6 hunks)
- packages/synapse-interface/pages/swap/index.tsx (10 hunks)
- packages/synapse-interface/scripts/checkTranslationJsons.js (1 hunks)
- packages/synapse-interface/utils/actions/approveAndDeposit.tsx (7 hunks)
- packages/synapse-interface/utils/actions/approveAndStake.tsx (5 hunks)
- packages/synapse-interface/utils/actions/approveAndWithdraw.tsx (3 hunks)
- packages/synapse-interface/utils/actions/claimStake.tsx (3 hunks)
- packages/synapse-interface/utils/actions/withdrawStake.tsx (2 hunks)
Files not processed due to max files limit (2)
- packages/synapse-interface/utils/approveToken.tsx
- packages/synapse-interface/utils/hooks/useCloseOnEscape.ts
Files skipped from review due to trivial changes (4)
- packages/synapse-interface/messages/es.json
- packages/synapse-interface/messages/fr.json
- packages/synapse-interface/messages/tr.json
- packages/synapse-interface/messages/zh-CN.json
Additional context used
Biome
packages/synapse-interface/pages/returntomonke/PfpGeneratorCard.tsx
[error] 11-11: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
packages/synapse-interface/pages/returntomonke/ImageUploader.tsx
[error] 106-106: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
LanguageTool
packages/synapse-interface/README.md
[style] ~254-~254: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...component to include the new locale. 3. Update/messages/{locale.json}
with the new ...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Additional comments not posted (185)
packages/synapse-interface/pages/returntomonke/PfpGeneratorCard.tsx (2)
1-1
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is correctly added to enable internationalization features.
7-11
: Approved internationalization implementation inPfpGeneratorCard
.The use of the
useTranslations
hook and the translation functiont
to replace hardcoded strings with localized text is correctly implemented. This enhances the component's usability across different locales.Tools
Biome
[error] 11-11: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
packages/synapse-interface/components/StateManagedBridge/SettingsToggle.tsx (2)
1-1
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is correctly added to enable internationalization features.
10-19
: Approved internationalization implementation inSettingsToggle
.The use of the
useTranslations
hook and the translation functiont
to replace hardcoded strings with localized text is correctly implemented. This enhances the component's usability across different locales.packages/synapse-interface/components/ui/SearchResults.tsx (2)
1-1
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is correctly added to enable internationalization features.
4-12
: Approved internationalization implementation inSearchResults
.The use of the
useTranslations
hook and the translation functiont
to replace hardcoded strings with localized text is correctly implemented. This enhances the component's usability across different locales.packages/synapse-interface/components/StateManagedBridge/MaxButton.tsx (1)
15-19
: Approve the use of dynamic translations.The integration of
useTranslations
and the use oft('Max')
for dynamic button labeling are correctly implemented.Run the following script to verify the translation keys:
Verification successful
Translation key 'Max' is correctly implemented.
The translation key 'Max' is present in multiple language files, confirming that the dynamic translation setup in the
MaxButton
component is correctly implemented. No further action is needed.
- Translation key 'Max' found in:
./packages/synapse-interface/messages/zh-CN.json
./packages/synapse-interface/messages/jp.json
./packages/synapse-interface/messages/fr.json
./packages/synapse-interface/messages/tr.json
./packages/synapse-interface/messages/es.json
./packages/synapse-interface/messages/en-US.json
./packages/synapse-interface/messages/ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the translation keys in the 'Bridge' namespace. # Test: Search for the translation keys in the messages directory. Expect: Keys should exist in the JSON files. rg --type json -A 5 $'Max' ./messages/Length of output: 89
Script:
#!/bin/bash # Search for JSON files in the repository and check for the 'Max' translation key. fd --type f --extension json --exec rg --json -H -A 5 '"Max"' {}Length of output: 80377
packages/synapse-interface/components/Portfolio/components/PortfolioAssetActionButton.tsx (2)
1-1
: Correct import foruseTranslations
.The import of
useTranslations
fromnext-intl
is correctly implemented.
Line range hint
14-28
: Approve the use of dynamic translations with conditional rendering.The integration of
useTranslations
and the conditional use oft('Selected')
ort('Select')
based on theisSelected
prop are correctly implemented, enhancing the component's internationalization capabilities.Run the following script to verify the translation keys:
packages/synapse-interface/pages/pool/components/LiquidityManagementTabs.tsx (2)
1-1
: Correct import foruseTranslations
.The import of
useTranslations
fromnext-intl
is correctly implemented.
Line range hint
7-27
: Approve the use of dynamic translations for tab labels.The integration of
useTranslations
and the use oft('Add Liquidity')
andt('Remove Liquidity')
for dynamic tab labeling are correctly implemented, enhancing the component's internationalization capabilities.Run the following script to verify the translation keys:
Verification successful
Translation Keys Verified Successfully
The translation keys "Add Liquidity" and "Remove Liquidity" are correctly implemented and available in multiple languages within the JSON files in the repository. This confirms that the internationalization setup is functioning as intended.
- The keys are present and translated into several languages, ensuring proper localization support.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the translation keys in the 'Pools' namespace. # Test: Search for the translation keys in the messages directory. Expect: Keys should exist in the JSON files. rg --type json -A 5 $'Add Liquidity|Remove Liquidity' ./messages/Length of output: 118
Script:
#!/bin/bash # Find all JSON files in the repository and search for the translation keys. fd --type f --extension json --exec rg 'Add Liquidity|Remove Liquidity' {}Length of output: 632
packages/synapse-interface/components/StateManagedBridge/FromChainSelector.tsx (1)
14-21
: Internationalization Implemented CorrectlyThe use of
useTranslations
to dynamically translate the label "From" in theChainSelector
component is correctly implemented. Ensure that the translation key 'From' is consistently used across other components for uniformity.Run the following script to verify the consistency of the translation key 'From':
Verification successful
Translation Key 'From' Consistently Used Across Components
The translation key 'From' is consistently used across different components, specifically in contexts related to "Bridge" and "Swap" actions. This confirms the uniformity of the internationalization implementation. No further action is required.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the translation key 'From' across components. # Test: Search for the translation key 'From'. Expect: Consistent usage across components. rg --type tsx -A 5 $'t\\(\'From\'\\)'Length of output: 68
Script:
#!/bin/bash # Description: Verify the consistency of the translation key 'From' across components. # Find all .tsx files and search for the translation key 'From' within those files. fd --extension tsx --exec rg -A 5 $'t\\(\'From\'\\)' {}Length of output: 394
packages/synapse-interface/pages/landing/sections/HowItWorksSection.tsx (1)
Line range hint
7-21
: Internationalization Implemented CorrectlyThe use of
useTranslations
to dynamically translate the title and description in theHowItWorksSection
component is correctly implemented. Ensure that the translation keys 'How it all works' and 'description' are consistently used across other components for uniformity.Run the following script to verify the consistency of the translation keys 'How it all works' and 'description':
Verification successful
Translation Keys Verified
The translation keys 'How it all works' and 'description' are used consistently within the codebase. The key 'How it all works' is specific to the
HowItWorksSection
component, while 'description' is shared with theHeroSection
component. Ensure that the context for the 'description' key is appropriate in both components.
- Files:
packages/synapse-interface/pages/landing/sections/HowItWorksSection.tsx
packages/synapse-interface/pages/landing/sections/HeroSection.tsx
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the translation keys 'How it all works' and 'description' across components. # Test: Search for the translation keys. Expect: Consistent usage across components. rg --type tsx -A 5 $'t\\(\'How it all works\'\\)|t\\(\'description\'\\)'Length of output: 105
Script:
#!/bin/bash # Description: Verify the consistency of the translation keys 'How it all works' and 'description' across components. # Test: Search for the translation keys. Expect: Consistent usage across components. rg --type ts -A 5 $'t\\(\'How it all works\'\\)|t\\(\'description\'\\)'Length of output: 1578
packages/synapse-interface/components/Activity/Transaction/components/EstimatedDuration.tsx (1)
Line range hint
14-32
: Internationalization Implemented CorrectlyThe use of
useTranslations
to dynamically translate time-related text in theEstimatedDuration
component is correctly implemented. Ensure that the translation keys 'min' and 'Waiting' are consistently used across other components for uniformity.Run the following script to verify the consistency of the translation keys 'min' and 'Waiting':
Verification successful
Internationalization Implemented Consistently
The translation keys 'min' and 'Waiting' are consistently used across multiple components, confirming the correct implementation of internationalization in the
EstimatedDuration
component. Ensure that these keys are defined in the translation files for all supported languages.
- Files using 'min':
DeadlineInput.tsx
,SettingsSlideOver.tsx
,EstimatedDuration.tsx
- Files using 'Waiting':
TimeRemaining.tsx
,EstimatedDuration.tsx
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the translation keys 'min' and 'Waiting' across components. # Test: Search for the translation keys. Expect: Consistent usage across components. rg --type tsx -A 5 $'t\\(\'min\'\\)|t\\(\'Waiting\'\\)'Length of output: 88
Script:
#!/bin/bash # Description: Verify the consistency of the translation keys 'min' and 'Waiting' across components. # Find all .tsx files and search for the translation keys within those files. fd --extension tsx --exec rg -H -A 5 $'t\\(\'min\'\\)|t\\(\'Waiting\'\\)' {}Length of output: 3278
packages/synapse-interface/components/Portfolio/components/ViewSearchAddressBanner.tsx (2)
2-2
: Correct import for internationalization.The import of
useTranslations
fromnext-intl
is essential for enabling internationalization in this component.
15-16
: Proper use of internationalization hooks and functions.The
useTranslations
hook is correctly utilized to fetch translations for the 'Portfolio' namespace, and the dynamic translation of the "Viewing" string enhances the component's usability across different languages.Please ensure that the translation keys used (
'Viewing'
) are correctly defined in the respective JSON files under/messages
.Also applies to: 30-30
packages/synapse-interface/components/Activity/Transaction/components/TransactionExplorerLink.tsx (2)
3-3
: Correct import for internationalization.The import of
useTranslations
fromnext-intl
is essential for enabling internationalization in this component.
28-29
: Proper use of internationalization hooks and functions.The
useTranslations
hook is correctly utilized to fetch translations for the 'Activity' namespace, and the dynamic translation of the "Explorer" string enhances the component's usability across different languages.Please ensure that the translation keys used (
'Explorer'
) are correctly defined in the respective JSON files under/messages
.Also applies to: 36-36
packages/synapse-interface/components/_Transaction/components/TransactionSupport.tsx (2)
1-1
: Correct import for internationalization.The import of
useTranslations
fromnext-intl
is essential for enabling internationalization in this component.
6-6
: Proper use of internationalization hooks and functions.The
useTranslations
hook is correctly utilized to fetch translations for the 'Time' namespace, and the dynamic translation of various strings enhances the component's usability across different languages.Please ensure that the translation keys used (
'Transaction reverted, funds returned'
,'What's taking so long?'
,'FAQ'
,'Support'
) are correctly defined in the respective JSON files under/messages
.Also applies to: 14-16, 28-28, 39-39
packages/synapse-interface/pages/pool/NoPoolBody.tsx (1)
Line range hint
16-34
: Verify translation keys and approve internationalization changes.The integration of the
useTranslations
hook and the use of translation keys such as 'Switch to', 'to interact with the', and 'Invalid Pool ID' are correctly implemented to support internationalization. Ensure that these keys are properly defined in the respective JSON files in the/messages
directory.Run the following script to verify the presence of translation keys in the JSON files:
Also applies to: 41-41
Verification successful
Translation Keys Verified and Internationalization Confirmed
The translation keys "Switch to", "to interact with the", and "Invalid Pool ID" are correctly defined in the translation JSON files across multiple languages. The integration of the
useTranslations
hook inNoPoolBody.tsx
is properly implemented to support internationalization. No further action is required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Keys should be present in all language files. rg --type json -A 5 $'("Switch to"|"to interact with the"|"Invalid Pool ID")' /messagesLength of output: 138
Script:
#!/bin/bash # Locate JSON files that might contain translation keys. fd --type f --extension json # Once located, search for the translation keys in the identified JSON files. # This command will be executed after identifying the correct path.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys in the identified JSON files in the messages directory. rg --type json -A 5 $'("Switch to"|"to interact with the"|"Invalid Pool ID")' packages/synapse-interface/messages/Length of output: 8886
packages/synapse-interface/components/StateManagedBridge/AvailableBalance.tsx (1)
27-44
: Verify translation keys and approve internationalization changes.The integration of the
useTranslations
hook and the use of translation keys such as 'calculating gas' and 'Available' are correctly implemented to support internationalization. Ensure that these keys are properly defined in the respective JSON files in the/messages
directory.Run the following script to verify the presence of translation keys in the JSON files:
Verification successful
Translation keys are correctly implemented and verified.
The translation keys 'calculating gas' and 'Available' are present in the translation files for multiple languages, confirming the correct implementation of internationalization in the
AvailableBalance.tsx
component.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Keys should be present in all language files. rg --type json -A 5 $'("calculating gas"|"Available")' /messagesLength of output: 115
Script:
#!/bin/bash # Find all JSON files in the repository that might contain translation keys. fd --type f --extension jsonLength of output: 13328
Script:
#!/bin/bash # Search for the translation keys in the JSON files within the messages directory. rg --type json -A 5 $'("calculating gas"|"Available")' packages/synapse-interface/messagesLength of output: 8954
packages/synapse-interface/.eslintrc-i18n.js (1)
3-43
: Review of ESLint Configuration for InternationalizationThe new ESLint configuration file is well-structured for supporting internationalization by enforcing the use of the
i18next
plugin. This is crucial for ensuring that string literals are replaced with translatable identifiers, aligning with the PR's objectives for adding internationalization support.Considerations:
- Disabling Unrelated Rules: The decision to turn off several TypeScript and general JavaScript rules (lines 24-37) is notable. While this may help focus on internationalization issues, it could potentially overlook other code quality issues. It might be beneficial to review whether some of these rules should remain enabled to maintain overall code quality.
- Ignore Patterns: The specific files listed under
ignorePatterns
(lines 15-18) are excluded from i18n checks. It's important to ensure that this exclusion is justified and documented, as it might lead to inconsistencies in internationalization efforts across different parts of the application.Overall, the setup appears to align with the goals of the PR, but I recommend revisiting the disabled rules and the rationale behind the ignore patterns to ensure comprehensive quality and consistency.
packages/synapse-interface/components/input/DeadlineInput.tsx (1)
Line range hint
1-45
: Successful Integration of Internationalization in DeadlineInput ComponentThe
DeadlineInput
component has been successfully updated to support internationalization by integrating theuseTranslations
hook from thenext-intl
library. This change allows the component to dynamically translate the label for minutes, enhancing usability and accessibility in multilingual contexts.Key Points:
- Use of
useTranslations
Hook: The implementation of theuseTranslations
hook (line 10) and the subsequent use of thet
function (line 45) to fetch translations based on the current locale is a significant enhancement. This ensures that the component can adapt to different languages, improving the user experience for a global audience.This update aligns well with the PR's objectives and enhances the component's functionality by making it more adaptable to different languages.
packages/synapse-interface/components/_Transaction/components/TimeRemaining.tsx (1)
Line range hint
2-45
: Enhanced Internationalization in TimeRemaining ComponentThe
TimeRemaining
component has been effectively updated to include internationalization support by integrating theuseTranslations
hook from thenext-intl
library. This update allows for the dynamic translation of time-related strings, significantly enhancing the component's usability in multilingual contexts.Key Points:
- Dynamic Translation of Time Strings: The modification of the
estTime
logic (lines 19-25) to use thet
function for returning localized strings based on the current locale is a crucial enhancement. This ensures that the component can adapt to different languages, improving the user experience for a global audience.- Use of
useTranslations
Hook: The consistent use of thet
function across various states of the component (lines 28, 34, 45) ensures that all displayed text is localized, which is essential for maintaining a uniform user experience across different languages.These changes align well with the PR's objectives and significantly enhance the component's functionality by making it more adaptable to different languages.
packages/synapse-interface/components/Portfolio/components/EmptyPortfolioContent.tsx (2)
3-3
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is essential for enabling internationalization in this component.
17-17
: Internationalization implemented correctly.The
useTranslations
hook is used effectively to replace hardcoded strings with dynamic, localized text. This enhances the adaptability and accessibility of the component for different languages.Also applies to: 22-25, 28-28, 31-31, 37-37, 39-39, 45-45
packages/synapse-interface/components/Portfolio/components/ConnectWalletButton.tsx (2)
4-4
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is essential for enabling internationalization in this component.
10-10
: Internationalization implemented correctly.The
useTranslations
hook is used effectively to replace the hardcoded string "Connect Wallet" with a dynamic, localized text. This enhances the adaptability and accessibility of the component for different languages.Also applies to: 41-41
packages/synapse-interface/pages/index.tsx (2)
1-2
: Approved import changes.The import of
deepmerge
is essential for merging localization messages, and the cleanup of theReactGA
import helps streamline the code.
15-24
: Suggest adding error handling for dynamic imports.The implementation of
getStaticProps
uses dynamic imports to fetch localization files based on the locale. Consider adding error handling to manage cases where JSON files might not be found or are malformed. This could prevent runtime errors and improve the robustness of the localization feature.Run the following script to verify the dynamic import paths:
packages/synapse-interface/components/Portfolio/components/GasTokenAsset.tsx (1)
21-22
: Internationalization Implemented CorrectlyThe use of the
useTranslations
hook and thet
function for translating strings like "Gas token" and "Not bridgeable" is correctly implemented. Ensure that the translation keys used ('Bridge', 'Gas token', 'Not bridgeable') are defined in the respective JSON files under/messages
.Run the following script to verify the presence of translation keys:
Also applies to: 51-52, 58-58
Verification successful
Translation Keys Verified and Present
The translation keys 'Bridge', 'Gas token', and 'Not bridgeable' are correctly defined in the translation files across multiple languages. This confirms that the internationalization implementation in the
GasTokenAsset
component is supported and correctly set up. No further action is needed.
- Translation keys are present in
packages/synapse-interface/messages/
for various languages.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in JSON files. # Test: Search for the translation keys in JSON files. Expect: Keys should exist in the files. rg --type json -A 5 $'("Bridge"|"Gas token"|"Not bridgeable")' /messagesLength of output: 123
Script:
#!/bin/bash # Find all JSON files in the repository that might contain translation keys. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Search for the translation keys in the identified JSON files. rg --type json -A 5 $'("Bridge"|"Gas token"|"Not bridgeable")' packages/synapse-interface/messages/Length of output: 19894
packages/synapse-interface/components/Activity/Transaction/components/Completed.tsx (1)
31-32
: Internationalization Implemented CorrectlyThe use of the
useTranslations
hook and thet
function for translating strings like "to", "Today", and "Completed" is correctly implemented. Ensure that the translation keys used ('to', 'Today', 'Completed') are defined in the respective JSON files under/messages
.Run the following script to verify the presence of translation keys:
Also applies to: 48-49, 52-52, 54-54
Verification successful
Translation Keys Verified and Present
The translation keys 'to', 'Today', and 'Completed' are correctly implemented and present in the translation files for multiple languages. This confirms the internationalization setup is complete and accurate.
- Translation keys are found in
packages/synapse-interface/messages/
for languages including English, Spanish, French, Japanese, Chinese, Turkish, and Arabic.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in JSON files. # Test: Search for the translation keys in JSON files. Expect: Keys should exist in the files. rg --type json -A 5 $'("to"|"Today"|"Completed")' /messagesLength of output: 110
Script:
#!/bin/bash # Locate JSON files in the repository that might contain translation keys. fd --type f --extension json # Once located, search for the specific translation keys within those files. # This command will be executed after identifying potential JSON files.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys 'to', 'Today', and 'Completed' in the JSON files located in packages/synapse-interface/messages/. rg --type json -A 5 $'("to"|"Today"|"Completed")' packages/synapse-interface/messages/Length of output: 4582
packages/synapse-interface/components/StateManagedBridge/hooks/useFromChainListArray.ts (1)
12-13
: Internationalization Implemented CorrectlyThe use of the
useTranslations
hook and thet
function for translating keys like 'FromWithEllipsis' and 'All chains' is correctly implemented. Ensure that the translation keys used ('FromWithEllipsis', 'All chains') are defined in the respective JSON files under/messages
.Run the following script to verify the presence of translation keys:
Also applies to: 65-67
Verification successful
Translation Keys Verified
The translation keys 'FromWithEllipsis' and 'All chains' are correctly defined in the translation files across multiple languages, including English. This confirms the proper implementation of internationalization in the code. No further action is needed.
- Verified in:
packages/synapse-interface/messages/en-US.json
,tr.json
,jp.json
,fr.json
,es.json
,zh-CN.json
,ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in JSON files. # Test: Search for the translation keys in JSON files. Expect: Keys should exist in the files. rg --type json -A 5 $'("FromWithEllipsis"|"All chains")' /messagesLength of output: 117
Script:
#!/bin/bash # Locate JSON files in the repository that might contain translation keys. fd --type f --extension json # Once located, search for the specific translation keys within those files. # This will be done in the next step after identifying the correct path.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys 'FromWithEllipsis' and 'All chains' in the JSON files located in packages/synapse-interface/messages/. rg --type json -A 5 $'("FromWithEllipsis"|"All chains")' packages/synapse-interface/messages/Length of output: 6656
packages/synapse-interface/pages/landing/index.tsx (1)
1-2
: Approved: Consolidation of import statements.The consolidation of
useRouter
anduseEffect
import statements into a single block enhances code clarity and organization. This change is beneficial for maintainability and readability.packages/synapse-interface/components/StateManagedBridge/hooks/useToChainListArray.ts (1)
63-66
: Verify translation keys and approve the use ofuseTranslations
.The function
useToChainListArray
now dynamically generates keys for the returned object using theuseTranslations
hook. This is a significant improvement for supporting multiple languages. However, it's crucial to verify that the translation keysToWithEllipsis
andAll chains
are correctly defined in the translation files to avoid runtime errors.Verification successful
Translation Keys Verified Successfully
The translation keys
ToWithEllipsis
andAll chains
are correctly defined in the translation files across multiple languages. The use ofuseTranslations
with these keys is appropriate and should not cause any runtime errors.
- Verified in:
zh-CN.json
,tr.json
,jp.json
,fr.json
,es.json
,en-US.json
,ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the translation keys in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Correct keys defined. rg --type json -A 5 $'"ToWithEllipsis"' rg --type json -A 5 $'"All chains"'Length of output: 6751
packages/synapse-interface/utils/actions/claimStake.tsx (1)
Line range hint
21-52
: Verify translation keys and approve the use ofTranslatedText
.The function
claimStake
now uses theTranslatedText
component for toast notifications, enhancing the localization capabilities. This change allows for dynamic translations based on the user's locale, improving the user experience. However, it's crucial to verify that the translation keys used inTranslatedText
, such asStarting your claim
andClaim completed
, are correctly defined in the translation files to ensure proper functionality.Verification successful
Translation Keys Verified Successfully
The translation keys "Starting your claim" and "Claim completed" are correctly defined in the translation files across multiple languages. The use of theTranslatedText
component in theclaimStake
function is appropriate and should work as intended for localization.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the translation keys in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Correct keys defined. rg --type json -A 5 $'"Starting your claim"' rg --type json -A 5 $'"Claim completed"'Length of output: 6693
packages/synapse-interface/pages/pool/components/PriceImpactDisplay.tsx (2)
1-3
: Approved import statements.The import of
useTranslations
is essential for the internationalization functionality, and other imports are correctly used for their respective purposes.
21-22
: Localization implemented usinguseTranslations
.The
useTranslations
hook is correctly used to fetch localized strings for the component. Ensure that the translation keysBonus
andPrice Impact
are correctly defined in the JSON files under/messages/Pools.Other
.Also applies to: 49-52
Verification successful
Translation keys are correctly defined.
The translation keys
Bonus
andPrice Impact
are present in the localization files for all supported languages, confirming that theuseTranslations
hook in thePriceImpactDisplay
component is correctly implemented.
- Verified in
packages/synapse-interface/messages/zh-CN.json
,tr.json
,jp.json
,fr.json
,es.json
,en-US.json
, andar.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Keys should be present in all language files. rg --type json -A 5 $'Bonus|Price impact' ./messagesLength of output: 104
Script:
#!/bin/bash # Locate JSON files in the repository to find the correct directory for translation files. fd --type f --extension json # Once the directory is identified, search for the translation keys 'Bonus' and 'Price Impact'. # This command will be executed after identifying the correct path.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys 'Bonus' and 'Price Impact' in the JSON files located in the messages directory. rg --type json -A 5 $'Bonus|Price Impact' packages/synapse-interface/messagesLength of output: 3499
packages/synapse-interface/pages/returntomonke/index.tsx (2)
13-23
: Well-implementedgetStaticProps
for localization.The dynamic import of locale-specific messages and their merging with default messages using
deepmerge
is correctly implemented. Ensure that edge cases, such as missing keys in the locale-specific files, are handled gracefully.Verification successful
Well-implemented
getStaticProps
for localization.The dynamic import of locale-specific messages and their merging with default messages using
deepmerge
is correctly implemented. The necessary JSON files for different locales, including the defaulten-US.json
, are present in themessages
directory. Ensure that edge cases, such as missing keys in the locale-specific files, are handled gracefully.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for correct handling of edge cases in message merging. # Test: Simulate a scenario where keys are missing in the locale-specific file and ensure they are correctly merged from the default file. rg --type json -A 5 $'missingKey' ./messagesLength of output: 94
Script:
#!/bin/bash # Search for the `messages` directory and list its contents to verify its existence. fd --type d --exact-depth 1 --glob 'messages'Length of output: 45
Script:
#!/bin/bash # Search the entire repository for any directories named `messages` and list their contents. fd --type d --glob 'messages' --exec ls -l {}Length of output: 469
Line range hint
30-48
: Localization implemented inReturnToMonkePage
.The use of the
useTranslations
hook to fetch translations for the title is correctly implemented. Ensure that the translation key used for the title is correctly defined in the JSON files under/messages/ReturnToMonke
.Verification successful
Localization key is correctly implemented.
The translation key "Generate Synaptic Profile Picture" is present in the translation files for multiple languages, confirming that the localization for the title in the
ReturnToMonkePage
component is correctly implemented.
- Found in language files: English, French, Spanish, Japanese, Turkish, Chinese, and Arabic.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the translation key for the title in the JSON files. # Test: Search for the translation key in the JSON files. Expect: Key should be present in all language files. rg --type json -A 5 $'Generate Synaptic Profile Picture' ./messagesLength of output: 119
Script:
#!/bin/bash # Locate JSON files in the repository and search for the translation key. # Find all JSON files in the repository. fd --type f --extension json > json_files.txt # Search for the translation key in the located JSON files. rg --file json_files.txt -A 5 'Generate Synaptic Profile Picture'Length of output: 172
Script:
#!/bin/bash # Locate JSON files in the repository and search for the translation key using xargs. # Find all JSON files in the repository. fd --type f --extension json > json_files.txt # Use xargs to pass the list of JSON files to rg and search for the translation key. xargs rg -A 5 'Generate Synaptic Profile Picture' < json_files.txtLength of output: 3847
packages/synapse-interface/pages/landing/sections/HeroSection.tsx (2)
1-2
: Approved import statements.The import of
useTranslations
is essential for the internationalization functionality, and other imports are correctly used for their respective purposes.Also applies to: 5-5
8-9
: Localization implemented usinguseTranslations
.The
useTranslations
hook is correctly used to fetch localized strings for the component. Ensure that the translation keystitle
,description
,buildButton
, andenterBridgeButton
are correctly defined in the JSON files under/messages/Landing.HeroSection
.Also applies to: 20-57
Verification successful
Translation keys are correctly defined.
The translation keys
title
,description
,buildButton
, andenterBridgeButton
are present in the JSON files for multiple languages, confirming that the localization setup is correctly implemented for theHeroSection
component. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Keys should be present in all language files. rg --type json -A 5 $'title|description|buildButton|enterBridgeButton' ./messagesLength of output: 133
Script:
#!/bin/bash # Locate JSON files in the repository to find the correct directory for translation files. fd --type f --extension json # Once the directory is identified, search for the translation keys in those JSON files. # This command will be executed after identifying the correct path.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys in the identified JSON files within the correct directory. rg --type json -A 5 $'title|description|buildButton|enterBridgeButton' packages/synapse-interface/messages/Length of output: 25531
packages/synapse-interface/components/Warning.tsx (3)
1-1
: Correct use ofuseTranslations
import.The import of
useTranslations
fromnext-intl
is correctly implemented, enabling the internationalization features required by the component.
Line range hint
56-73
:WarningMessage
component correctly handles translated content.The
WarningMessage
component is well-implemented to support the display of translated content passed as props. It uses conditional rendering effectively to manage the display of the header and message.
Line range hint
13-54
: Proper integration of internationalization in warning messages.The use of the
t
function fromuseTranslations
to dynamically fetch warning messages based on the user's locale is correctly implemented. Ensure that the translation keys used (e.g., 'Warning! The Harmony bridge has been exploited') are correctly defined in the respective JSON files under/messages
.Verification successful
Internationalization keys are correctly implemented in the Warning component.
The translation keys used in the
Warning
component are present in the JSON files located inpackages/synapse-interface/messages
, confirming the correct setup for internationalization. The keys are available in multiple languages, ensuring proper localization. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that translation keys used in the Warning component match those in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Keys should exist in the files. rg --type json -A 5 $'Warning! The Harmony bridge has been exploited' ./messagesLength of output: 132
Script:
#!/bin/bash # Locate potential directories or files that contain translation JSON files. fd --type f --extension json # Search for the specific translation keys within those files. rg --type json -A 5 $'Warning! The Harmony bridge has been exploited' rg --type json -A 5 $'Warning! The Fantom bridge has been exploited' rg --type json -A 5 $'Alert: Transactions to Dogechain are temporarily paused'Length of output: 29257
packages/synapse-interface/pages/pool/components/ReceivedTokenSection.tsx (1)
16-16
: Review ofReceivedTokenSection
function logic and internationalization implementation.
- The use of
useTranslations
for the string "You will receive" is correctly implemented, enhancing the component's internationalization.- The early return pattern is effectively used to handle undefined
withdrawQuote
oroutputs
.- The logic to filter and map
outputsArray
based ontokensArray
is correctly implemented, ensuring that only relevant tokens are processed.- The direct use of
output.value
informatBigIntToString
is appropriate and simplifies the code by avoiding unnecessary variable assignments.Overall, the function is well-implemented with respect to the new internationalization requirements and existing logic.
Also applies to: 18-18, 24-26, 31-31, 35-37, 48-48
packages/synapse-interface/pages/landing/sections/UseCasesSection.tsx (3)
9-9
: Interface Naming Convention Followed:The renaming of
useCaseProp
toUseCaseProp
aligns with TypeScript best practices for naming interfaces.
Line range hint
62-74
: Enhanced Type Safety inUseCaseCard
:The explicit typing of props using
UseCaseProp
in theUseCaseCard
function enhances type safety and is a good practice in TypeScript.
16-34
: Dynamic Translation Implementation:The use of the
useTranslations
hook and dynamic translation keys in theuseCases
array is correctly implemented. Ensure that the translation keys used (useCases.0.title
, etc.) are defined in the respective JSON files for each language.Run the following script to verify the presence of translation keys in JSON files:
packages/synapse-interface/components/Pools/PoolHeader.tsx (3)
6-6
: Correct import ofuseTranslations
.The import of
useTranslations
fromnext-intl
is correctly placed and is essential for enabling internationalization in this component.
21-21
: Proper use of translation hook and keys.The
useTranslations
hook is correctly scoped to 'Pools', and the translation key 'Deposit' is used appropriately. Ensure that the translation key 'Deposit' exists in the JSON files for all supported languages.Also applies to: 63-63
Verification successful
Translation key 'Deposit' is correctly implemented.
The 'Deposit' translation key exists in all relevant JSON files within the
packages/synapse-interface/messages
directory, confirming its presence for all supported languages. This verifies the correct setup of translations in thePoolHeader
component.
packages/synapse-interface/messages/ar.json
packages/synapse-interface/messages/en-US.json
packages/synapse-interface/messages/es.json
packages/synapse-interface/messages/fr.json
packages/synapse-interface/messages/jp.json
packages/synapse-interface/messages/tr.json
packages/synapse-interface/messages/zh-CN.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the 'Deposit' translation key in all JSON files. # Test: Search for the 'Deposit' key in all JSON files. Expect: Key should exist in all files. fd '.*\.json$' messages --exec grep -H '"Deposit"' {}Length of output: 153
Script:
#!/bin/bash # Search for JSON files across the entire repository to locate translation files. fd '.*\.json$'Length of output: 13314
Script:
#!/bin/bash # Search for the 'Deposit' translation key in the JSON files within the messages directory. grep -H '"Deposit"' packages/synapse-interface/messages/*.jsonLength of output: 897
78-78
: Proper use of translation hook and keys in subcomponent.The
useTranslations
hook is correctly scoped to 'Wallet', and the translation key 'Connected' is used appropriately. Ensure that the translation key 'Connected' exists in the JSON files for all supported languages.Also applies to: 82-82
Verification successful
Translation Key 'Connected' Verified Across All Languages
The translation key 'Connected' is present in all the relevant translation files, confirming that the use of the
useTranslations
hook is supported by the necessary translation data for all supported languages.
- The key is found in the following files:
packages/synapse-interface/messages/ar.json
packages/synapse-interface/messages/en-US.json
packages/synapse-interface/messages/es.json
packages/synapse-interface/messages/fr.json
packages/synapse-interface/messages/jp.json
packages/synapse-interface/messages/tr.json
packages/synapse-interface/messages/zh-CN.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the 'Connected' translation key in all JSON files. # Test: Search for the 'Connected' key in all JSON files. Expect: Key should exist in all files. fd '.*\.json$' messages --exec grep -H '"Connected"' {}Length of output: 155
Script:
#!/bin/bash # Search for JSON files in the repository to locate translation files. fd '.*\.json$'Length of output: 13314
Script:
#!/bin/bash # Search for the 'Connected' translation key in the identified translation JSON files. grep -H '"Connected"' packages/synapse-interface/messages/*.jsonLength of output: 843
packages/synapse-interface/components/ApyTooltip.tsx (2)
1-1
: Correct import ofuseTranslations
.The import of
useTranslations
fromnext-intl
is correctly placed and is essential for enabling internationalization in this component.
94-94
: Proper use of translation hook and keys in subcomponent.The
useTranslations
hook is correctly scoped to 'Pools', and the translation keys 'reward' and 'base' are used appropriately. Ensure that the translation keys 'reward' and 'base' exist in the JSON files for all supported languages.Also applies to: 106-107
Verification successful
Translation keys 'reward' and 'base' are correctly implemented.
The translation keys 'reward' and 'base' are present in the JSON files for multiple languages, confirming their availability for use in the
ApyTooltip.tsx
component. This ensures proper translation functionality within the application.
packages/synapse-interface/messages/ar.json
packages/synapse-interface/messages/en-US.json
packages/synapse-interface/messages/es.json
packages/synapse-interface/messages/fr.json
packages/synapse-interface/messages/jp.json
packages/synapse-interface/messages/tr.json
packages/synapse-interface/messages/zh-CN.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the 'reward' and 'base' translation keys in all JSON files. # Test: Search for the 'reward' and 'base' keys in all JSON files. Expect: Keys should exist in all files. fd '.*\.json$' messages --exec grep -H '"reward"|"base"' {}Length of output: 159
Script:
#!/bin/bash # Locate JSON files in the repository and check for 'reward' and 'base' keys. # Find all JSON files in the repository fd --extension json > json_files.txt # Check for the presence of 'reward' and 'base' keys in the located JSON files while IFS= read -r file; do echo "Checking $file" grep -H '"reward"' "$file" grep -H '"base"' "$file" done < json_files.txtLength of output: 5603
Script:
#!/bin/bash # Locate potential translation JSON files and check for 'reward' and 'base' keys. # Find directories that might contain translation JSON files fd --type d --name 'locales' --exec fd --extension json > translation_json_files.txt fd --type d --name 'i18n' --exec fd --extension json >> translation_json_files.txt fd --type d --name 'translations' --exec fd --extension json >> translation_json_files.txt # Check for the presence of 'reward' and 'base' keys in the located JSON files while IFS= read -r file; do echo "Checking $file" grep -H '"reward"' "$file" grep -H '"base"' "$file" done < translation_json_files.txtLength of output: 944
Script:
#!/bin/bash # Correctly locate potential translation JSON files and check for 'reward' and 'base' keys. # Find directories that might contain translation JSON files and search for JSON files within them fd 'locales|i18n|translations' --type d | while IFS= read -r dir; do fd --extension json "$dir" >> translation_json_files.txt done # Check for the presence of 'reward' and 'base' keys in the located JSON files while IFS= read -r file; do echo "Checking $file" grep -H '"reward"' "$file" grep -H '"base"' "$file" done < translation_json_files.txtLength of output: 84
Script:
#!/bin/bash # Broadly search for JSON files across the repository and check for 'reward' and 'base' keys. # Find all JSON files in the repository fd --extension json > all_json_files.txt # Check for the presence of 'reward' and 'base' keys in all JSON files while IFS= read -r file; do echo "Checking $file" grep -H '"reward"' "$file" grep -H '"base"' "$file" done < all_json_files.txtLength of output: 75220
packages/synapse-interface/components/StateManagedBridge/hooks/useFromTokenListArray.ts (2)
3-3
: Correct import ofuseTranslations
.The import of
useTranslations
fromnext-intl
is correctly placed and is essential for enabling internationalization in this hook.
15-15
: Proper use of translation hook and keys.The
useTranslations
hook is correctly scoped to 'Bridge', and the translation keys for various token categories are used appropriately. Ensure that the translation keys 'SendWithEllipsis', 'All sendable tokens', and 'All other tokens' exist in the JSON files for all supported languages.Also applies to: 107-109
packages/synapse-interface/pages/_app.tsx (2)
56-74
: Correct localization setup inRainbowKitProvider
.The update to
RainbowKitProvider
to accept alocale
prop, set to the router's locale, ensures that the UI components are appropriately localized. This is a crucial update for maintaining a consistent user experience across different locales.
43-77
: Well-structured and maintainable provider nesting.The overall structure of the file, with multiple nested providers, is well-organized and necessary for the context management required in this application. This setup ensures that all components have the necessary data and functionality scoped appropriately.
packages/synapse-interface/components/StateManagedBridge/OutputContainer.tsx (2)
61-68
: Proper use ofuseTranslations
for dynamic UI text inToChainSelector
.The integration of
useTranslations
and the use of thet
function to translate the label "To" is correctly implemented. This enhances the accessibility and user experience for a multilingual audience.
80-87
: Consistent use ofuseTranslations
inToTokenSelector
.The use of
useTranslations
and the translation of the placeholder "In" using thet
function is correctly implemented, ensuring consistency and enhancing the user interface for different language speakers.packages/synapse-interface/pages/landing/sections/ExplorerSection.tsx (1)
Line range hint
2-70
: Effective use ofuseTranslations
for dynamic text translation.The integration of
useTranslations
and the use of thet
function to replace hardcoded strings with translatable keys is correctly implemented. This change significantly enhances the accessibility and user experience for a multilingual audience.packages/synapse-interface/components/Portfolio/components/PortfolioConnectButton.tsx (2)
Line range hint
64-112
: Correct use of internationalization inConnectButton
.The
useTranslations
hook is correctly used to fetch translations for the 'Connecting' and 'Connect' statuses. Ensure that the translation keys used match those in the/messages
directory.Run the following script to verify the translation keys:
Verification successful
Translation keys are correctly implemented and available.
The translation keys 'Connecting' and 'Connect' are present in the
packages/synapse-interface/messages
directory for multiple languages, confirming proper internationalization support in theConnectButton
component. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the translation keys in the 'Wallet' namespace. # Test: Search for the translation keys in the messages directory. Expect: Keys should exist in the JSON files. rg --type json -A 5 $'Connecting|Connect' ./messagesLength of output: 104
Script:
#!/bin/bash # Find all JSON files in the repository that might contain translation keys. fd --type f --extension json # Search for the translation keys 'Connecting' and 'Connect' in the found JSON files. rg --type json -e 'Connecting' -e 'Connect'Length of output: 25037
Line range hint
34-54
: Correct use of internationalization inConnectedButton
.The
useTranslations
hook is correctly used to fetch translations for the 'Connected' status. Ensure that the translation keys used match those in the/messages
directory.Run the following script to verify the translation keys:
Verification successful
Translation Key Verified: 'Connected' Key Exists in Translation Files
The 'Connected' translation key is present in multiple language-specific JSON files, confirming the correct use of the
useTranslations
hook in theConnectedButton
component. The translations are available for several languages, ensuring proper internationalization support.
- Verified in
packages/synapse-interface/messages/en-US.json
,es.json
,fr.json
,zh-CN.json
,jp.json
,tr.json
,ar.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the translation keys in the 'Wallet' namespace. # Test: Search for the translation keys in the messages directory. Expect: Keys should exist in the JSON files. rg --type json -A 5 $'Connected' ./messagesLength of output: 93
Script:
#!/bin/bash # Locate JSON files that might contain translation keys. fd --type f --extension json # Once located, search for the 'Connected' key within those files. # This will be executed after locating the files.Length of output: 13328
Script:
#!/bin/bash # Search for the 'Connected' key within the translation JSON files. rg --type json 'Connected' packages/synapse-interface/messagesLength of output: 2275
packages/synapse-interface/components/LanguageSelector.tsx (1)
1-91
: Comprehensive review ofLanguageSelector
.The
LanguageSelector
component is well-implemented with the following features:
- Dynamic translation of the 'Language' label using the
useTranslations
hook.- Management of language settings through interactions with the Next.js router and local storage.
- Use of custom hooks for closing the dropdown on outside clicks and escape key presses.
Ensure that the translation keys and the languages supported match those in the
/messages
directory and the application requirements.Run the following script to verify the translation keys and supported languages:
Verification successful
Translation keys and supported languages are correctly implemented.
The
packages/synapse-interface/messages/
directory contains JSON files for each language code used in theLanguageSelector
component, indicating that the translation keys and supported languages are correctly set up. No additional translation directories were found.
- Directory:
packages/synapse-interface/messages/
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the translation keys and supported languages. # Test: Search for the translation keys and language codes in the messages directory. Expect: Keys and codes should exist in the JSON files. rg --type json -A 5 $'Language|en-US|fr|jp|ar|tr|es|zh-CN' ./messagesLength of output: 121
Script:
#!/bin/bash # Search for JSON files that might contain translation data in the repository. fd --type f --extension json # Additionally, search for directories that might be related to translations or messages. fd --type d --name '*messages*' --or --name '*locales*' --or --name '*translations*'Length of output: 13666
Script:
#!/bin/bash # Correct the command to search for directories related to translations or messages. fd --type d --glob '*messages*' --or --glob '*locales*' --or --glob '*translations*'Length of output: 338
Script:
#!/bin/bash # Search for directories related to translations or messages separately. fd --type d --glob '*messages*' fd --type d --glob '*locales*' fd --type d --glob '*translations*'Length of output: 141
packages/synapse-interface/utils/actions/approveAndWithdraw.tsx (1)
Line range hint
13-107
: Comprehensive review of internationalization inapproveAndWithdraw
.The
TranslatedText
component is correctly used to replace static text strings with translatable content in the withdrawal process. This enhances the user interface by providing localized messages for the withdrawal actions. Ensure that the translation keys used match those in the/messages
directory.Run the following script to verify the translation keys:
packages/synapse-interface/pages/pool/[poolId].tsx (1)
24-33
: Well-implemented internationalization support ingetStaticPaths
.The function now correctly handles multiple locales, generating paths for each locale and
poolId
. This is a crucial part of supporting internationalization in static generation with Next.js.packages/synapse-interface/components/StateManagedSwap/SwapExchangeRateInfo.tsx (2)
3-3
: Internationalization Hook AddedThe addition of the
useTranslations
hook fromnext-intl
is appropriate for supporting internationalization in this component. This setup is crucial for fetching the necessary translations.
71-72
: Internationalization Implementation in SubcomponentsThe implementation of the
useTranslations
hook in theExpectedPrice
andSlippage
subcomponents is correctly done. The translation keys 'Expected price on' and 'Slippage' are used to fetch localized strings, which enhances the accessibility and user experience by adapting the interface to the user's language.Consider adding a fallback mechanism or ensuring that all translation keys are present in the translation files to avoid displaying missing key errors to the user.
Also applies to: 76-76, 98-98, 101-101
Verification successful
Translation Keys Verified
The translation keys 'Expected price on' and 'Slippage' are present in all relevant translation files, ensuring proper internationalization support for the
ExpectedPrice
andSlippage
subcomponents. No missing key errors should occur.
- Translation files checked:
zh-CN.json
,tr.json
,jp.json
,fr.json
,es.json
,en-US.json
,ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all translation keys used in the component are present in the translation files. # Test: Search for the translation keys in the messages directory. Expect: Each key should be present in all language JSON files. rg --type json -A 5 $'Expected price on|Slippage' ./messagesLength of output: 112
Script:
#!/bin/bash # Locate JSON files that might contain translation keys fd --type f --extension jsonLength of output: 13328
Script:
#!/bin/bash # Search for the translation keys 'Expected price on' and 'Slippage' in the identified translation files. rg --type json -A 5 $'Expected price on|Slippage' packages/synapse-interface/messages/Length of output: 8121
packages/synapse-interface/utils/actions/approveAndStake.tsx (1)
12-12
: Localized Text Implementation in NotificationsThe integration of the
TranslatedText
component within theapprove
andstake
functions is correctly implemented. This change enhances the user experience by providing notifications that adapt to the user's language settings. The use of namespace and ID for fetching the correct translations is a good practice.Ensure that all translation keys used in the
TranslatedText
components are defined in the translation files to prevent any missing translation issues.Also applies to: 28-30, 50-53, 87-89, 120-122
Verification successful
Translation Keys Verified
The translation keys used in the
approveAndStake.tsx
file are correctly defined in the translation files across multiple languages. This ensures that the localized notifications will function as expected without any missing translations.
- Translation keys are present in:
packages/synapse-interface/messages/en-US.json
,es.json
,fr.json
,jp.json
,zh-CN.json
,tr.json
,ar.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all translation keys used in the notifications are present in the translation files. # Test: Search for the translation keys in the messages directory. Expect: Each key should be present in all language JSON files. rg --type json -A 5 $'Requesting approval|Successfully approved on|Starting your deposit|Stake completed' ./messagesLength of output: 168
Script:
#!/bin/bash # Locate JSON files that might contain translation keys. fd --type f --extension json # Once located, search for the specific translation keys within these files. # This command will be executed after identifying potential translation files.Length of output: 13328
Script:
#!/bin/bash # Search for the specific translation keys within the language-specific JSON files. rg --type json -A 5 $'Requesting approval|Successfully approved on|Starting your deposit|Stake completed' packages/synapse-interface/messagesLength of output: 8026
packages/synapse-interface/components/ui/ChainSelector.tsx (1)
3-3
: Internationalization Implementation in ChainSelectorThe addition of the
useTranslations
hook and its usage in theChainSelector
component is correctly implemented. The dynamic translation of the placeholder text for the network selection input enhances the user experience by adapting the interface to the user's language.Ensure that the translation key 'Network' is present in all translation files to avoid displaying a missing key error.
Also applies to: 30-30, 105-105
Verification successful
Translation Key 'Network' Verified
The translation key 'Network' is present in all relevant translation files, ensuring proper internationalization across supported languages. No further action is required.
- Files checked:
zh-CN.json
,tr.json
,jp.json
,es.json
,fr.json
,en-US.json
,ar.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the translation key 'Network' used in the component is present in the translation files. # Test: Search for the translation key in the messages directory. Expect: The key should be present in all language JSON files. rg --type json -A 5 $'Network' ./messagesLength of output: 91
Script:
#!/bin/bash # Find all JSON files in the repository to locate potential translation files. fd --type f --extension jsonLength of output: 13328
Script:
#!/bin/bash # Verify the presence of the 'Network' translation key in the identified translation files. rg --type json -A 5 $'Network' packages/synapse-interface/messagesLength of output: 17510
packages/synapse-interface/package.json (6)
18-18
: Approved: New script for finding string literals.The addition of
"lint:find-string-literals"
script is a proactive step towards maintaining internationalization standards by identifying untranslated strings.
19-19
: Approved: New script for checking translation JSON files.The addition of
"check-translation-jsons"
script is crucial for ensuring consistency in translations, which enhances the quality of internationalization efforts.
59-59
: Approved: Addition ofnext-intl
for internationalization.The inclusion of
"next-intl"
is appropriate for implementing internationalization in a Next.js project, facilitating dynamic translations.
111-111
: Approved: Reintroduction ofeslint
.Reintroducing
"eslint"
aligns with best practices for maintaining code quality, especially important in a project undergoing internationalization enhancements.
112-112
: Approved: Reintroduction ofeslint-config-next
.The reintroduction of
"eslint-config-next"
ensures that linting rules are specifically tailored for Next.js, supporting best coding practices in the project.
113-113
: Approved: Addition ofeslint-plugin-i18next
.The inclusion of
"eslint-plugin-i18next"
is a strategic choice to enforce best i18n practices, enhancing the quality and consistency of internationalization efforts.packages/synapse-interface/components/ConnectionIndicators.tsx (3)
30-40
: Internationalization implemented correctly inConnectedIndicator
.The use of the
useTranslations
hook and the translation key'Connected'
is correctly implemented. Ensure that the translation key exists in the JSON files for all supported languages.Verification successful
Translation key 'Connected' exists in multiple languages.
The 'Connected' translation key is present in the JSON files for multiple languages, confirming the correct implementation of internationalization in the
ConnectedIndicator
component.
- The key was found in the following languages: English, French, Japanese, Chinese, Arabic, Spanish, and Turkish.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the 'Connected' translation key in all JSON files. # Test: Search for the 'Connected' key in all JSON files. Expect: Key should exist in all files. fd '.*\.json$' messages --exec rg '"Connected":'Length of output: 146
Script:
#!/bin/bash # Step 1: Locate all JSON files in the repository to find the correct directory for translation keys. fd '.*\.json$' # Step 2: Search for the 'Connected' key in the located JSON files. fd '.*\.json$' --exec rg '"Connected":'Length of output: 13548
Line range hint
104-135
: Internationalization implemented correctly inConnectWalletButton
.The use of the
useTranslations
hook and the translation key'Connect Wallet'
is correctly implemented. Ensure that the translation key exists in the JSON files for all supported languages.Verification successful
Translation Key Verified: 'Connect Wallet' Exists in Multiple Languages
The 'Connect Wallet' translation key is present and correctly implemented across various JSON files, with translations available in multiple languages. This confirms the internationalization implementation is accurate. No further action is needed.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the 'Connect Wallet' translation key in all JSON files. # Test: Search for the 'Connect Wallet' key in all JSON files. Expect: Key should exist in all files. fd '.*\.json$' messages --exec rg '"Connect Wallet":'Length of output: 151
Script:
#!/bin/bash # Search for all JSON files in the repository that might contain translation keys. fd --extension json # Once JSON files are identified, search for the 'Connect Wallet' key within them. fd --extension json --exec rg '"Connect Wallet":'Length of output: 13645
Line range hint
50-93
: Internationalization implemented correctly inConnectToNetworkButton
.The use of the
useTranslations
hook and the translation keys'Connecting'
and'Switch Network'
is correctly implemented. Ensure that these translation keys exist in the JSON files for all supported languages.Verification successful
Translation keys verified successfully.
The translation keys 'Connecting' and 'Switch Network' are present in all the necessary JSON files for supported languages. The internationalization implementation in the
ConnectToNetworkButton
component is correct.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the 'Connecting' and 'Switch Network' translation keys in all JSON files. # Test: Search for the 'Connecting' and 'Switch Network' keys in all JSON files. Expect: Keys should exist in all files. fd '.*\.json$' messages --exec rg '"Connecting":|"Switch Network":'Length of output: 165
Script:
#!/bin/bash # Locate all JSON files in the repository to find the correct directory for translation files. fd '.*\.json$'Length of output: 13314
Script:
#!/bin/bash # Search for the translation keys 'Connecting' and 'Switch Network' in the JSON files within the messages directory. rg '"Connecting":|"Switch Network":' packages/synapse-interface/messages/*.jsonLength of output: 1471
packages/synapse-interface/components/ui/SelectSpecificNetworkButton.tsx (1)
110-110
: Good use of thekey
prop for performance optimization.Adding a unique
key
prop to eachHoverIcon
component is a best practice for lists in React to optimize re-renders. Ensure thattoken.token.symbol
is a unique identifier across all possible tokens, especially if multiple chains are involved.Consider verifying the uniqueness of token symbols across chains if applicable.
packages/synapse-interface/components/InteractiveInputRow.tsx (2)
107-107
: Proper integration of internationalization for button text.Using the
useTranslations
hook to dynamically translate the "Max" button text is a good practice for supporting multiple languages.
121-121
: Dynamic translation of UI text enhances accessibility.Replacing hardcoded strings with translations using the
useTranslations
hook improves the user experience for non-English speakers.packages/synapse-interface/components/StateManagedSwap/SwapTransactionButton.tsx (1)
82-82
: Comprehensive integration of internationalization across button states.The use of the
useTranslations
hook to dynamically fetch translations for various button labels and messages is commendable. This approach not only enhances accessibility but also aligns with best practices for internationalization.Verify the completeness and accuracy of the translation keys used across different states to ensure consistency and coverage.
Also applies to: 87-87, 92-92, 97-97, 102-102, 107-107, 112-116, 126-127, 132-133
packages/synapse-interface/components/StateManagedBridge/SettingsSlideOver.tsx (5)
3-3
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is essential for supporting internationalization as described in the PR.
22-23
: Correct usage of translation hook.The
useTranslations
hook is correctly initialized with the 'Settings' namespace, allowing for scoped translations within this component.
49-49
: Dynamic translation implemented for 'Options'.The text "Options" is correctly replaced with
t('Options')
to support internationalization.
54-55
: Approved translations for UI elements.The label and tooltip within the
Switch
component are correctly translated to enhance accessibility and user experience in different locales.
122-122
: Translation applied to 'min'.The static text "mins" is appropriately replaced with
t('min')
for dynamic translation, aligning with internationalization efforts.packages/synapse-interface/pages/returntomonke/ImageUploader.tsx (4)
2-2
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is essential for supporting internationalization as described in the PR.
10-11
: Correct usage of translation hook.The
useTranslations
hook is correctly initialized with the 'ReturnToMonke' namespace, allowing for scoped translations within this component.
101-103
: Dynamic translation implemented for upload prompts.The text "Click to Upload or" and "Drag and drop image here..." are correctly replaced with
t('Click to Upload or')
andt('Drag and drop image here')
to support internationalization.
Line range hint
106-136
: Approved translations for UI elements.The text "Select different image?" and the button label "Download" are correctly translated to enhance accessibility and user experience in different locales.
Tools
Biome
[error] 106-106: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx (4)
1-1
: Approved import for internationalization.The import of
useTranslations
fromnext-intl
is essential for supporting internationalization as described in the PR.
120-120
: Correct usage of translation hook.The
useTranslations
hook is correctly initialized with the 'Nav' namespace, allowing for scoped translations within this component.
139-150
: Dynamic translation implemented for footer links.The text "Terms of Use", the separator "|", and "Privacy Policy" are correctly replaced with
t('Terms of Use')
,t('|')
, andt('Privacy Policy')
to support internationalization.
Line range hint
181-192
: Approved translations for footer links.The text for various footer links is correctly translated to enhance accessibility and user experience in different locales.
packages/synapse-interface/components/ui/SelectorWrapper.tsx (2)
2-2
: Approved import statement foruseTranslations
.The import of
useTranslations
fromnext-intl
is correctly implemented, enabling the internationalization features in this component.
64-64
: Correct implementation of dynamic translation for placeholders.The
useTranslations
hook is correctly utilized to fetch the translation functiont
, which is then effectively used to translate the placeholder text inSlideSearchBox
. This ensures that the component adapts to different languages, enhancing accessibility and user experience.Also applies to: 125-125
packages/synapse-interface/pages/pools/index.tsx (2)
42-42
: Correct usage of dynamic translation for page titles and subtitles.The
useTranslations
hook is effectively used to fetch the translation functiont
, which is then correctly applied to dynamically translate titles and subtitles inPageHeader
. This implementation enhances the accessibility and user experience by adapting the content to different languages.Also applies to: 88-89, 98-99, 107-108
22-32
: Well-implementedgetStaticProps
for localization message handling.The
getStaticProps
function is correctly implemented to fetch and merge localization messages based on the user's locale. This setup ensures that the page dynamically loads the appropriate translations. Consider verifying the correct loading of messages in different locales to ensure comprehensive coverage.Run the following script to verify the correct loading of messages:
packages/synapse-interface/components/Pools/PoolActionOptions.tsx (2)
3-3
: Approved import statement foruseTranslations
.The import of
useTranslations
fromnext-intl
is correctly implemented, enabling the internationalization features in this component.
23-24
: Correct implementation of dynamic translation for action labels.The
useTranslations
hook is correctly utilized to fetch the translation functiont
, which is then effectively used to translate various action labels in thePoolActionOptions
component. This ensures that the component adapts to different languages, enhancing accessibility and user experience.Also applies to: 67-67, 75-75, 82-82, 89-89, 96-96, 103-103
packages/synapse-interface/components/Portfolio/components/PortfolioContent.tsx (2)
140-144
: Internationalization Implemented Correctly in LoadingPortfolioContentThe
useTranslations
hook is used correctly to enable dynamic text translation. Ensure that the translation key 'Loading assets' exists in the translation files.Verification successful
Translation Key 'Loading assets' Verified
The translation key 'Loading assets' is correctly defined in multiple language files, confirming the internationalization implementation is accurate. No further action is needed.
- Verified in:
jp.json
,tr.json
,es.json
,en-US.json
,ar.json
,fr.json
,zh-CN.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the translation key 'Loading assets' in the translation files. # Test: Search for the translation key in the messages directory. Expect: At least one occurrence. rg --type json '"Loading assets"' ./messagesLength of output: 97
Script:
#!/bin/bash # Locate potential translation files in the repository. fd --type f --extension json # Once located, search for the translation key 'Loading assets' within these files. # This will be done in a subsequent step after identifying the correct path.Length of output: 13328
Script:
#!/bin/bash # Search for the translation key 'Loading assets' in the JSON files within the messages directory. rg --type json '"Loading assets"' packages/synapse-interface/messagesLength of output: 665
151-162
: Internationalization Implemented Correctly in HomeContentThe
useTranslations
hook is used correctly to enable dynamic text translation. Ensure that the translation keys used in this component exist in the translation files.Verification successful
Translation Keys Verified Successfully
The translation keys used in the
HomeContent
component are present in the translation files across multiple languages, confirming correct internationalization implementation.
- Verified in
packages/synapse-interface/messages/en-US.json
and other language files.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the translation keys in the HomeContent component in the translation files. # Test: Search for the translation keys in the messages directory. Expect: At least one occurrence for each key. rg --type json '"Synapse is the most widely used, extensible, and secure cross-chain communications network"' ./messages rg --type json '"Get route quotes in the Bridge panel, and connect your wallet when you are ready to submit a transaction"' ./messagesLength of output: 361
Script:
#!/bin/bash # Locate JSON files in the repository to find the correct directory for translation files. fd --type f --extension json # If a likely directory is found, search for the translation keys within those files. # Placeholder for the next step once the directory is identified.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys in the identified messages directory. rg --type json '"Synapse is the most widely used, extensible, and secure cross-chain communications network"' packages/synapse-interface/messages rg --type json '"Get route quotes in the Bridge panel, and connect your wallet when you are ready to submit a transaction"' packages/synapse-interface/messagesLength of output: 3587
packages/synapse-interface/components/Wallet.tsx (2)
4-4
: Approved import ofuseTranslations
.The import of
useTranslations
fromnext-intl
is correctly implemented for internationalization purposes.
Line range hint
45-167
: Approved internationalization implementation in theWallet
component.The use of the
useTranslations
hook to replace hardcoded strings with translatable keys is correctly implemented. Including the translation functiont
in the dependency array ofuseEffect
ensures that the component re-renders when the translation context changes, which is a best practice for dynamic internationalization.packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx (2)
2-2
: Approved import ofuseTranslations
.The import of
useTranslations
fromnext-intl
is correctly implemented for internationalization purposes.
Line range hint
81-98
: Approved internationalization implementation in theEventCountdownProgressBar
component.The use of the
useTranslations
hook to dynamically translate the string "remaining" based on the current locale is correctly implemented. This enhances the user experience by providing localized content, which is crucial for internationalization.packages/synapse-interface/components/StateManagedBridge/BridgeTransactionButton.tsx (2)
5-5
: Approved import ofuseTranslations
.The import of
useTranslations
fromnext-intl
is correctly implemented for internationalization purposes.
Line range hint
30-180
: Approved internationalization implementation in theBridgeTransactionButton
component.The use of the
useTranslations
hook to dynamically translate various button labels based on the current locale is correctly implemented. This enhances the user experience by providing localized content, which is crucial for internationalization.packages/synapse-interface/components/StateManagedBridge/BridgeExchangeRateInfo.tsx (5)
4-5
: Approved: Import of useTranslations hook.The import of
useTranslations
fromnext-intl
is correctly implemented to support internationalization.
42-43
: Verify translation keys for DestinationAddress component.The translation key
'To'
used in theDestinationAddress
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Also applies to: 55-55
64-64
: Verify translation keys for Slippage component.The translation key
'Slippage'
used in theSlippage
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Also applies to: 74-74
100-100
: Verify translation keys for TimeEstimate component.The translation keys
'Time.minutes'
,'Time.seconds'
,'Bridge.Powered by Synapse'
, and'Bridge.Select origin token'
used in theTimeEstimate
component should be verified to ensure they are correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Also applies to: 108-108, 114-114, 124-124, 130-130
143-143
: Verify translation keys for GasDropLabel component.The translation key
'Will also receive'
used in theGasDropLabel
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Also applies to: 171-171
packages/synapse-interface/components/_Transaction/_Transaction.tsx (4)
2-3
: Approved: Import of useTranslations hook.The import of
useTranslations
fromnext-intl
is correctly implemented to support internationalization in the_Transaction
component.Also applies to: 61-61
157-157
: Verify translation key for "Began".The translation key
'Began'
used in the_Transaction
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.
181-181
: Verify translation key for "Contact Support (Discord)".The translation key
'Contact Support (Discord)'
used in the_Transaction
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.
188-188
: Verify translation keys for "Clear notification" and "Clear transaction".The translation keys
'Clear notification'
and'Clear transaction'
used in the_Transaction
component should be verified to ensure they are correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.Also applies to: 189-189
packages/synapse-interface/components/Activity/Activity.tsx (3)
6-7
: Approved: Import of useTranslations hook.The import of
useTranslations
fromnext-intl
is correctly implemented to support internationalization in theActivity
component.Also applies to: 55-55
64-64
: Verify translation key for "Your pending and recent transactions will appear here".The translation key
'Your pending and recent transactions will appear here'
used in theActivity
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.
69-69
: Verify translation key for "Loading activity".The translation key
'Loading activity'
used in theActivity
component should be verified to ensure it is correctly defined in the respective JSON files under/messages
. This is crucial for maintaining consistency and accuracy in translations.packages/synapse-interface/components/StateManagedSwap/SwapInputContainer.tsx (3)
75-76
: Proper use ofuseTranslations
for internationalization.The
useTranslations
hook is correctly used to fetch translations for the 'Swap' namespace. Ensure that the translation keys used ('available'
, etc.) are defined in the corresponding/messages/{locale}.json
files.Run the following script to verify the presence of translation keys:
193-200
: Proper use ofuseTranslations
for internationalization inSwapChainSelector
.The
useTranslations
hook is correctly used to fetch translations for the 'Bridge' namespace. Ensure that the translation key used ('From'
) is defined in the corresponding/messages/{locale}.json
files.Run the following script to verify the presence of translation keys:
Verification successful
Translation key "From" is correctly defined across multiple locales.
The translation key "From" is present in all relevant locale files within the
packages/synapse-interface/messages
directory, confirming the proper setup for internationalization. No issues found with the translation keys.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in the messages directory. # Test: Search for the translation key in all JSON files. Expect: Key should be present in all locale files. rg --type json -A 5 $'From' ./messagesLength of output: 88
Script:
#!/bin/bash # Find all JSON files in the repository that might contain translation keys. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Search for the translation key "From" in the JSON files within the messages directory. rg --type json -A 5 '"From"' packages/synapse-interface/messagesLength of output: 2921
213-220
: Proper use ofuseTranslations
for internationalization inSwapFromTokenSelector
.The
useTranslations
hook is correctly used to fetch translations for the 'Bridge' namespace. Ensure that the translation key used ('In'
) is defined in the corresponding/messages/{locale}.json
files.Run the following script to verify the presence of translation keys:
Verification successful
Translation key 'In' is correctly defined across multiple locales.
The translation key 'In' is present in the translation files for several languages, confirming the proper setup of internationalization for the 'Bridge' namespace in the
SwapFromTokenSelector
component.
- Verified in
packages/synapse-interface/messages/zh-CN.json
,tr.json
,jp.json
,fr.json
,es.json
,en-US.json
,ar.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in the messages directory. # Test: Search for the translation key in all JSON files. Expect: Key should be present in all locale files. rg --type json -A 5 $'In' ./messagesLength of output: 86
Script:
#!/bin/bash # Locate JSON files in the repository to find potential translation files. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Search for the translation key 'In' in the translation files located in the messages directory. rg --type json -A 5 $'In' packages/synapse-interface/messagesLength of output: 48398
packages/synapse-interface/README.md (1)
151-207
: Approve the formatting changes in JSON examples.The reformatting of JSON examples, including consistent indentation and the removal of unnecessary line breaks, enhances readability and clarity. These changes are beneficial and should be maintained.
packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx (1)
77-78
: Approve the integration of theuseTranslations
hook and suggest verification of translation keys.The use of the
useTranslations
hook in theLandingNav
function for dynamically translating the "Open menu" and "Close menu" labels is a good practice for supporting multiple languages. Ensure that the translation keys used (Nav.Open menu
andNav.Close menu
) are correctly defined in the translation JSON files for all supported languages.Run the following script to verify the presence of translation keys in all language files:
Also applies to: 88-88, 137-137
packages/synapse-interface/components/icons/LandingIcons/FauxBridge.tsx (1)
122-122
: Approve the integration of theuseTranslations
hook and suggest verification of translation keys.The use of the
useTranslations
hook in various components within theFauxBridge
component, such asSelect
,SupportedWallets
,HistoricMax
, andBridgeButton
, is a good practice for supporting multiple languages. Ensure that the translation keys used in these components are correctly defined in the translation JSON files for all supported languages.Run the following script to verify the presence of translation keys in all language files:
Also applies to: 176-176, 198-198, 247-247
packages/synapse-interface/pages/pool/poolManagement/Withdraw.tsx (2)
7-8
: Approved: Integration ofuseTranslations
hook.The
useTranslations
hook is correctly used to support internationalization, scoped to the 'Pools' namespace. This is a key enhancement for accessibility and usability across different locales.Also applies to: 49-50
254-254
: Approved: Dynamic translation of "Withdraw Percentage" label.The use of the translation function
t
to dynamically translate the "Withdraw Percentage" label enhances the user interface's adaptability to different languages, improving accessibility and user experience.packages/synapse-interface/components/StateManagedBridge/DestinationAddressInput.tsx (2)
3-4
: Approved: Integration ofuseTranslations
hook inDestinationAddressInput
.The
useTranslations
hook is correctly used within theDestinationAddressInput
component, scoped to the 'Bridge' namespace. This integration is essential for localizing the bridge interface, enhancing user accessibility and experience.Also applies to: 33-33
244-244
: Approved: Dynamic translation of "To:" label and "days ago" suffix.The use of the translation function
t
to dynamically translate the "To:" label and the "days ago" suffix in theListRecipient
component enhances the user interface's adaptability to different languages, improving accessibility and user experience.Also applies to: 331-347
packages/synapse-interface/pages/stake/StakeCard.tsx (2)
3-4
: Approved: Integration ofuseTranslations
hook inStakeCard
.The
useTranslations
hook is correctly used within theStakeCard
component, scoped to the 'Pools' namespace. This integration is essential for localizing the staking interface, enhancing user accessibility and experience.Also applies to: 44-45
139-139
: Approved: Dynamic translation of various labels and messages inStakeCard
.The use of the translation function
t
to dynamically translate various labels and messages related to staking enhances the user interface's adaptability to different languages, improving accessibility and user experience. This includes labels such as "Your balances", "Unstaked", "Staked", "Claiming", "Stake", "Unstake", and various button labels.Also applies to: 141-141, 154-154, 166-166, 207-207, 211-211, 227-227, 236-236, 317-317, 319-319, 320-320, 322-322, 370-370, 371-371, 373-373
packages/synapse-interface/pages/swap/index.tsx (1)
Line range hint
69-399
: Approve enhancements inStateManagedSwap
for internationalization support.The integration of the
useTranslations
hook and the replacement of hardcoded strings with thet
function significantly enhance the maintainability and user experience by supporting multiple languages. The removal of unused imports and variables also contributes to cleaner and more efficient code.packages/synapse-interface/messages/ar.json (1)
1-377
: Translation file review for Arabic (ar.json)The JSON structure is correctly formatted, and the keys match those in the English version, ensuring consistency across translations. The translations appear accurate and contextually appropriate for the intended usage within the Synapse interface.
packages/synapse-interface/messages/en-US.json (1)
1-377
: Translation file review for English (en-US.json)The JSON structure is correctly formatted, and the translations are clear and grammatically correct. This file serves as a good base for other translations and is consistent with the expected keys and structure for localization.
packages/synapse-interface/components/StateManagedBridge/BridgeWarnings.tsx (2)
1-1
: Verify the import ofuseTranslations
.Ensure that the
next-intl
library is correctly installed and that the import path is accurate. This is crucial for the functionality of internationalization.
Line range hint
9-44
: Approve the use of translations but verify translation keys.The implementation of the
useTranslations
hook and its usage in the JSX are correctly done. However, ensure that the translation keys (WarningMessage1
,WarningMessage2
, etc.) are properly defined in the corresponding JSON files under/messages
.Verification successful
Translation keys are correctly defined and implemented.
The translation keys
WarningMessage1
,WarningMessage2
,WarningMessage3
, andWarningMessage4
are properly defined in the translation files across multiple languages. The implementation in the code is correct and does not require any changes.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the translation keys are defined in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Keys should be present. rg --type json -A 5 $'WarningMessage1|WarningMessage2|WarningMessage3|WarningMessage4' ./messagesLength of output: 149
Script:
#!/bin/bash # Step 1: Locate JSON files in the repository to find potential translation files. fd --type f --extension json # Step 2: Search for the translation keys in the identified JSON files. # This will be executed after identifying the correct path from step 1.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys in the identified JSON files within the messages directory. rg --type json -A 5 $'WarningMessage1|WarningMessage2|WarningMessage3|WarningMessage4' packages/synapse-interface/messages/Length of output: 5408
packages/synapse-interface/utils/actions/withdrawStake.tsx (2)
9-10
: Verify the imports ofuseTranslations
andTranslatedText
.Ensure that the
next-intl
library is correctly installed and that the import paths foruseTranslations
andTranslatedText
are accurate. These are crucial for the functionality of internationalization in the user interface.
41-43
: Approve the use of translations but verify translation keys.The implementation of the
TranslatedText
component and its usage in the toast notification are correctly done. However, ensure that the translation key (Withdrawal completed
) is properly defined in the corresponding JSON files under/messages
.Verification successful
Translation Key Verified: "Withdrawal completed"
The translation key "Withdrawal completed" is correctly defined in the translation files for multiple languages, including English, Spanish, French, and others. The implementation of the
TranslatedText
component in the code is verified to be correct. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the translation key is defined in the JSON files. # Test: Search for the translation key in the JSON files. Expect: Key should be present. rg --type json -A 5 $'Withdrawal completed' ./messagesLength of output: 106
Script:
#!/bin/bash # Step 1: Locate JSON files that might contain translation keys. fd --type f --extension json # Step 2: Search for the translation key "Withdrawal completed" in the located JSON files. # This step will be executed after identifying the correct path from Step 1.Length of output: 13328
Script:
#!/bin/bash # Search for the translation key "Withdrawal completed" in the JSON files located in the messages directory. rg --type json -A 5 'Withdrawal completed' packages/synapse-interface/messages/Length of output: 3839
packages/synapse-interface/pages/landing/sections/SecuritySection.tsx (2)
1-1
: Verify the import ofuseTranslations
.Ensure that the
next-intl
library is correctly installed and that the import path is accurate. This is crucial for the functionality of internationalization.
10-45
: Approve the use of translations but verify translation keys.The implementation of the
useTranslations
hook and its usage in the JSX are correctly done. However, ensure that the translation keys (title
,description.part1
, etc.) are properly defined in the corresponding JSON files under/messages
.Verification successful
Translation keys are correctly defined.
The translation keys used in the
SecuritySection
component are present in the translation files located inpackages/synapse-interface/messages/
. This confirms that the implementation is correct and supports multiple languages. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the translation keys are defined in the JSON files. # Test: Search for the translation keys in the JSON files. Expect: Keys should be present. rg --type json -A 5 $'title|description.part1|description.strong1|description.part2|description.strong2|description.part3|extensibleHeader|extensibleDescription|secureHeader|secureDescription|generalizedHeader|generalizedDescription' ./messagesLength of output: 296
Script:
#!/bin/bash # Find all JSON files in the repository to locate potential translation files. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Search for the translation keys in the JSON files located in the messages directory. rg --type json -A 5 $'title|description.part1|description.strong1|description.part2|description.strong2|description.part3|extensibleHeader|extensibleDescription|secureHeader|secureDescription|generalizedHeader|generalizedDescription' packages/synapse-interface/messages/Length of output: 24984
packages/synapse-interface/components/Portfolio/components/PortfolioTabManager.tsx (2)
2-2
: Approved import ofuseTranslations
.The addition of
useTranslations
fromnext-intl
is correctly implemented to support internationalization.
19-31
: Verify translation keys and approve changes.The integration of
useTranslations
and the use of translation keysPortfolio.Portfolio
andActivity.Activity
are correctly implemented. Ensure that these keys are correctly defined in the translation files.packages/synapse-interface/pages/stake/[routerIndex].tsx (2)
14-27
: Approved changes togetStaticPaths
.The modification to accept a
locales
parameter and generate paths for multiple locales is correctly implemented. Verify that this integration works correctly with the routing configuration.Verification successful
Locale-based routing is correctly configured.
The
next.config.js
file inpackages/synapse-interface
confirms that the application is set up to handle multiple locales, supporting the changes made in thegetStaticPaths
function. This integration appears to be correctly implemented.
packages/synapse-interface/next.config.js
: Containsi18n
configuration with multiple locales.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of locales in routing. # Test: Check the routing configuration for locale support. Expect: Routing should handle multiple locales. cat ./next.config.js | grep 'locales'Length of output: 86
Script:
#!/bin/bash # Description: Search for locale-related configurations or code in the codebase. # Search for any files that might contain locale configurations or references to internationalization. rg 'locale|i18n|internationalization' --glob '!node_modules/*' --glob '!*dist/*' --glob '!*build/*'Length of output: 12235
30-40
: Approved changes togetStaticProps
.The dynamic import of messages based on locale and their combination using
deepmerge
is correctly implemented. Ensure that the messages are correctly structured and merged in the translation files.Verification successful
Translation files are correctly structured and suitable for merging.
The translation message files are well-structured with consistent key-value pairs across different locales, making them appropriate for dynamic import and merging using
deepmerge
in thegetStaticProps
function.
- Files verified:
ar.json
,en-US.json
,es.json
,fr.json
,jp.json
,tr.json
,zh-CN.json
inpackages/synapse-interface/messages
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the structure and merging of translation messages. # Test: Check the structure of translation messages in the JSON files. Expect: Messages should be correctly structured and merged. rg --type json -A 5 $'messages' ./messagesLength of output: 92
Script:
#!/bin/bash # Locate JSON files that might contain translation messages. fd --extension json # Verify the structure of the located JSON files. # This will be done in a subsequent step once the files are located.Length of output: 13319
Script:
#!/bin/bash # Verify the structure of the translation message JSON files. for file in packages/synapse-interface/messages/*.json; do echo "Checking structure of $file" jq '.' "$file" doneLength of output: 114996
packages/synapse-interface/pages/landing/sections/ResourcesSection.tsx (2)
2-2
: Approved import ofuseTranslations
.The addition of
useTranslations
fromuse-intl
is correctly implemented to support internationalization.
11-40
: Verify translation keys and approve changes.The integration of
useTranslations
and the use of various translation keys for UI elements are correctly implemented. Ensure that these keys are correctly defined in the translation files.Verification successful
Translation keys are correctly defined and verified.
The translation keys used in the
ResourcesSection
component are present in the translation files for multiple languages, confirming the correct implementation of internationalization. No issues were found with the translation keys.
- Verified in:
packages/synapse-interface/messages/en-US.json
,es.json
,fr.json
,jp.json
,ar.json
,zh-CN.json
,tr.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of translation keys in the JSON files. # Test: Search for the translation keys in the messages directory. Expect: Keys should exist in all language files. rg --type json -A 5 $'Get started now|Find the resources|References|Documentation|Tutorials' ./messagesLength of output: 155
Script:
#!/bin/bash # Locate JSON files that might contain translations. fd --type f --extension json # Once located, search for the translation keys in the identified JSON files. # This command will be executed after identifying the correct path.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys in the identified JSON files in the messages directory. rg --type json -A 5 $'Get started now|Find the resources|References|Documentation|Tutorials' packages/synapse-interface/messagesLength of output: 11280
packages/synapse-interface/components/StateManagedBridge/hooks/useToTokenListArray.ts (3)
3-3
: Approved import for internationalization.The addition of
useTranslations
fromnext-intl
is crucial for supporting multiple languages as described in the PR. This change aligns with the objectives of enhancing accessibility and user experience.
14-15
: Approved use of translation hook with namespace.The use of
useTranslations('Bridge')
to obtain the translation functiont
is appropriate. It ensures that translations are modular and maintainable. However, ensure that the 'Bridge' namespace exists in the translation JSON files to avoid runtime errors.Verification successful
Verified: 'Bridge' namespace exists in translation files.
The 'Bridge' namespace is present in multiple translation files, confirming that the use of
useTranslations('Bridge')
is supported by the necessary translation data. This ensures proper internationalization for the 'Bridge' component.
- Found in:
en-US.json
,es.json
,fr.json
,jp.json
,tr.json
,zh-CN.json
,ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the 'Bridge' namespace in translation files. # Test: Search for the 'Bridge' namespace in JSON files. Expect: At least one occurrence. rg --type json '"Bridge":' /messagesLength of output: 88
Script:
#!/bin/bash # Locate JSON files that might contain translations and search for the 'Bridge' namespace. # Step 1: Find JSON files in the repository. fd --extension json > json_files.txt # Step 2: Search for the 'Bridge' namespace in the located JSON files. if [ -s json_files.txt ]; then rg '"Bridge":' $(cat json_files.txt) else echo "No JSON files found." fiLength of output: 15207
90-92
: Approved use of translated strings as keys but verify their correctness.Using translated strings as keys in the return object is innovative and enhances localization. However, it's crucial to ensure that these keys are unique and correctly implemented across all languages to prevent issues with key collisions or missing translations.
Verification successful
Translation keys are correctly implemented and unique.
The translation keys "ReceiveWithEllipsis", "All receivable tokens", and "All other tokens" are correctly implemented and translated across multiple languages, ensuring their uniqueness and correctness. No issues with key collisions or missing translations were found.
- Located in:
packages/synapse-interface/messages/zh-CN.json
,packages/synapse-interface/messages/ar.json
,packages/synapse-interface/messages/en-US.json
,packages/synapse-interface/messages/fr.json
,packages/synapse-interface/messages/tr.json
,packages/synapse-interface/messages/es.json
,packages/synapse-interface/messages/jp.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the uniqueness and correctness of translation keys used in the return object. # Test: Search for the translation keys in JSON files and ensure they are unique and correctly implemented. Expect: Unique keys across all files. rg --type json -e '"ReceiveWithEllipsis":' -e '"All receivable tokens":' -e '"All other tokens":' /messagesLength of output: 159
Script:
#!/bin/bash # Locate JSON files and search for translation keys to verify their uniqueness and correctness. # Find all JSON files in the repository. fd --type f --extension json > json_files.txt # Search for the translation keys in the located JSON files. rg -f json_files.txt -e '"ReceiveWithEllipsis":' -e '"All receivable tokens":' -e '"All other tokens":'Length of output: 42888
packages/synapse-interface/components/Portfolio/components/SearchBar.tsx (1)
3-3
: Approved import ofuseTranslations
.The import is correctly placed and necessary for internationalization support.
packages/synapse-interface/pages/pool/poolManagement/DepositButton.tsx (1)
4-4
: Approved import ofuseTranslations
.The import is correctly placed and necessary for internationalization support.
packages/synapse-interface/pages/stake/index.tsx (2)
3-3
: Approved import ofuseTranslations
.The import is correctly placed and necessary for internationalization support.
Line range hint
38-112
: Approved internationalization enhancements with a suggestion.The integration of the
useTranslations
hook in theStakePage
component is well-implemented. Ensure that all text elements, including error messages and other dynamic content, are covered by translations to maintain consistency across the application.packages/synapse-interface/pages/pool/PoolBody.tsx (4)
7-7
: Correct import for internationalization.The import of
useTranslations
fromnext-intl
is correctly placed and essential for enabling internationalization in this component.
38-39
: Proper initialization of translation function.The
t
function is correctly initialized with the 'Pools' namespace. Ensure that the translation keys in/messages/{locale}.json
files correspond to this namespace.Verification successful
Proper initialization of translation function confirmed.
The 'Pools' namespace is correctly set up in the translation files across multiple languages, confirming the proper initialization of the translation function. No further action is needed.
- Translation files with 'Pools' namespace:
packages/synapse-interface/messages/en-US.json
packages/synapse-interface/messages/fr.json
packages/synapse-interface/messages/es.json
packages/synapse-interface/messages/ar.json
packages/synapse-interface/messages/jp.json
packages/synapse-interface/messages/tr.json
packages/synapse-interface/messages/zh-CN.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of 'Pools' namespace in translation JSON files. # Test: Search for 'Pools' namespace in translation JSON files. Expect: At least one occurrence in each file. rg --type json '"Pools":' /messagesLength of output: 87
Script:
#!/bin/bash # Locate JSON files in the repository that might contain translation keys. fd --extension json # Search for the 'Pools' namespace in the located JSON files. rg --type json '"Pools":'Length of output: 14226
60-60
: Dynamic text replacement for navigation.The string "Back to Pools" is correctly replaced with its dynamic translation using
t('Back to Pools')
. Verify that this key exists in the translation files.Verification successful
Translation key "Back to Pools" is correctly configured.
The translation key "Back to Pools" is present in multiple translation files, confirming that the dynamic text replacement is correctly supported for internationalization.
- Found in:
zh-CN.json
,tr.json
,fr.json
,es.json
,en-US.json
,ar.json
,jp.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of 'Back to Pools' key in translation JSON files. # Test: Search for 'Back to Pools' key in translation JSON files. Expect: At least one occurrence in each file. rg --type json '"Back to Pools":' /messagesLength of output: 95
Script:
#!/bin/bash # Locate JSON files that might contain translation keys. fd --type f --extension json # Search for the "Back to Pools" key in the located JSON files. rg --type json '"Back to Pools":'Length of output: 13953
76-76
: Dynamic translation of action options.The action options "Stake", "Unstake", and "Claim" are dynamically translated, enhancing accessibility. Verify that these keys exist in the translation files.
Verification successful
Dynamic translation of action options verified.
The translation keys "Stake", "Unstake", and "Claim" are present in the translation files, confirming that the dynamic translation setup is correctly supported. No issues found with the translation implementation.
- Translation keys are present in
packages/synapse-interface/messages
for multiple languages.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of 'Stake', 'Unstake', 'Claim' keys in translation JSON files. # Test: Search for 'Stake', 'Unstake', 'Claim' keys in translation JSON files. Expect: At least one occurrence for each key. rg --type json '"Stake":' /messages rg --type json '"Unstake":' /messages rg --type json '"Claim":' /messagesLength of output: 265
Script:
#!/bin/bash # Locate JSON files that might contain translation keys for dynamic text replacement. # Find all JSON files in the repository to identify potential translation files. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Verify the presence of 'Stake', 'Unstake', 'Claim' keys in the identified translation JSON files. # Search for 'Stake', 'Unstake', 'Claim' keys in the translation JSON files located in packages/synapse-interface/messages. rg --type json '"Stake":' packages/synapse-interface/messages rg --type json '"Unstake":' packages/synapse-interface/messages rg --type json '"Claim":' packages/synapse-interface/messagesLength of output: 2112
packages/synapse-interface/pages/pools/PoolCard.tsx (4)
7-7
: Internationalization Hook AddedThe
useTranslations
hook fromnext-intl
has been correctly imported and is used to facilitate the translation of UI text. This is a crucial part of supporting multiple languages.
142-142
: Usage of Translation HookThe translation hook
useTranslations
is used within theManageLp
andDisplayBalances
components to fetch translation functions. This is consistent with the PR's objective to internationalize user-facing strings.Also applies to: 196-196
178-184
: Dynamic Translation of Action OptionsThe action options within the
PoolActionOptions
component are now dynamically translated using thet
function. This ensures that the component's UI text can adapt to different languages, enhancing accessibility and user experience.
253-253
: Translation of the 'Earned' LabelThe label "Earned" in the
DisplayBalances
component is now fetched through the translation functiont
, replacing a hardcoded string. This change is part of the broader effort to make the application's interface language-agnostic.packages/synapse-interface/messages/jp.json (1)
1-377
: Comprehensive Japanese Translations ProvidedThe JSON file provides a comprehensive set of Japanese translations for the application's UI. The structure is correct, and the keys are appropriately named, which should integrate well with the
next-intl
implementation in the application.packages/synapse-interface/pages/state-managed-bridge/index.tsx (3)
13-13
: Internationalization Hook AddedThe
useTranslations
hook fromnext-intl
has been correctly imported and is used to facilitate the translation of UI text. This is a crucial part of supporting multiple languages.Also applies to: 82-82
164-173
: Dynamic Translation of Bridge MessagesThe success and error messages within the
StateManagedBridge
component are now dynamically translated using thet
function. This ensures that the component's UI text can adapt to different languages, enhancing accessibility and user experience.Also applies to: 179-188, 370-378
438-439
: Page Header TranslationsThe
PageHeader
component'stitle
andsubtitle
props have been updated to use thet
function for dynamic translation. This aligns with the internationalization practices and ensures that the header is adaptable to different languages.packages/synapse-interface/pages/pool/PoolInfoSection/index.tsx (3)
2-2
: Approved: Import ofuseTranslations
.The import is correctly placed and is essential for enabling internationalization in this component.
17-18
: Approved: Scoped use ofuseTranslations
.The
t
function is correctly scoped to the 'Pools.Other' namespace, which is a good practice for organizing translations.
Line range hint
24-62
: Approved: Integration of dynamic translations.The use of translation keys in
InfoSectionCard
andInfoListItem
components enhances the component's adaptability to different languages. Ensure that these keys are correctly defined in the respective JSON files under/messages
.Run the following script to verify the existence of translation keys:
Verification successful
Translation Keys Verified: Dynamic translations are correctly integrated.
The translation keys for "Trading Fee," "Virtual Price," "Total Liquidity," and "Total Liquidity USD" are present in the translation files for multiple languages, confirming the successful integration of dynamic translations. No issues found.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of translation keys in JSON files. # Test: Search for the translation keys in JSON files. Expect: Keys should exist in the files. rg --type json -A 5 $'("Trading Fee"|"Virtual Price"|"Total Liquidity"|"Total Liquidity USD")' ./messagesLength of output: 157
Script:
#!/bin/bash # Find all JSON files in the repository to locate potential translation files. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Search for the translation keys in the identified JSON files within the messages directory. rg --type json -A 5 $'("Trading Fee"|"Virtual Price"|"Total Liquidity"|"Total Liquidity USD")' packages/synapse-interface/messages/Length of output: 5261
Tools
Biome
[error] 38-38: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
packages/synapse-interface/components/Portfolio/components/PortfolioTokenAsset.tsx (3)
5-5
: Approved: Import ofuseTranslations
.The import is correctly placed and is essential for enabling internationalization in this component.
57-58
: Approved: Scoped use ofuseTranslations
.The
t
function is correctly scoped to the 'Portfolio' namespace, which is a good practice for organizing translations.
Line range hint
84-104
: Approved: Integration of dynamic translations.The use of translation keys in
HoverTooltip
andGasIcon
components enhances the component's adaptability to different languages. Ensure that these keys are correctly defined in the respective JSON files under/messages
.Run the following script to verify the existence of translation keys:
Verification successful
Translation Keys Verified:
The translation keys "Available" and "Gas token" are correctly defined in the translation files for multiple languages, ensuring proper internationalization support. This confirms the integration of dynamic translations in the
HoverTooltip
andGasIcon
components is well-supported.
- Translation keys found in:
packages/synapse-interface/messages/en-US.json
,jp.json
,zh-CN.json
,tr.json
,fr.json
,es.json
,ar.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of translation keys in JSON files. # Test: Search for the translation keys in JSON files. Expect: Keys should exist in the files. rg --type json -A 5 $'("Available"|"Gas token")' ./messagesLength of output: 111
Script:
#!/bin/bash # Locate JSON files that might contain translation keys. fd --type f --extension json # Once located, search for the translation keys "Available" and "Gas token" in these files. rg --type json -A 5 $'("Available"|"Gas token")'Length of output: 23916
packages/synapse-interface/components/Portfolio/components/SingleNetworkPortfolio.tsx (3)
5-5
: Approved: Import ofuseTranslations
.The import is correctly placed and is essential for enabling internationalization in this component.
47-48
: Approved: Scoped use ofuseTranslations
.The
t
function is correctly scoped to the 'Portfolio' namespace, which is a good practice for organizing translations.
105-113
: Approved: Integration of dynamic translations.The use of translation keys in
WarningMessage
enhances the component's adaptability to different languages. Ensure that these keys are correctly defined in the respective JSON files under/messages
.Run the following script to verify the existence of translation keys:
Verification successful
Translation Keys Verified Successfully
The translation keys used in the
WarningMessage
component are correctly defined across multiple language files in thepackages/synapse-interface/messages
directory. This confirms the successful integration of dynamic translations. No further action is required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of translation keys in JSON files. # Test: Search for the translation keys in JSON files. Expect: Keys should exist in the files. rg --type json -A 5 $'("This chain is not yet supported; New chain or token support can be discussed on"|"Twitter"|"or"|"Discord")' ./messagesLength of output: 194
Script:
#!/bin/bash # Locate JSON files in the repository that might contain translation keys. fd --type f --extension json # Once JSON files are located, search for the translation keys in these files. # This command will be executed after identifying the JSON files.Length of output: 13328
Script:
#!/bin/bash # Search for the translation keys in the JSON files within the messages directory. rg --type json -A 5 $'("This chain is not yet supported; New chain or token support can be discussed on"|"Twitter"|"or"|"Discord")' packages/synapse-interface/messagesLength of output: 15590
packages/synapse-interface/utils/actions/approveAndDeposit.tsx (7)
17-17
: Approved: Import of TranslatedText component.The import of the
TranslatedText
component from@/components/ui/TranslatedText
is correctly done and is essential for the internationalization features being implemented in this PR.
268-270
: Refactor: Enhanced localization for success message in empty pool deposit function.The success message for the empty pool deposit function now utilizes
TranslatedText
, improving the localization support. Verify that the `id" "Liquidity added" exists in the translation JSON files under the namespace "Pools".Verification successful
Verification Successful: Translation ID "Liquidity added" Exists
The translation ID "Liquidity added" is present in multiple translation files under the
packages/synapse-interface/messages
directory, confirming enhanced localization support as intended.
- Found in:
en-US.json
,tr.json
,zh-CN.json
,fr.json
,jp.json
,es.json
,ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Liquidity added' id in the translation JSON files. # Test: Search for the 'Liquidity added' id in the translation JSON files. Expect: At least one occurrence. rg --type json -A 5 $'Liquidity added' ./messagesLength of output: 101
Script:
#!/bin/bash # Locate all JSON files in the repository that might contain translation keys. fd --type f --extension json # Search for the 'Liquidity added' ID in all JSON files found. rg --type json -A 5 'Liquidity added'Length of output: 16929
221-225
: Refactor: Use of TranslatedText for empty pool deposit start message.The introduction of
TranslatedText
for the empty pool deposit start message aligns with the internationalization efforts. Ensure that theid
"Starting your deposit" is correctly defined in the translation JSON files under the namespace "Pools.Other".Verification successful
Verification Successful: Translation ID "Starting your deposit" is correctly defined.
The translation ID "Starting your deposit" is present in the translation files for multiple languages, confirming proper internationalization support. This aligns with the objectives of the PR.
- Found in:
en-US.json
,zh-CN.json
,tr.json
,jp.json
,fr.json
,ar.json
,es.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Starting your deposit' id in the translation JSON files. # Test: Search for the 'Starting your deposit' id in the translation JSON files. Expect: At least one occurrence. rg --type json -A 5 $'Starting your deposit' ./messagesLength of output: 107
Script:
#!/bin/bash # Locate JSON files that might contain translation keys fd --type f --extension json # Once located, search for the translation ID "Starting your deposit" within those files rg --type json -A 5 'Starting your deposit'Length of output: 16387
180-182
: Refactor: Enhanced localization for success message in deposit function.The success message for the deposit function now utilizes
TranslatedText
, improving the localization support. Verify that theid
"Liquidity added" exists in the translation JSON files under the namespace "Pools".Verification successful
Translation ID "Liquidity added" Verified in Multiple Languages
The translation ID "Liquidity added" is present in the translation JSON files under the namespace "Pools" for multiple languages, including English, French, Spanish, Japanese, Turkish, Chinese, and Arabic. This confirms that the localization support for the success message in the deposit function is correctly implemented.
- Files containing the translation ID:
packages/synapse-interface/messages/en-US.json
packages/synapse-interface/messages/fr.json
packages/synapse-interface/messages/es.json
packages/synapse-interface/messages/jp.json
packages/synapse-interface/messages/tr.json
packages/synapse-interface/messages/zh-CN.json
packages/synapse-interface/messages/ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Liquidity added' id in the translation JSON files. # Test: Search for the 'Liquidity added' id in the translation JSON files. Expect: At least one occurrence. rg --type json -A 5 $'Liquidity added' ./messagesLength of output: 101
Script:
#!/bin/bash # Find all JSON files in the repository that might contain translation keys. fd --type f --extension json # Once the files are identified, search for the "Liquidity added" ID within those files. # This command will be executed after identifying the correct files.Length of output: 13328
Script:
#!/bin/bash # Search for the "Liquidity added" ID within the translation JSON files in the packages/synapse-interface/messages/ directory. rg --type json -A 5 'Liquidity added' packages/synapse-interface/messages/Length of output: 3637
70-73
: Refactor: Enhanced localization for success message.The success message now utilizes
TranslatedText
, which should correctly reflect the localized string based on the user's settings. Verify that theid
"Successfully approved on" exists in the translation JSON files under the namespace "Pools".Verification successful
Translation ID Verified: "Successfully approved on" Exists
The translation ID "Successfully approved on" is present in the translation JSON files under the namespace "Pools" for multiple languages, confirming that the localization setup is correctly implemented.
- Found in
packages/synapse-interface/messages/en-US.json
- Found in
packages/synapse-interface/messages/es.json
- Found in
packages/synapse-interface/messages/fr.json
- Found in
packages/synapse-interface/messages/jp.json
- Found in
packages/synapse-interface/messages/tr.json
- Found in
packages/synapse-interface/messages/zh-CN.json
- Found in
packages/synapse-interface/messages/ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Successfully approved on' id in the translation JSON files. # Test: Search for the 'Successfully approved on' id in the translation JSON files. Expect: At least one occurrence. rg --type json -A 5 $'Successfully approved on' ./messagesLength of output: 110
Script:
#!/bin/bash # Find all JSON files in the repository that might contain translation strings. fd --extension jsonLength of output: 13319
Script:
#!/bin/bash # Search for the translation ID "Successfully approved on" in the translation JSON files. rg --type json 'Successfully approved on' packages/synapse-interface/messages/Length of output: 773
29-36
: Refactor: Use of TranslatedText for dynamic localization.The introduction of
TranslatedText
for the approval request message enhances the adaptability of the application for different languages. Ensure that theid
"Requesting approval" is correctly defined in the translation JSON files under the namespace "Pools.Other".Verification successful
Verification Successful: Translation Key Present
The 'Requesting approval' translation key is correctly defined in the translation JSON files for multiple languages, confirming the proper implementation of the
TranslatedText
component for localization. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Requesting approval' id in the translation JSON files. # Test: Search for the 'Requesting approval' id in the translation JSON files. Expect: At least one occurrence. rg --type json -A 5 $'Requesting approval' ./messagesLength of output: 105
Script:
#!/bin/bash # Step 1: Locate JSON files in the repository to find translation files. fd --type f --extension json # Step 2: Once located, search for the 'Requesting approval' id in those files. # This step will be executed after identifying the correct path from step 1.Length of output: 13328
Script:
#!/bin/bash # Search for the 'Requesting approval' id in the translation JSON files located in the messages directory. rg --type json -A 5 'Requesting approval' packages/synapse-interface/messagesLength of output: 3221
120-124
: Refactor: Use of TranslatedText for deposit start message.The introduction of
TranslatedText
for the deposit start message is a positive change for localization. Ensure that theid
"Starting your deposit" is correctly defined in the translation JSON files under the namespace "Pools.Other".Verification successful
Verification Successful: Translation ID "Starting your deposit" is correctly defined.
The translation ID "Starting your deposit" is present in all relevant language files, confirming that the localization setup is complete and consistent. No further action is needed.
- Files checked:
zh-CN.json
,tr.json
,fr.json
,jp.json
,es.json
,en-US.json
,ar.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the presence of the 'Starting your deposit' id in the translation JSON files. # Test: Search for the 'Starting your deposit' id in the translation JSON files. Expect: At least one occurrence. rg --type json -A 5 $'Starting your deposit' ./messagesLength of output: 107
Script:
#!/bin/bash # Locate JSON files in the repository that might contain translation keys. fd --type f --extension json # Once the JSON files are located, search for the translation ID "Starting your deposit" in those files. # This command will be executed after identifying the correct path.Length of output: 13328
Script:
#!/bin/bash # Search for the translation ID "Starting your deposit" in the JSON files located in packages/synapse-interface/messages/. rg --type json -A 5 'Starting your deposit' packages/synapse-interface/messages/Length of output: 3095
packages/synapse-interface/components/Portfolio/components/NoSearchResultContent.tsx
Show resolved
Hide resolved
packages/synapse-interface/pages/returntomonke/PfpGeneratorCard.tsx
Outdated
Show resolved
Hide resolved
packages/synapse-interface/components/StateManagedBridge/MaxButton.tsx
Outdated
Show resolved
Hide resolved
packages/synapse-interface/components/Portfolio/components/SearchBar.tsx
Show resolved
Hide resolved
in the french crypto community, people use "bridge" instead of the direct translation "pont"
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (1)
- packages/synapse-interface/package.json (3 hunks)
Additional comments not posted (4)
packages/synapse-interface/package.json (4)
18-18
: Approved: New script for finding untranslated string literals.The addition of
"lint:find-string-literals"
script is a proactive step towards ensuring all user-facing strings are internationalized. This aligns well with the PR's objectives of enhancing internationalization support.
19-19
: Approved: New script for checking translation JSON files.The addition of
"check-translation-jsons"
script is essential for ensuring consistency across translation files. It helps in identifying discrepancies between the default language file and other translations, which is crucial for maintaining a high-quality user experience in multiple languages.
59-59
: Approved: Addition ofnext-intl
for internationalization support.The inclusion of
"next-intl"
as a dependency is a key component in implementing internationalization within the Synapse interface. This library provides robust tools for managing translations and will significantly enhance the accessibility of the platform for users across different languages.
112-114
: Approved: Reintroduction of ESLint dependencies for enhanced linting capabilities.The reintroduction of
"eslint"
,"eslint-config-next"
, and"eslint-plugin-i18next"
is crucial for maintaining high code quality, especially with the added focus on internationalization. These tools will help ensure that the internationalization efforts adhere to best practices and are free from common coding errors.
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/synapse-interface/messages/fr.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/synapse-interface/messages/fr.json
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/synapse-interface/messages/ar.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/synapse-interface/messages/ar.json
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (3)
- packages/synapse-interface/components/LanguageSelector.tsx (1 hunks)
- packages/synapse-interface/next.config.js (1 hunks)
- packages/synapse-interface/package.json (3 hunks)
Files skipped from review as they are similar to previous changes (2)
- packages/synapse-interface/components/LanguageSelector.tsx
- packages/synapse-interface/next.config.js
Additional comments not posted (4)
packages/synapse-interface/package.json (4)
18-18
: Approved: New script for finding untranslated string literals.The script
"lint:find-string-literals"
is correctly set up to use ESLint with a specific configuration for identifying untranslated string literals. This aligns well with the PR's goal of enhancing internationalization.
19-19
: Approved: New script for checking translation JSON files.The script
"check-translation-jsons"
is correctly set up to run a Node.js script that validates translation JSON files. This supports the PR's internationalization efforts.Please ensure that the script
scripts/checkTranslationJsons.js
is correctly implemented and handles all edge cases.
59-59
: Approved: Addition ofnext-intl
for internationalization.The dependency
"next-intl": "^3.19.0"
has been added to support internationalization features in the application. This is a crucial part of the PR's objectives.Ensure that the version
"^3.19.0"
ofnext-intl
is compatible with the current project setup and other dependencies.
112-114
: Approved: Reintroduction of ESLint dependencies for enhanced linting.The dependencies
"eslint": "^8.37.0"
,"eslint-config-next": "^13.5.6"
, and"eslint-plugin-i18next": "^6.0.9"
have been reintroduced to enhance linting capabilities, particularly for i18n practices. This aligns with the PR's focus on internationalization.Ensure that these versions are compatible with the project's existing setup and do not introduce any conflicts with other dependencies.
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (6)
- packages/synapse-interface/README.md (4 hunks)
- packages/synapse-interface/components/StateManagedBridge/MaxButton.tsx (2 hunks)
- packages/synapse-interface/components/ui/TranslatedText.tsx (1 hunks)
- packages/synapse-interface/pages/landing/sections/ResourcesSection.tsx (1 hunks)
- packages/synapse-interface/pages/pool/components/ReceivedTokenSection.tsx (3 hunks)
- packages/synapse-interface/pages/returntomonke/PfpGeneratorCard.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- packages/synapse-interface/README.md
- packages/synapse-interface/pages/landing/sections/ResourcesSection.tsx
- packages/synapse-interface/pages/pool/components/ReceivedTokenSection.tsx
- packages/synapse-interface/pages/returntomonke/PfpGeneratorCard.tsx
Additional comments not posted (2)
packages/synapse-interface/components/ui/TranslatedText.tsx (1)
1-16
: LGTM!The code changes are approved. The component is well-implemented and already uses TypeScript interfaces to validate the props as suggested in the previous review comment.
packages/synapse-interface/components/StateManagedBridge/MaxButton.tsx (1)
2-2
: LGTM!The code changes are approved. The
useTranslations
hook is correctly imported fromnext-intl
and used to dynamically translate the button label.Also applies to: 15-15, 19-19
Description
This PR adds
next-intl
to support multiple languages. Message translations exist in/messages
. When adding a new language, the next config andLanguageSelector
components are updated along with the new translation json in the/messages/{locale}.json
.Additional context
Additionally there are two helper scripts:
yarn lint:find-string-literals
which finds string literals that are yet to be translated across the application.yarn check-translation-jsons
which compares/messages
jsons with/messages/en-US.json
(default) to determine if there are any diffs that need correcting.Summary by CodeRabbit
Summary by CodeRabbit
New Features
LanguageSelector
component for users to select their preferred language.Documentation
Bug Fixes
8c80c8a: synapse-interface preview link
3ff5c89: synapse-interface preview link
b4b8166: synapse-interface preview link
d739ac5: synapse-interface preview link
0d8cb3a: synapse-interface preview link
75a4dfc: synapse-interface preview link
2e32132: synapse-interface preview link