Use detected locale in localized strings
[PREMIUM-215]
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
import { Fragment } from '@wordpress/element';
|
import { Fragment } from '@wordpress/element';
|
||||||
|
import { locale } from '../../config';
|
||||||
|
|
||||||
type Item = {
|
type Item = {
|
||||||
key: string;
|
key: string;
|
||||||
@ -15,7 +16,7 @@ export function Statistics({
|
|||||||
items,
|
items,
|
||||||
labelPosition = 'before',
|
labelPosition = 'before',
|
||||||
}: Props): JSX.Element {
|
}: Props): JSX.Element {
|
||||||
const intl = new Intl.NumberFormat();
|
const intl = new Intl.NumberFormat(locale.toString());
|
||||||
return (
|
return (
|
||||||
<div className="mailpoet-automation-stats">
|
<div className="mailpoet-automation-stats">
|
||||||
{items.map((item, i) => (
|
{items.map((item, i) => (
|
||||||
|
@ -3,6 +3,7 @@ import { useSelect } from '@wordpress/data';
|
|||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { storeName } from '../../../store';
|
import { storeName } from '../../../store';
|
||||||
import { TrashButton } from '../../actions/trash-button';
|
import { TrashButton } from '../../actions/trash-button';
|
||||||
|
import { locale } from '../../../../config';
|
||||||
|
|
||||||
export function AutomationSidebar(): JSX.Element {
|
export function AutomationSidebar(): JSX.Element {
|
||||||
const { automationData } = useSelect(
|
const { automationData } = useSelect(
|
||||||
@ -23,7 +24,7 @@ export function AutomationSidebar(): JSX.Element {
|
|||||||
<PanelRow>
|
<PanelRow>
|
||||||
<strong>Date added</strong>{' '}
|
<strong>Date added</strong>{' '}
|
||||||
{new Date(Date.parse(automationData.created_at)).toLocaleDateString(
|
{new Date(Date.parse(automationData.created_at)).toLocaleDateString(
|
||||||
undefined,
|
locale.toString(),
|
||||||
dateOptions,
|
dateOptions,
|
||||||
)}
|
)}
|
||||||
</PanelRow>
|
</PanelRow>
|
||||||
@ -31,13 +32,13 @@ export function AutomationSidebar(): JSX.Element {
|
|||||||
<strong>Activated</strong>{' '}
|
<strong>Activated</strong>{' '}
|
||||||
{automationData.status === 'active' &&
|
{automationData.status === 'active' &&
|
||||||
new Date(Date.parse(automationData.updated_at)).toLocaleDateString(
|
new Date(Date.parse(automationData.updated_at)).toLocaleDateString(
|
||||||
undefined,
|
locale.toString(),
|
||||||
dateOptions,
|
dateOptions,
|
||||||
)}
|
)}
|
||||||
{automationData.status !== 'active' &&
|
{automationData.status !== 'active' &&
|
||||||
automationData.activated_at &&
|
automationData.activated_at &&
|
||||||
new Date(Date.parse(automationData.activated_at)).toLocaleDateString(
|
new Date(Date.parse(automationData.activated_at)).toLocaleDateString(
|
||||||
undefined,
|
locale.toString(),
|
||||||
dateOptions,
|
dateOptions,
|
||||||
)}
|
)}
|
||||||
{automationData.status !== 'active' && !automationData.activated_at && (
|
{automationData.status !== 'active' && !automationData.activated_at && (
|
||||||
|
Reference in New Issue
Block a user