Skip to content

Commit

Permalink
change: update i18n values (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-avb authored Sep 11, 2024
1 parent 78011c0 commit 09a8200
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 25 deletions.
50 changes: 49 additions & 1 deletion src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,54 @@
"texts": {
"dynamic_text": {
"dynamic_one": "business",
"dynamic_two": "organization",
"dynamic_two": "organization",
"dynamic_three": "community"
},
"login": {
"welcome": "Welcome to",
"description": "Explore local projects and Initiatives that are making an impact",
"opportunities": {
"connect": "Connect with others around you",
"learn": "Show your work, learn from others",
"impact": "Find new opportunities to make an impact."
},
"form": {
"title": "Login"
}
},
"account": {
"tabs": {
"wallet": {
"tab": "Wallet",
"balance": {
"title": "Balance",
"options": {
"deposit": "Deposit",
"withdraw": "Withdraw"
}
},
"assets": {
"title": "Assets",
"table": {
"asset": "Asset",
"quantity": "Quantity",
"cost": "Cost",
"total": "Total"
}
}
},
"transfers": {
"tab": "Transfers",
"title": "Transfers",
"table": {
"asset": "Asset",
"time": "Time",
"quantity": "Quantity",
"account": "Account"
}
}
}
},
"sidebar": {
"cta": "Add community"
},
Expand Down Expand Up @@ -409,6 +454,9 @@
"upload_fail": "Oops! ✋ The file could not be uploaded. Please try again.",
"community_creation": "Oops! ✋ We couldn't create your community. Please check and try again.",
"initiative_creation": "Oops! ✋ We couldn't create the initiative. Please try again."
},
"market": {
"query_failed": "The price could not be consulted"
}
}
}
Expand Down
52 changes: 50 additions & 2 deletions src/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,54 @@
"texts": {
"dynamic_text": {
"dynamic_one": "empresa",
"dynamic_two": "organización",
"dynamic_two": "organización",
"dynamic_three": "comunidad"
},
"login": {
"welcome": "Bienvenido a",
"description": "Explora proyectos locales e iniciativas que están generando impacto",
"opportunities": {
"connect": "Conéctate con otros a tu alrededor",
"learn": "Muestra tu trabajo, aprende de los demás",
"impact": "Encuentra nuevas oportunidades para generar impacto"
},
"form": {
"title": "Iniciar sesión"
}
},
"account": {
"tabs": {
"wallet": {
"tab": "Billetera",
"balance": {
"title": "Saldo",
"options": {
"deposit": "Depositar",
"withdraw": "Retirar"
}
},
"assets": {
"title": "Activos",
"table": {
"asset": "Activo",
"quantity": "Cantidad",
"cost": "Costo",
"total": "Total"
}
}
},
"transfers": {
"tab": "Transferencias",
"title": "Transferencias",
"table": {
"asset": "Activo",
"time": "Hora",
"quantity": "Cantidad",
"account": "Cuenta"
}
}
}
},
"sidebar": {
"cta": "Agregar comunidad"
},
Expand Down Expand Up @@ -174,7 +219,7 @@
"nay": "Balance en contra",
"abstain": "Balance en abstención"
}
}
}
},
"settings": {
"label": "Configuraciones"
Expand Down Expand Up @@ -405,6 +450,9 @@
"upload_fail": "¡Ups! ✋ No se pudo subir el archivo. Por favor, inténtalo de nuevo.",
"community_creation": "¡Ups! ✋ No logramos crear tu comunidad. Por favor, verifica e inténtalo de nuevo.",
"initiative_creation": "¡Ups! ✋ No logramos crear tu iniciativa. Por favor, inténtalo de nuevo."
},
"market": {
"query_failed": "No se pudo consultar el precio"
}
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/pages/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub fn Account() -> Element {
let KSM_PRICE = market_client
.get_price_by_token(Tokens::KSM)
.await
.map_err(|_| String::from("No se ha podido consultar el precio"))?;
.map_err(|_| translate!(i18, "errors.market.query_failed"))?;

ksm_usd.set(KSM_PRICE);

Expand Down Expand Up @@ -117,15 +117,15 @@ pub fn Account() -> Element {
div { class: "account",
div { class: "account__options",
Tab {
text: "Wallet",
text: translate!(i18, "account.tabs.wallet.tab"),
is_active: if *profile_value.read() == ProfileTabs::Wallet { true } else { false },
on_click: move |_| {
profile_value.set(ProfileTabs::Wallet);
}
}
Tab {
class: "tab--comming-soon",
text: "Transfers",
text: translate!(i18, "account.tabs.transfers.tab"),
is_active: true,
on_click: move |_| {}
}
Expand All @@ -137,12 +137,12 @@ pub fn Account() -> Element {
div { class: "account__container",
div { class: "account__balance",
h3 { class: "account__balance__title",
"Balance"
{translate!(i18, "account.tabs.wallet.balance.title")}
}
div { class: "account__balance__cta",
Button {
class: "button--comming-soon",
text: "Deposit",
text: translate!(i18, "account.tabs.wallet.balance.options.deposit"),
size: ElementSize::Small,
variant: ButtonVariant::Secondary,
on_click: move |_| {
Expand All @@ -159,7 +159,7 @@ pub fn Account() -> Element {
}
Button {
class: "",
text: "Withdraw",
text: translate!(i18, "account.tabs.wallet.balance.options.withdraw"),
size: ElementSize::Small,
variant: ButtonVariant::Secondary,
on_click: move |_| {
Expand Down Expand Up @@ -207,16 +207,16 @@ pub fn Account() -> Element {
}
div { class: "account__container",
h3 { class: "account__balance__title",
"Activos"
{translate!(i18, "account.tabs.wallet.assets.title")}
}
div { class: "account__actives",
div { class: "actives",
table { class: "actives__list",
tr {
th { class: "list__name", "Asset" }
th { "Quantity" }
th { "Cost" }
th { "Total" }
th { class: "list__name", {translate!(i18, "account.tabs.wallet.assets.title")} }
th { {translate!(i18, "account.tabs.wallet.assets.quantity")} }
th { {translate!(i18, "account.tabs.wallet.assets.cost")} }
th { {translate!(i18, "account.tabs.wallet.assets.total")} }
}

match *tab_value.read() {
Expand Down Expand Up @@ -259,14 +259,14 @@ pub fn Account() -> Element {
section { class: "transfers",
div { class: "account__container",
h3 { class: "account__balance__title",
"Transferencias"
{translate!(i18, "account.tabs.transfers.title")}
}
table { class: "actives__list",
tr {
th { class: "list__name", "Asset" }
th { "Time" }
th { "Quantity" }
th { "Account" }
th { class: "list__name", {translate!(i18, "account.tabs.transfers.table.asset")} }
th { {translate!(i18, "account.tabs.transfers.table.time")} }
th { {translate!(i18, "account.tabs.transfers.table.quantity")} }
th { {translate!(i18, "account.tabs.transfers.table.account")} }
}

tr {
Expand Down
12 changes: 6 additions & 6 deletions src/pages/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ pub fn Login() -> Element {
stroke_width: 1,
fill: "var(--color-lavanda-400)"
}
div { class: "login__welcome", "Welcome to" }
div { class: "login__welcome", {translate!(i18, "login.welcome")} }
div { class: "login__name", "VIRTO" }
}
div { class: "login__info",
p { class: "login__info__description",
"Explore local projects and Initiatives that are making an impact"
{translate!(i18, "login.description")}
}
ul { class: "login__info__opportunities",
li { class: "icon-text",
Expand All @@ -102,7 +102,7 @@ pub fn Login() -> Element {
width: 36,
fill: "var(--state-primary-active)"
}
span { class: "icon-text__title", "Connect with others around you" }
span { class: "icon-text__title", {translate!(i18, "login.opportunities.connect")} }
}
li { class: "icon-text",
Icon {
Expand All @@ -112,7 +112,7 @@ pub fn Login() -> Element {
fill: "var(--state-primary-active)"
}
span { class: "icon-text__title",
"Show your work, learn from others"
{translate!(i18, "login.opportunities.learn")}
}
}
li { class: "icon-text",
Expand All @@ -123,7 +123,7 @@ pub fn Login() -> Element {
fill: "var(--state-primary-active)"
}
span { class: "icon-text__title",
"Find new opportunities to make an impact."
{translate!(i18, "login.opportunities.impact")}
}
}
}
Expand All @@ -133,7 +133,7 @@ pub fn Login() -> Element {
div { class: "login__form",
div { class: "login__form__wrapper",
div { class: "login__form__head",
h3 { class: "login__form__title", "Login" }
h3 { class: "login__form__title", {translate!(i18, "login.form.title")} }
}
div { class: "login__form__cta",
if !connect_handled() {
Expand Down

0 comments on commit 09a8200

Please sign in to comment.