Skip to content

Commit

Permalink
add megavault strings (#698)
Browse files Browse the repository at this point in the history
* add megavault texts

* Update app.ts

* add generate to bump version script

* add new script for PRs

* bump to 1.1.199

* unique-ify the string key

---------

Co-authored-by: Mike <[email protected]>
  • Loading branch information
mike-dydx and mike-dydx authored Sep 17, 2024
1 parent 2074365 commit 712296e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
4 changes: 4 additions & 0 deletions config/localization/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,9 @@
},
"VAULTS": {
"VAULT": "Vault",
"MEGAVAULT": "MegaVault",
"VAULT_FAQS": "Vault FAQs",
"MEGAVAULT_FAQS": "MegaVault FAQs",
"YOUR_ALL_TIME_PNL": "Your All-time P&L",
"VAULT_THIRTY_DAY_APR": "30d APR",
"VAULT_THIRTY_DAY_PNL": "30d P&L",
Expand All @@ -1672,6 +1674,8 @@
"AMOUNT_TO_WITHDRAW": "Amount to Withdraw",
"PREVIEW_WITHDRAW": "Preview Withdraw",
"PREVIEW_DEPOSIT": "Preview Deposit",
"CONFIRM_WITHDRAW_CTA": "Confirm Withdraw",
"CONFIRM_DEPOSIT_CTA": "Confirm Deposit",
"AMOUNT_TO_DEPOSIT": "Amount to Deposit",
"CROSS_ACCOUNT": "Cross Account",
"VAULT_DESCRIPTION": "This vault provides automated liquidity on all dYdX markets and gets a share of fee revenue. Vaults aim for a market-neutral position by quoting both sides of the book. P&L will vary based on market conditions and there's a risk of losing some or all of the USDC deposited.",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dydxprotocol/v4-localization",
"version": "1.1.200",
"version": "1.1.201",
"description": "v4 localization",
"main": "index.ts",
"scripts": {
Expand All @@ -9,7 +9,8 @@
"generate:app": "cd scripts && ./codegen_localization_app.swift ../config/localization/en/app.json > ./generated/app.ts && cd ..",
"generate:notifications": "cd scripts && ./codegen_localization_notifications.swift ../config/localization_notifications/en/app.json > ./generated/notifications.ts && cd ..",
"generate:tooltips": "cd scripts && ./codegen_localization_tooltips.swift ../config/localization/en/tooltips.json > ./generated/tooltips.ts && cd ..",
"bump_version": "./scripts/bump_version.sh"
"bump_version": "./scripts/bump_version.sh",
"prepare_for_pr": "./scripts/bump_version.sh --no-warning && npm run generate"
},
"repository": {
"type": "git",
Expand Down
26 changes: 23 additions & 3 deletions scripts/bump_version.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
#!/bin/sh

# search for the first line that starts with "version" in package.json
# get the value in the quotes
# Parse the boolean parameter
SHOW_IMPORTANT_TEXT=true
if [ "$1" = "--no-warning" ]; then
SHOW_IMPORTANT_TEXT=false
fi

# Search for the first line that starts with "version" in package.json
# Get the value in the quotes
VERSION=$(cat package.json | jq -r '.version')

echo "Current version is $VERSION. Enter new version (or press enter to skip):"
read NEW_VERSION

#if NEW_VERSION is not empty, replace the version in package.json
# If NEW_VERSION is not empty, replace the version in package.json
if [ -n "$NEW_VERSION" ]; then
sed -i '' "s/ \"version\": \"$VERSION\"/ \"version\": \"$NEW_VERSION\"/" package.json
echo "Version bumped to $NEW_VERSION"
npm i
fi

# ANSI color code for red
RED='\033[0;31m'
# ANSI color code for resetting color
NC='\033[0m'

# Display the important text only if SHOW_IMPORTANT_TEXT is true
if [ "$SHOW_IMPORTANT_TEXT" = true ]; then
echo ""
echo "${RED}**************************************************************"
echo "* IMPORTANT: If you are creating a PR, run \`npm run prepare_for_pr\` *"
echo "**************************************************************${NC}"
echo ""
fi
4 changes: 4 additions & 0 deletions scripts/generated/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1829,11 +1829,15 @@ export const APP_STRING_KEYS = {
ACKNOWLEDGE_HIGH_SLIPPAGE: 'APP.VAULTS.ACKNOWLEDGE_HIGH_SLIPPAGE',
AMOUNT_TO_DEPOSIT: 'APP.VAULTS.AMOUNT_TO_DEPOSIT',
AMOUNT_TO_WITHDRAW: 'APP.VAULTS.AMOUNT_TO_WITHDRAW',
CONFIRM_DEPOSIT_CTA: 'APP.VAULTS.CONFIRM_DEPOSIT_CTA',
CONFIRM_WITHDRAW_CTA: 'APP.VAULTS.CONFIRM_WITHDRAW_CTA',
CROSS_ACCOUNT: 'APP.VAULTS.CROSS_ACCOUNT',
DEPOSIT_TOO_HIGH: 'APP.VAULTS.DEPOSIT_TOO_HIGH',
ENTER_AMOUNT_TO_DEPOSIT: 'APP.VAULTS.ENTER_AMOUNT_TO_DEPOSIT',
ENTER_AMOUNT_TO_WITHDRAW: 'APP.VAULTS.ENTER_AMOUNT_TO_WITHDRAW',
EST_SLIPPAGE: 'APP.VAULTS.EST_SLIPPAGE',
MEGAVAULT: 'APP.VAULTS.MEGAVAULT',
MEGAVAULT_FAQS: 'APP.VAULTS.MEGAVAULT_FAQS',
PREVIEW_DEPOSIT: 'APP.VAULTS.PREVIEW_DEPOSIT',
PREVIEW_WITHDRAW: 'APP.VAULTS.PREVIEW_WITHDRAW',
PROTOCOL_VAULT: 'APP.VAULTS.PROTOCOL_VAULT',
Expand Down

0 comments on commit 712296e

Please sign in to comment.