Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add translations #947

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/web/components/complex/add-liquidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const AddLiquidity: FunctionComponent<
options={[
{
id: "all",
display: "All assets",
display: t("addLiquidity.allAssets"),
},
{ id: "single", display: "Single asset" },
{ id: "single", display: t("addLiquidity.singleAsset") },
]}
onSelect={(id) => {
if (id === "single") {
Expand Down
4 changes: 3 additions & 1 deletion packages/web/components/control/token-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { TokenSelectModal } from "../../modals";
import { useBooleanWithWindowEvent, useFilteredData } from "../../hooks";
import { MobileProps } from "../types";
import classNames from "classnames";
import { useTranslation } from "react-multi-lang";

/** Will display balances if provided `CoinPretty` objects. Assumes denoms are unique. */
export const TokenSelect: FunctionComponent<
Expand All @@ -30,6 +31,7 @@ export const TokenSelect: FunctionComponent<
setDropdownState,
}) => {
const { chainStore, priceStore } = useStore();
const t = useTranslation();

// parent overrideable state
const [isSelectOpenLocal, setIsSelectOpenLocal] =
Expand Down Expand Up @@ -210,7 +212,7 @@ export const TokenSelect: FunctionComponent<
ref={inputRef}
type="text"
className="px-4 subtitle2 text-white-full bg-transparent font-normal"
placeholder="Search tokens"
placeholder={t("components.searchTokens")}
onClick={(e) => e.stopPropagation()}
value={searchValue}
onInput={(e: any) => setTokenSearch(e.target.value)}
Expand Down
24 changes: 12 additions & 12 deletions packages/web/components/table/assets-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const AssetsTable: FunctionComponent<Props> = observer(
{
/** These ids correspond to keys in `Cell` type and are later used for sorting. */
id: "chainName",
display: t("assets.table.sort.netword"),
display: t("assets.table.sort.network"),
},
{
id: "fiatValueRaw",
Expand All @@ -334,7 +334,7 @@ export const AssetsTable: FunctionComponent<Props> = observer(
) : (
<div className="flex flex-col gap-5">
<div className="flex flex-wrap items-center place-content-between">
<h5 className="shrink-0 mr-5">All Assets</h5>
<h5 className="shrink-0 mr-5">{t("assets.table.title")}</h5>
<div className="flex items-center gap-5 lg:gap-2">
<Switch
isOn={hideZeroBalances}
Expand All @@ -343,15 +343,15 @@ export const AssetsTable: FunctionComponent<Props> = observer(
setHideZeroBalances(!hideZeroBalances);
}}
>
Hide zero balances
{t("assets.table.hideZero")}
</Switch>
<SearchBox
currentValue={query}
onInput={(query) => {
setHideZeroBalances(false);
setQuery(query);
}}
placeholder="Search assets"
placeholder={t("assets.table.search")}
/>
<SortMenu
selectedOptionId={sortKey}
Expand All @@ -373,16 +373,16 @@ export const AssetsTable: FunctionComponent<Props> = observer(
options={[
{
id: "coinDenom",
display: "Symbol",
display: t("assets.table.sort.symbol"),
},
{
/** These ids correspond to keys in `Cell` type and are later used for sorting. */
id: "chainName",
display: "Network",
display: t("assets.table.sort.network"),
},
{
id: "fiatValueRaw",
display: "Balance",
display: t("assets.table.sort.balance"),
},
]}
/>
Expand Down Expand Up @@ -458,20 +458,20 @@ export const AssetsTable: FunctionComponent<Props> = observer(
className="w-full my-5"
columnDefs={[
{
display: "Asset / Chain",
display: t("assets.table.columns.assetChain"),
displayCell: AssetNameCell,
sort: sortColumnWithKeys(["coinDenom", "chainName"]),
},
{
display: "Balance",
display: t("assets.table.columns.balance"),
displayCell: BalanceCell,
sort: sortColumnWithKeys(["fiatValueRaw"], "descending"),
className: "text-right pr-24 lg:pr-8 1.5md:pr-1",
},
...(mergeWithdrawCol
? ([
{
display: "Transfer",
display: t("assets.table.columns.transfer"),
displayCell: (cell) => (
<div>
<TransferButtonCell type="deposit" {...cell} />
Expand All @@ -483,14 +483,14 @@ export const AssetsTable: FunctionComponent<Props> = observer(
] as ColumnDef<TableCell>[])
: ([
{
display: t("assets.table.columns.transfer"),
display: t("assets.table.columns.deposit"),
displayCell: (cell) => (
<TransferButtonCell type="deposit" {...cell} />
),
className: "text-center max-w-[5rem]",
},
{
display: "Withdraw",
display: t("assets.table.columns.withdraw"),
displayCell: (cell) => (
<TransferButtonCell type="withdraw" {...cell} />
),
Expand Down
4 changes: 3 additions & 1 deletion packages/web/components/table/cells/transfer-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const TransferButtonCell: FunctionComponent<
(onBuyOsmo && account.walletStatus !== WalletStatus.Loaded)
}
externalUrl={depositUrlOverride}
label={onBuyOsmo ? "Buy" : t("assets.table.depositButton")}
label={
onBuyOsmo ? t("assets.table.buyOsmo") : t("assets.table.depositButton")
}
action={
onBuyOsmo
? onBuyOsmo
Expand Down
8 changes: 7 additions & 1 deletion packages/web/localizations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@
"bondShares": "Bond Shares",
"amountDaysUnbonding": "{numDays} days unbonding",
"shares": "shares",
"unbonded": "Unbonded",
"unbond": "Unbond",
"bonded": "Bonded",
"showDetails": "Show details",
"collapseDetails": "Collapse details",
"sharesAvailableIn": "available in",
"unbonding": "unbonding",
"superfluidEarnMore": "Earn {rate} more. Go superfluid",
Expand Down Expand Up @@ -210,6 +214,7 @@
"search": "Filter by symbol",
"title": "Assets",
"hideZero": "Hide zero balances",
"buyOsmo": "Buy",
"preTransfer": {
"deposit": "Deposit",
"withdraw": "Withdraw",
Expand Down Expand Up @@ -257,7 +262,8 @@
"SORTMobile": "SORT",
"mobileMenu": "Sort By"
},
"MAX": "MAX"
"MAX": "MAX",
"searchTokens": "Search tokens"
},
"menu": {
"swap": "Swap",
Expand Down
Loading