Skip to content

Commit

Permalink
Add localization zh
Browse files Browse the repository at this point in the history
  • Loading branch information
dr497 committed Apr 9, 2021
1 parent 6ece0a9 commit 18a6aac
Show file tree
Hide file tree
Showing 32 changed files with 663 additions and 182 deletions.
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -20,11 +20,15 @@
"bs58": "^4.0.1",
"clsx": "^1.1.1",
"dotenv": "^8.2.0",
"i18next": "^20.2.1",
"i18next-browser-languagedetector": "^6.1.0",
"i18next-http-backend": "^1.2.1",
"immutable-tuple": "^0.4.10",
"nanoid": "^3.1.20",
"notistack": "^1.0.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-i18next": "^11.8.12",
"react-player": "^2.9.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
Expand Down
110 changes: 110 additions & 0 deletions public/locales/en/translation.json
@@ -0,0 +1,110 @@
{
"Discord": "Discord",
"Github": "GitHub",
"Twitter": "Twitter",
"Medium": "Medium",
"FIDA is not offered within the United States or prohibited jurisdiction.": "FIDA is not offered within the United States or prohibited jurisdiction.",
"No statement or warranty is provided in relation to the utility of this program, the safety of its code or its suitability for your use, and by using it, you agree to bear any risk associated with such potential vulnerabilities, including, but not limited to the potential loss of tokens.": "No statement or warranty is provided in relation to the utility of this program, the safety of its code or its suitability for your use, and by using it, you agree to bear any risk associated with such potential vulnerabilities, including, but not limited to the potential loss of tokens.",
"I Agree": "I Agree",
"explore": "explore",
"home": "home",
"balances": "balances",
"pools": "pools",
"create": "create",
"help": "help",
"tradingview": "tradingview",
"Custom Pool Name": "Custom Pool Name",
"Save": "Save",
"Custom TradingView Alert": "Custom TradingView Alert",
"Sentiment Strategy Pro [Benson]": "Sentiment Strategy Pro [Benson]",
"TradingView": "TradingView",
"TradingView Password": "TradingView Password",
"Webhook URL": "Webhook URL",
"TradingView Message": "TradingView Message",
"Pool Historical Performance:": "Pool Historical Performance:",
"Pool Content": "Pool Content",
"Pool Information": "Pool Information",
"Fee Schedule": "Fee Schedule",
"Tokens in the pool:": "Tokens in the pool:",
"This pool is unverified, use at your own risk": "This pool is unverified, use at your own risk",
"Pool Keys:": "Pool Keys:",
"Signal Provider": "Signal Provider",
"Pool Seed": "Pool Seed",
"Pool PublicKey": "Pool PublicKey",
"Pool Token Mint": "Pool Token Mint",
"The pool can only trade on the following markets:": "The pool can only trade on the following markets:",
"viewBotsTrade": "View the bot's trades on the <2>Solana Explorer</2>",
"Fee Period": "Fee Period",
"Deposit": "Deposit",
"withdraw": "withdraw",
"Pool Token": "Pool Token",
"It looks like you own this pool": "It looks like you own this pool",
"Admin Page": "Admin Page",
"Balance": "Balance",
"DCA Monthly": "DCA Monthly",
"DCA Weekly": "DCA Weekly",
"DCA Daily": "DCA Daily",
"Custom": "Custom",
"Select a strategy template": "Select a strategy template",
"If you select an external signal provider you will not be able to send trade orders yourself": "If you select an external signal provider you will not be able to send trade orders yourself",
"Your SOL address": "Your SOL address",
"External Signal Provider": "External Signal Provider",
"Transactions will be cranked by:": "Transactions will be cranked by:",
"Use an external signal provider": "Use an external signal provider",
"Serum Markets": "Serum Markets",
"Add Market": "Add Market",
"Initial Assets": "Initial Assets",
"Fees are split 50/25/25 between the Signal Provider, insurance fund and FIDA buy and burn 🔥": "Fees are split 50/25/25 between the Signal Provider, insurance fund and FIDA buy and burn 🔥",
"Fees": "Fees",
"Fee Collection Period": "Fee Collection Period",
"Fee Ratio (%)": "Fee Ratio (%)",
"Percentage of the pool that will be deduced for fees each period": "Percentage of the pool that will be deduced for fees each period",
"Create": "Create",
"Created Pool Seed:": "Created Pool Seed:",
"TradingView Password:": "TradingView Password:",
"Make sure to save this password in a safe place": "Make sure to save this password in a safe place",
"Pool Page": "Pool Page",
"Loading all your pools... This might take several seconds": "Loading all your pools... This might take several seconds",
"Your Pools": "Your Pools",
"Your deposit address:": "Your deposit address:",
"Amount:": "Amount:",
"Destination:": "Destination:",
"Wallet": "Wallet",
"Endpoint": "Endpoint",
"Collect Fees": "Collect Fees",
"Buy": "Buy",
"Sell": "Sell",
"Order Size (%)": "Order Size (%)",
"Limit price": "Limit price",
"Expected slippage": "Expected slippage",
"Size in tokens": "Size in tokens",
"Size in % of the pool": "Size in % of the pool",
"Place Order": "Place Order",
"Settle funds": "Settle funds",
"Pool Address": "Pool Address",
"Pool Token Supply": "Pool Token Supply",
"USD Value of the Pool": "USD Value of the Pool",
"Your Share of the Pool": "Your Share of the Pool",
"You do not own this pool": "You do not own this pool",
"Collect your fees": "Collect your fees",
"Unlock wallet": "Unlock wallet",
"Connect wallet": "Connect wallet",
"Disconnect": "Disconnect",
"Custom Pool Seed": "Custom Pool Seed",
"Go": "Go",
"cannotFind": "Cannot find your dream strategy? <2>Create your own</2>",
"Add Custom Pool": "Add Custom Pool",
"Create Pool": "Create Pool",
"Create and automate your": "Create and automate your",
"trading strategies on chain.": "trading strategies on chain.",
"Explore strategy": "Explore strategy",
"Explore": "Explore",
"Market Name": "Market Name",
"Side": "Side",
"TradingView Message Generator": "TradingView Message Generator",
"Amount to wrap": "Amount to wrap",
"Wrapp": "Wrapp",
"Wrapped SOL Account": "Wrapped SOL Account",
"Unwrap": "Unwrap",
"SOL Wrapper/Unwrapper": "SOL Wrapper/Unwrapper"
}
135 changes: 135 additions & 0 deletions public/locales/zh/translation.json
@@ -0,0 +1,135 @@
{
"Discord": "Discord",
"Github": "GitHub",
"Twitter": "Twitter",
"Medium": "Medium",
"FIDA is not offered within the United States or prohibited jurisdiction.": "FIDA is not offered within the United States or prohibited jurisdiction.",
"No statement or warranty is provided in relation to the utility of this program, the safety of its code or its suitability for your use, and by using it, you agree to bear any risk associated with such potential vulnerabilities, including, but not limited to the potential loss of tokens.": "No statement or warranty is provided in relation to the utility of this program, the safety of its code or its suitability for your use, and by using it, you agree to bear any risk associated with such potential vulnerabilities, including, but not limited to the potential loss of tokens.",
"I Agree": "我同意",
"explore": "发现",
"home": "主页",
"balances": "余额",
"pools": "我的",
"create": "创建",
"help": "帮助",
"tradingview": "tradingview",
"Custom Pool Name": "自定义资金池名称",
"Save": "保存",
"Custom TradingView Alert": "自定义TradingView警报",
"Sentiment Strategy Pro [Benson]": "Sentiment Strategy Pro [Benson]",
"TradingView": "TradingView",
"TradingView Password": "TradingView密码",
"Webhook URL": "Webhook URL",
"TradingView Message": "TradingView信息",
"Pool Historical Performance:": "历史收益:",
"Pool Content": "资产组成",
"Pool Information": "具体信息",
"Fee Schedule": "收费结构",
"This pool is unverified, use at your own risk": "该池未经验证,请自行斟酌使用风险",
"Pool Keys": "池钥信息:",
"Signal Provider": "信号提供者",
"Pool Seed": "池种子",
"Pool PublicKey": "池公钥",
"Pool Token Mint": "池通证铸币地址",
"The pool can only trade on the following markets": "该池只能在以下的市场交易:",
"viewBotsTrade": "查看历史交易,前往 <2>Solana Explorer</2>",
"Fee Period": "费用期限",
"Deposit": "入金",
"withdraw": "出金",
"Pool Token": "池通证",
"It looks like you own this pool": "看上去您拥有这个资金池",
"Admin Page": "管理页面",
"Balance": "余额",
"DCA Monthly": "月交易DCA",
"DCA Weekly": "周交易DCA",
"DCA Daily": "日交易DCA",
"Custom": "自定义",
"Select a strategy template": "选择交易策略模板",
"If you select an external signal provider you will not be able to send trade orders yourself": "如果您选择了外部信号提供者,您将不能手动地发送交易订单至池中",
"Your SOL address": "您的SOL地址",
"External Signal Provider": "外部信号提供者",
"Transactions will be cranked by:": "交易会被处理:",
"Use an external signal provider": "使用外部信号提供者",
"Serum Markets": "Serum市场",
"Add Market": "添加市场",
"Initial Assets": "初始资产",
"Fees are split 50/25/25 between the Signal Provider, insurance fund and FIDA buy and burn 🔥": "费用将以50%/25%/25%的比例分配给信号提供者,保险金和FIDA的回购销毁 🔥",
"Fees": "费用",
"Fee Collection Period": "收费期",
"Fee Ratio (%)": "费用比 (%)",
"Percentage of the pool that will be deduced for fees each period": "每个收费期从池总资产扣除的百分比手续费",
"Create": "创建",
"Created Pool Seed:": "创建的池种子:",
"TradingView Password:": "TradingView密码:",
"Make sure to save this password in a safe place": "请确保将密钥存放在安全的地方",
"Pool Page": "池页面",
"Loading all your pools... This might take several seconds": "加载您的资金池中... 可能需要一些等待时间",
"Your Pools": "您的资金池",
"Your deposit address:": "您的入金地址:",
"Amount:": "金额:",
"Destination:": "终点:",
"Wallet": "钱包",
"Endpoint": "终点",
"Collect Fees": "收取费用",
"Buy": "买入",
"Sell": "卖出",
"Order Size (%)": "订单规模(%)",
"Limit price": "限价",
"Expected slippage": "预期滑点",
"Size in tokens": "以通证数量",
"Size in % of the pool": "以池内资产的百分比",
"Place Order": "确认订单",
"Settle funds": "清算资金",
"Pool Address": "池地址",
"Pool Token Supply": "池通证供应量",
"USD Value of the Pool": "美元价值",
"Your Share of the Pool": "您的资产占比",
"You do not own this pool": "该池不属于您",
"Collect your fees": "收取您的费用",
"Unlock wallet": "解锁钱包",
"Connect wallet": "连接钱包",
"Disconnect": "断开",
"Custom Pool Seed": "自定义池种子",
"Go": "前往",
"cannotFind": "找不到您心仪的交易策略? <2>创建属于您自己的</2>",
"Add Custom Pool": "添加自定义池",
"Create Pool": "创建资金池",
"Create and automate your": "创建并自动化您的",
"trading strategies on chain.": "链上交易策略.",
"Explore strategy": "发现策略",
"Explore": "发现",
"Market Name": "市场名称",
"Side": "方向",
"TradingView Message Generator": "TradingView信息产生器",
"Amount to wrap": "包装的金额",
"Wrapp": "包装",
"Wrapped SOL Account": "Wrapped SOL地址",
"Unwrap": "取消包装",
"SOL Wrapper/Unwrapper": "SOL Wrapper/Unwrapper",

"Weekly DCA strategy:": "周交易DCA策略:",
"Every Sunday at 08:00 UTC, the pool will use 10% of the quote currency contained in the pool to perform a DCA strategy on each market.": "每周日UTC时间早上8点, 该池会用池内10%的计价货币在对应的交易对市场进行DCA策略交易.",
"Monthly DCA strategy:": "月交易DCA策略:",
"On the 1st of each month 08:00 UTC, the pool will use 10% of the quote currency contained in the pool to perform a DCA strategy on each market.": "每个月1号UTC时间早上8点, 该池会用池内10%的计价货币在对应的交易对市场进行DCA策略交易.",
"Daily DCA strategy:": "日交易策略:",
"Every day at 08:00 UTC, the pool will use 10% of the quote currency contained in the pool to perform a DCA strategy on each market.": "每天UTC时间早上8点, 该池会用池内10%的计价货币在对应的交易对市场进行DCA策略交易.",
"TradingView Alerts": "TradingView警报",
"Trade on Serum using your own custom TradingView Alerts": "在Serum上用您自定义的TradingView警报交易",
"Hide zero balances": "隐藏0余额",

"Pool Token Value": "池通证价值",
"Inception performance": "初始至今收益",
"Loading...": "加载中...",
"Tokens in the pool": "池内通证:",
"Generate": "生成",
"Size": "规模",
"Custom Daily DCA": "自定义日交易DCA",
"Custom Weekly DCA": "自定义周交易DCA",
"Custom Monthly DCA": "自定义月交易DCA",

"superTrendShort": "<0>{{ tf }} Super Trend</b> strategy on <0>{{ marketName }}</0>. Super Trend 是一个TradingView指标, 进一步了解请前往 <3>dedicated page</3>",
"rsi": "<0>{{ tf }} RSI</0> strategy on <0>{{ marketName }}</0>. RSI是动量指标,用于衡量价格变化的速度, 进一步了解请前往 <3>dedicated page</3>",
"macd": "<0>{{ tf }} MACD</0> strategy on <0>{{ marketName }}</0>. MACD是趋势跟踪指标, 进一步了解请前往 <3>dedicated page</3>",
"volExpansion": "<0>{{ tf }} Volatility Expansion Close</0> strategy on <0>{{ marketName }}</0>. 利用波动来捕捉市场中的新趋势,进一步了解请前往 <3>dedicated page</3>",
"benson": "<0>该机器人从Binance,Coinbase, Bitmex, Bybit和FTX汇总现货和合约的交易数据,以识别市场情绪. 当市场恐惧时做多,当市场乐观时退出. </0>"
}
5 changes: 4 additions & 1 deletion src/components/BalancesTable.tsx
Expand Up @@ -20,6 +20,7 @@ import Grid from '@material-ui/core/Grid';
import { Typography } from '@material-ui/core';
import FloatingCard from './FloatingCard';
import TextField from '@material-ui/core/TextField';
import Trans from './Translation';

const useStyles = makeStyles({
table: {
Expand Down Expand Up @@ -87,7 +88,9 @@ const ShowZeroBalance = ({
/>
</Grid>
<Grid item>
<Typography>Hide zero balances</Typography>
<Typography>
<Trans>Hide zero balances</Trans>
</Typography>
</Grid>
</Grid>
);
Expand Down
16 changes: 16 additions & 0 deletions src/components/ChangeLanguage.tsx
@@ -0,0 +1,16 @@
import React from 'react';
import { Button } from '@material-ui/core';
import { useTranslation } from 'react-i18next';

const ChangeLanguage = () => {
const { i18n } = useTranslation();
return (
<Button
onClick={() => i18n.changeLanguage(i18n.language === 'en' ? 'zh' : 'en')}
>
{i18n.language}
</Button>
);
};

export default ChangeLanguage;
5 changes: 3 additions & 2 deletions src/components/CoinInputCreatePool.tsx
Expand Up @@ -7,6 +7,7 @@ import { tokenNameFromMint } from '../utils/tokens';
import getCoinIcon from '../utils/icons';
import { useBalanceForMint } from '../utils/tokens';
import { notify } from '../utils/notifications';
import { useTranslation } from 'react-i18next';

const useStyles = makeStyles({
root: {
Expand Down Expand Up @@ -104,7 +105,7 @@ const CoinInput = ({
}) => {
const classes = useStyles();
const balance = useBalanceForMint(tokenAccounts, mint);

const { t } = useTranslation();
const onChangeInput = (e) => {
const parsed = parseFloat(e.target.value);
if (parsed > balance) {
Expand Down Expand Up @@ -153,7 +154,7 @@ const CoinInput = ({
</Grid>
<Grid item>
<Typography variant="body1" className={classes.inputLabel}>
Balance: {balance?.toLocaleString() || 0}
{t('Balance')}: {balance?.toLocaleString() || 0}
</Typography>
<RenderCoinRow name={tokenNameFromMint(mint) || ''} />
</Grid>
Expand Down
5 changes: 3 additions & 2 deletions src/components/CoinInputCreateRedeem.tsx
Expand Up @@ -9,6 +9,7 @@ import { USE_TOKENS } from '../utils/tokens';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import getCoinIcon from '../utils/icons';
import { nanoid } from 'nanoid';
import { useTranslation } from 'react-i18next';

const useStyles = makeStyles({
root: {
Expand Down Expand Up @@ -110,7 +111,7 @@ const DepositInput = ({
disabled?: boolean;
}) => {
const classes = useStyles();

const { t } = useTranslation();
const onChangeInput = (e) => {
const parsed = parseFloat(e.target.value);
if (isNaN(parsed) || parsed < 0) {
Expand Down Expand Up @@ -158,7 +159,7 @@ const DepositInput = ({
className={classes.inputLabel}
onClick={() => setAmount(balance)}
>
Balance: {balance?.toLocaleString()}
{t('Balance')}: {balance?.toLocaleString()}
</Typography>
<Select
className={classes.select}
Expand Down

0 comments on commit 18a6aac

Please sign in to comment.