-
Notifications
You must be signed in to change notification settings - Fork 3
🌐 server: add spanish translations push notifications #878
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
Open
aguxez
wants to merge
5
commits into
main
Choose a base branch
from
translations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3b3870e
➕ server: add i18next
aguxez 39057b1
🌐 server: translate push notifications to spanish
aguxez e1c676d
✅ server: add tests for notifications translations
aguxez 24d6f0d
🩹 server: simple fallback for missing asset symbol
aguxez 1e8af77
✅ server: verify locale-aware push notification content
aguxez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@exactly/server": patch | ||
| --- | ||
|
|
||
| 🌐 translate push notifications to spanish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "fundsReceived": "Funds received", | ||
| "fundsReceived_symbol": "{{symbol}} received", | ||
| "fundsReceived_symbol_value": "{{value}} {{symbol}} received", | ||
| "fundsReceived_symbol_value_yield": "{{value}} {{symbol}} received and instantly started earning yield", | ||
| "fundsReceived_symbol_yield": "{{symbol}} received and instantly started earning yield", | ||
| "fundsReceived_value": "{{value}} received", | ||
| "fundsReceived_value_yield": "{{value}} received and instantly started earning yield", | ||
| "fundsReceived_yield": "Funds received and instantly started earning yield", | ||
| "{{localAmount}} at {{merchantName}}. Paid in {{count}} installments_one": "{{localAmount}} at {{merchantName}}. Paid in {{count}} installment", | ||
| "{{localAmount}} at {{merchantName}}. Paid in {{count}} installments_other": "{{localAmount}} at {{merchantName}}. Paid in {{count}} installments" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "Card mode changed": "Modo de tarjeta cambiado", | ||
| "Card mode": "Modo de tarjeta", | ||
| "Card purchase": "Compra con tarjeta", | ||
| "Credit mode activated": "Modo crédito activado", | ||
| "Credit mode is active": "El modo crédito está activo", | ||
| "Deposited funds": "Fondos depositados", | ||
| "Fiat onramp activated": "Rampa fiat activada", | ||
| "Funds received": "Fondos recibidos", | ||
| "Refund processed": "Reembolso procesado", | ||
| "Withdraw completed": "Retiro completado", | ||
| "Your fiat onramp account has been activated": "Tu cuenta de rampa fiat ha sido activada", | ||
| "fundsReceived": "Fondos recibidos", | ||
| "fundsReceived_symbol": "{{symbol}} recibidos", | ||
| "fundsReceived_symbol_value": "{{value}} {{symbol}} recibidos", | ||
| "fundsReceived_symbol_value_yield": "{{value}} {{symbol}} recibidos y empezaron a generar rendimiento", | ||
| "fundsReceived_symbol_yield": "{{symbol}} recibidos y empezaron a generar rendimiento", | ||
| "fundsReceived_value": "{{value}} recibidos", | ||
| "fundsReceived_value_yield": "{{value}} recibidos y empezaron a generar rendimiento", | ||
| "fundsReceived_yield": "Fondos recibidos y empezaron a generar rendimiento", | ||
| "{{amount}} {{asset}} deposited": "{{amount}} {{asset}} depositados", | ||
| "{{amount}} {{symbol}} sent to {{recipient}}": "{{amount}} {{symbol}} enviados a {{recipient}}", | ||
| "{{localAmount}} at {{merchantName}}. Paid in {{count}} installments_one": "{{localAmount}} en {{merchantName}}. Pagado en {{count}} cuota", | ||
| "{{localAmount}} at {{merchantName}}. Paid in {{count}} installments_other": "{{localAmount}} en {{merchantName}}. Pagado en {{count}} cuotas", | ||
| "{{localAmount}} at {{merchantName}}. Paid with USDC": "{{localAmount}} en {{merchantName}}. Pagado con USDC", | ||
| "{{localAmount}} at {{merchantName}}. Paid with credit": "{{localAmount}} en {{merchantName}}. Pagado con crédito", | ||
| "{{refundAmount}} USDC from {{merchantName}} have been refunded to your account": "{{refundAmount}} USDC de {{merchantName}} fueron reembolsados a tu cuenta" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { createInstance } from "i18next"; | ||
|
|
||
| import en from "./en.json"; | ||
| import es from "./es.json"; | ||
|
|
||
| const instance = createInstance(); | ||
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // eslint-disable-next-line @typescript-eslint/no-floating-promises -- initImmediate: false makes init synchronous | ||
| instance.init({ | ||
| initImmediate: false, | ||
| fallbackLng: "en", | ||
| keySeparator: false, | ||
| nsSeparator: false, | ||
| interpolation: { escapeValue: false }, | ||
| resources: { en: { translation: en }, es: { translation: es } }, | ||
| }); | ||
|
|
||
| export function formatAmount(value: number | string) { | ||
| const n = typeof value === "string" ? Number(value) : value; | ||
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const options = | ||
| typeof value === "string" | ||
| ? { minimumFractionDigits: 0, maximumFractionDigits: value.split(".")[1]?.length ?? 0 } | ||
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| : { maximumSignificantDigits: 6 }; | ||
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return { en: n.toLocaleString("en-US", options), es: n.toLocaleString("es-AR", options) }; | ||
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
aguxez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| export default function t(key: string, options?: Record<string, unknown>) { | ||
| return { | ||
| en: instance.t(key, { ...resolve(options, "en"), lng: "en" }), | ||
| es: instance.t(key, { ...resolve(options, "es"), lng: "es" }), | ||
| }; | ||
| } | ||
|
|
||
| function resolve(options: Record<string, unknown> | undefined, lng: string) { | ||
| if (!options) return {}; | ||
| return Object.fromEntries( | ||
| Object.entries(options).map(([k, v]) => [ | ||
| k, | ||
| v != null && typeof v === "object" && lng in v ? (v as Record<string, unknown>)[lng] : v, | ||
| ]), | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.