@galoymoney/client
Advanced tools
Comparing version 0.1.45 to 0.1.46
@@ -123,22 +123,4 @@ declare const ES: { | ||
readonly "Your email address has been verified": undefined; | ||
readonly 'By selecting "Next" you agree to our Terms and Conditions and Privacy Policy': "Al seleccionar \"Siguiente\" estas de acuerdo con nuestros Terminos y Condiciones y Política de Privacidad"; | ||
readonly "Account Name": "Nombre de Cuenta"; | ||
readonly "Account No.": "No. de Cuenta"; | ||
readonly "Account type": "Tipo de Cuenta"; | ||
readonly Bank: "Banco"; | ||
readonly Copied: "Copiado"; | ||
readonly Copy: "Copiar"; | ||
readonly "Excellent!": "¡Excelente!"; | ||
readonly "Guatt's Bank Details": "Datos Bancarios de Guatt"; | ||
readonly "I understand": "Entendido"; | ||
readonly "IMPORTANT: include your unique identification code in the description/memo of the transfer": "IMPORTANTE: incluye tu código único de identificación en la descripción/memo de la transferencia."; | ||
readonly "Open your online banking and add our bank account details so you can buy your BTC": "Abre tu banca en línea y agrega los datos de nuestra cuenta bancaria para que puedas comprar tus BTC."; | ||
readonly Regular: "Corriente"; | ||
readonly "This should only take a few seconds and is encrypted to protect your data.": "Esto solo debe de tomar unos segundos y está encriptado para proteger to data"; | ||
readonly "Unique Identification Code": "Código único de identificación"; | ||
readonly "We need to verify your identity": "Necesitamos verificar tu identidad"; | ||
readonly "When we receive your transfer in our account, you will see your Bitcoin reflected in your wallet": "En el momento que mandes la transferencia y la recibamos en nuestra cuenta de guatt verás reflejado tu Bitcoin en tu billetera."; | ||
readonly "Depending on what day and time we receive your transfer, the deposit can be instantaneous or take up to 24 hours (usually less than that)": "Dependiendo de variables como hora a que hora envías la transferencia, si la envias en dias laborales o fin de semana, o el banco que utilices, el deposito puede ser instantanéo o demorar hasta 24 horas (usualmente será menos que eso)."; | ||
}; | ||
export declare type TranslationKey = keyof typeof ES; | ||
export default ES; |
@@ -126,22 +126,3 @@ "use strict"; | ||
"Your email address has been verified": undefined, | ||
// GTEMP | ||
'By selecting "Next" you agree to our Terms and Conditions and Privacy Policy': 'Al seleccionar "Siguiente" estas de acuerdo con nuestros Terminos y Condiciones y Política de Privacidad', | ||
"Account Name": "Nombre de Cuenta", | ||
"Account No.": "No. de Cuenta", | ||
"Account type": "Tipo de Cuenta", | ||
"Bank": "Banco", | ||
"Copied": "Copiado", | ||
"Copy": "Copiar", | ||
"Excellent!": "¡Excelente!", | ||
"Guatt's Bank Details": "Datos Bancarios de Guatt", | ||
"I understand": "Entendido", | ||
"IMPORTANT: include your unique identification code in the description/memo of the transfer": "IMPORTANTE: incluye tu código único de identificación en la descripción/memo de la transferencia.", | ||
"Open your online banking and add our bank account details so you can buy your BTC": "Abre tu banca en línea y agrega los datos de nuestra cuenta bancaria para que puedas comprar tus BTC.", | ||
"Regular": "Corriente", | ||
"This should only take a few seconds and is encrypted to protect your data.": "Esto solo debe de tomar unos segundos y está encriptado para proteger to data", | ||
"Unique Identification Code": "Código único de identificación", | ||
"We need to verify your identity": "Necesitamos verificar tu identidad", | ||
"When we receive your transfer in our account, you will see your Bitcoin reflected in your wallet": "En el momento que mandes la transferencia y la recibamos en nuestra cuenta de guatt verás reflejado tu Bitcoin en tu billetera.", | ||
"Depending on what day and time we receive your transfer, the deposit can be instantaneous or take up to 24 hours (usually less than that)": "Dependiendo de variables como hora a que hora envías la transferencia, si la envias en dias laborales o fin de semana, o el banco que utilices, el deposito puede ser instantanéo o demorar hasta 24 horas (usualmente será menos que eso).", | ||
}; | ||
exports.default = ES; |
@@ -1,10 +0,6 @@ | ||
import i18n from "i18n-js"; | ||
import esMain from "./es-main"; | ||
export declare type GaloyTranslate = (scope: keyof typeof esMain, options?: i18n.TranslateOptions | undefined) => string; | ||
export declare const translate: GaloyTranslate; | ||
export declare type GaloyTranslateUnknown = (scope: string, options?: i18n.TranslateOptions | undefined) => any; | ||
export declare const translateUnknown: GaloyTranslateUnknown; | ||
export declare const setLocale: (language: string | undefined) => void; | ||
export declare const getLocale: () => string; | ||
export { toNumber as toLocaleNumber } from "i18n-js"; | ||
export * from "./es-main"; | ||
export { default as LANG_ES_MAIN } from "./es-main"; | ||
export { default as LANG_EN_US } from "./en"; | ||
export { default as LANG_ES_SV } from "./es"; | ||
export { default as LANG_PT_BR } from "./pt-br"; | ||
export { default as LANG_FR_CA } from "./fr-ca"; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -31,33 +20,15 @@ if (k2 === undefined) k2 = k; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toLocaleNumber = exports.getLocale = exports.setLocale = exports.translateUnknown = exports.translate = void 0; | ||
var i18n_js_1 = __importDefault(require("i18n-js")); | ||
var es_main_1 = __importDefault(require("./es-main")); | ||
var en_1 = __importDefault(require("./en")); | ||
var es_1 = __importDefault(require("./es")); | ||
var pt_br_1 = __importDefault(require("./pt-br")); | ||
var fr_ca_1 = __importDefault(require("./fr-ca")); | ||
i18n_js_1.default.fallbacks = true; | ||
i18n_js_1.default.translations = { es: __assign(__assign({}, es_1.default), es_main_1.default), pt: pt_br_1.default, fr: fr_ca_1.default, en: en_1.default }; | ||
var translate = function (scope, options) { | ||
var translation = i18n_js_1.default.t(scope, __assign({ defaultValue: scope }, options)); | ||
return translation; | ||
}; | ||
exports.translate = translate; | ||
var translateUnknown = function (scope, options) { | ||
var translation = i18n_js_1.default.t(scope, __assign({ defaultValue: scope }, options)); | ||
return translation; | ||
}; | ||
exports.translateUnknown = translateUnknown; | ||
var setLocale = function (language) { | ||
if (language && language !== "DEFAULT" && i18n_js_1.default.locale !== language) { | ||
i18n_js_1.default.locale = language; | ||
} | ||
}; | ||
exports.setLocale = setLocale; | ||
var getLocale = function () { | ||
return i18n_js_1.default.locale; | ||
}; | ||
exports.getLocale = getLocale; | ||
var i18n_js_2 = require("i18n-js"); | ||
Object.defineProperty(exports, "toLocaleNumber", { enumerable: true, get: function () { return i18n_js_2.toNumber; } }); | ||
exports.LANG_FR_CA = exports.LANG_PT_BR = exports.LANG_ES_SV = exports.LANG_EN_US = exports.LANG_ES_MAIN = void 0; | ||
// Web Wallet Messages (Default keys for English) | ||
__exportStar(require("./es-main"), exports); | ||
var es_main_1 = require("./es-main"); | ||
Object.defineProperty(exports, "LANG_ES_MAIN", { enumerable: true, get: function () { return __importDefault(es_main_1).default; } }); | ||
// Mobile Wallet Messages (No default keys) | ||
var en_1 = require("./en"); | ||
Object.defineProperty(exports, "LANG_EN_US", { enumerable: true, get: function () { return __importDefault(en_1).default; } }); | ||
var es_1 = require("./es"); | ||
Object.defineProperty(exports, "LANG_ES_SV", { enumerable: true, get: function () { return __importDefault(es_1).default; } }); | ||
var pt_br_1 = require("./pt-br"); | ||
Object.defineProperty(exports, "LANG_PT_BR", { enumerable: true, get: function () { return __importDefault(pt_br_1).default; } }); | ||
var fr_ca_1 = require("./fr-ca"); | ||
Object.defineProperty(exports, "LANG_FR_CA", { enumerable: true, get: function () { return __importDefault(fr_ca_1).default; } }); |
@@ -1,5 +0,7 @@ | ||
export declare const formatRelativeTime: (timestamp: number) => string | undefined; | ||
export declare const formatTime: (timestamp: number) => string; | ||
export declare const formatForLocale: (locale: string) => { | ||
formatRelativeTime: (timestamp: number) => string | undefined; | ||
formatTime: (timestamp: number) => string; | ||
}; | ||
export declare const isToday: (timestamp: number) => boolean; | ||
export declare const isYesterday: (timestamp: number) => boolean; | ||
export declare const isThisMonth: (timestamp: number) => boolean; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isThisMonth = exports.isYesterday = exports.isToday = exports.formatTime = exports.formatRelativeTime = void 0; | ||
var i18n_js_1 = __importDefault(require("i18n-js")); | ||
exports.isThisMonth = exports.isYesterday = exports.isToday = exports.formatForLocale = void 0; | ||
var DIVISIONS = [ | ||
@@ -18,28 +14,33 @@ { amount: 60, name: "seconds" }, | ||
var formatter = undefined; | ||
var formatRelativeTime = function (timestamp) { | ||
formatter = | ||
formatter !== null && formatter !== void 0 ? formatter : new Intl.RelativeTimeFormat(i18n_js_1.default.locale, { | ||
numeric: "auto", | ||
var formatForLocale = function (locale) { | ||
var formatRelativeTime = function (timestamp) { | ||
formatter = | ||
formatter !== null && formatter !== void 0 ? formatter : new Intl.RelativeTimeFormat(locale, { | ||
numeric: "auto", | ||
}); | ||
var duration = (1000 * timestamp - new Date().getTime()) / 1000; | ||
for (var _i = 0, DIVISIONS_1 = DIVISIONS; _i < DIVISIONS_1.length; _i++) { | ||
var division = DIVISIONS_1[_i]; | ||
if (Math.abs(duration) < division.amount) { | ||
return formatter.format(Math.round(duration), division.name); | ||
} | ||
duration /= division.amount; | ||
} | ||
}; | ||
var formatTime = function (timestamp) { | ||
return new Date(1000 * timestamp).toLocaleString(locale, { | ||
weekday: "short", | ||
year: "numeric", | ||
month: "short", | ||
day: "numeric", | ||
hour: "numeric", | ||
minute: "numeric", | ||
}); | ||
var duration = (1000 * timestamp - new Date().getTime()) / 1000; | ||
for (var _i = 0, DIVISIONS_1 = DIVISIONS; _i < DIVISIONS_1.length; _i++) { | ||
var division = DIVISIONS_1[_i]; | ||
if (Math.abs(duration) < division.amount) { | ||
return formatter.format(Math.round(duration), division.name); | ||
} | ||
duration /= division.amount; | ||
} | ||
}; | ||
return { | ||
formatRelativeTime: formatRelativeTime, | ||
formatTime: formatTime, | ||
}; | ||
}; | ||
exports.formatRelativeTime = formatRelativeTime; | ||
var formatTime = function (timestamp) { | ||
return new Date(1000 * timestamp).toLocaleString(i18n_js_1.default.locale, { | ||
weekday: "short", | ||
year: "numeric", | ||
month: "short", | ||
day: "numeric", | ||
hour: "numeric", | ||
minute: "numeric", | ||
}); | ||
}; | ||
exports.formatTime = formatTime; | ||
exports.formatForLocale = formatForLocale; | ||
var samePastDay = function (d1, d2) { | ||
@@ -46,0 +47,0 @@ var parsedD1 = new Date(1000 * d1); |
{ | ||
"name": "@galoymoney/client", | ||
"main": "dist/index.js", | ||
"version": "0.1.45", | ||
"version": "0.1.46", | ||
"license": "MIT", | ||
@@ -25,3 +25,2 @@ "repository": "https://github.com/galoymoney/galoy-client", | ||
"graphql": ">=16.0.0", | ||
"i18n-js": ">=3.9.2", | ||
"lnurl-pay": "^1.0.1", | ||
@@ -39,3 +38,2 @@ "react": ">=17.0.0", | ||
"@graphql-codegen/typescript-operations": "^2.5.1", | ||
"@types/i18n-js": "^3.8.2", | ||
"@types/jest": "^28.1.4", | ||
@@ -53,3 +51,2 @@ "@types/react": "^18.0.15", | ||
"graphql": "^16.5.0", | ||
"i18n-js": "^3.9.2", | ||
"jest": "^28.1.2", | ||
@@ -56,0 +53,0 @@ "lnurl-pay": "^1.0.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10
26
544249
9639