chore: Update translations
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Kieran 2023-09-27 10:36:37 +00:00
parent a780b9554d
commit 1d3db500a6
6 changed files with 28 additions and 24 deletions

View File

@ -1 +1 @@
Choose config with NODE_CONFIG_ENV: `NODE_CONFIG_ENV=iris yarn start`
Choose config with NODE_CONFIG_ENV: `NODE_CONFIG_ENV=iris yarn start`

View File

@ -29,7 +29,13 @@ export default function AsyncButton(props: AsyncButtonProps) {
}
return (
<button ref={props.ref} className="spinner-button" type="button" disabled={loading || props.disabled} {...props} onClick={handle}>
<button
ref={props.ref}
className="spinner-button"
type="button"
disabled={loading || props.disabled}
{...props}
onClick={handle}>
<span style={{ visibility: loading ? "hidden" : "visible" }}>{props.children}</span>
{loading && (
<span className="spinner-wrapper">

View File

@ -1,18 +1,18 @@
import { useState, useEffect, FC, ComponentProps } from 'react';
import { useIntl, FormattedMessage } from 'react-intl';
import { useState, useEffect, FC, ComponentProps } from "react";
import { useIntl, FormattedMessage } from "react-intl";
type ExtendedProps = ComponentProps<typeof FormattedMessage>;
const ExtendedFormattedMessage: FC<ExtendedProps> = (props) => {
const { id, defaultMessage, values} = props;
const ExtendedFormattedMessage: FC<ExtendedProps> = props => {
const { id, defaultMessage, values } = props;
const { formatMessage } = useIntl();
const [processedMessage, setProcessedMessage] = useState<string | null>(null);
useEffect(() => {
const translatedMessage = formatMessage({ id, defaultMessage }, values);
if (typeof translatedMessage === 'string') {
setProcessedMessage(translatedMessage.replace('Snort', process.env.APP_NAME_CAPITALIZED || 'Snort'));
if (typeof translatedMessage === "string") {
setProcessedMessage(translatedMessage.replace("Snort", process.env.APP_NAME_CAPITALIZED || "Snort"));
}
}, [id, defaultMessage, values, formatMessage]);

View File

@ -1,6 +1,6 @@
import useLogin from "Hooks/useLogin";
import "./PinPrompt.css";
import {ReactNode, useRef, useState} from "react";
import { ReactNode, useRef, useState } from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { unwrap } from "@snort/shared";
import { EventPublisher, InvalidPinError, PinEncrypted, PinEncryptedPayload } from "@snort/system";
@ -57,13 +57,12 @@ export function PinPrompt({
return (
<Modal id="pin" onClose={() => onCancel()}>
<form
onSubmit={(e) => {
onSubmit={e => {
e.preventDefault();
if (submitButtonRef.current) {
submitButtonRef.current.click();
}
}}
>
}}>
<div className="flex-column g12">
<h2>
<FormattedMessage defaultMessage="Enter Pin" />
@ -71,7 +70,7 @@ export function PinPrompt({
{subTitle}
<input
type="number"
onChange={(e) => setPin(e.target.value)}
onChange={e => setPin(e.target.value)}
value={pin}
autoFocus={true}
maxLength={20}

View File

@ -220,13 +220,13 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
async #loadIrisKeyIfExists() {
try {
const irisKeyJSON = window.localStorage.getItem('iris.myKey');
const irisKeyJSON = window.localStorage.getItem("iris.myKey");
if (irisKeyJSON) {
const irisKeyObj = JSON.parse(irisKeyJSON);
if (irisKeyObj.priv) {
const privateKey = await PinEncrypted.create(irisKeyObj.priv, '1234');
const privateKey = await PinEncrypted.create(irisKeyObj.priv, "1234");
this.loginWithPrivateKey(privateKey);
window.localStorage.removeItem('iris.myKey');
window.localStorage.removeItem("iris.myKey");
}
}
} catch (e) {
@ -234,7 +234,6 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
}
}
#migrate() {
let didMigrate = false;

View File

@ -9,8 +9,8 @@ const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
const WorkboxPlugin = require("workbox-webpack-plugin");
const IntlTsTransformer = require("@formatjs/ts-transformer");
const { DefinePlugin } = require('webpack');
const appConfig = require('config');
const { DefinePlugin } = require("webpack");
const appConfig = require("config");
const isProduction = process.env.NODE_ENV == "production";
@ -49,10 +49,10 @@ const config = {
}),
new HtmlWebpackPlugin({
template: "public/index.html",
favicon: appConfig.get('favicon'),
favicon: appConfig.get("favicon"),
excludeChunks: ["pow", "bench"],
templateParameters: {
appTitle: appConfig.get('appTitle'),
appTitle: appConfig.get("appTitle"),
},
}),
new HtmlWebpackPlugin({
@ -75,9 +75,9 @@ const config = {
})
: false,
new DefinePlugin({
"process.env.APP_NAME": JSON.stringify(appConfig.get('appName')),
"process.env.APP_NAME_CAPITALIZED": JSON.stringify(appConfig.get('appNameCapitalized')),
"process.env.NIP05_DOMAIN": JSON.stringify(appConfig.get('nip05Domain')),
"process.env.APP_NAME": JSON.stringify(appConfig.get("appName")),
"process.env.APP_NAME_CAPITALIZED": JSON.stringify(appConfig.get("appNameCapitalized")),
"process.env.NIP05_DOMAIN": JSON.stringify(appConfig.get("nip05Domain")),
}),
],
module: {