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