@capillarytech/creatives-library 7.17.18 → 7.17.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -53,11 +53,11 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
53
53
|
componentDidMount() {
|
|
54
54
|
const user = localStorage.getItem('user');
|
|
55
55
|
let locale = 'en';
|
|
56
|
-
moment.locale(locale);
|
|
57
56
|
if (user) {
|
|
58
57
|
locale = JSON.parse(user).lang || locale;
|
|
59
58
|
}
|
|
60
59
|
locale = this.getTranslationMappedLocale(locale);
|
|
60
|
+
moment.locale(locale);
|
|
61
61
|
this.setState({
|
|
62
62
|
translationLang: locale,
|
|
63
63
|
});
|
|
@@ -36,6 +36,7 @@ import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
|
36
36
|
import { gtmPush } from '../../utils/gtmTrackers';
|
|
37
37
|
const {CapCustomCardList} = CapCustomCard;
|
|
38
38
|
import {transformEmailTemplates, storeS3FileSizeDetails, CREATIVES_S3_ASSET_FILESIZES} from '../../utils/cdnTransformation';
|
|
39
|
+
import { GET_TRANSLATION_MAPPED } from '../../containers/TagList/constants';
|
|
39
40
|
|
|
40
41
|
export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
41
42
|
constructor(props) {
|
|
@@ -80,6 +81,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
80
81
|
addLanguageType: '',
|
|
81
82
|
startValidation: false,
|
|
82
83
|
saveForm: false,
|
|
84
|
+
translationLang: 'en',
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
this.isTagLoaded = false;
|
|
@@ -204,7 +206,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
204
206
|
// this.startTemplateCreation();
|
|
205
207
|
// }, 15000);
|
|
206
208
|
}
|
|
207
|
-
|
|
209
|
+
|
|
210
|
+
getTranslationMappedLocale(locale) {
|
|
211
|
+
return GET_TRANSLATION_MAPPED?.[locale];
|
|
212
|
+
}
|
|
208
213
|
componentDidMount() {
|
|
209
214
|
const query = {
|
|
210
215
|
layout: 'EMAIL',
|
|
@@ -216,6 +221,16 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
216
221
|
if (this.props.location.query.type === 'embedded') {
|
|
217
222
|
this.showNext();
|
|
218
223
|
}
|
|
224
|
+
const user = localStorage.getItem('user');
|
|
225
|
+
let locale = 'en';
|
|
226
|
+
if (user) {
|
|
227
|
+
locale = JSON.parse(user)?.lang || locale;
|
|
228
|
+
}
|
|
229
|
+
locale = this.getTranslationMappedLocale(locale);
|
|
230
|
+
moment.locale(locale);
|
|
231
|
+
this.setState({
|
|
232
|
+
translationLang: locale,
|
|
233
|
+
});
|
|
219
234
|
}
|
|
220
235
|
|
|
221
236
|
checkBeeEditorAllowedForLibrary = () => {
|
|
@@ -2714,6 +2729,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2714
2729
|
uuid={CmsSettings.uuid}
|
|
2715
2730
|
type={CmsSettings.type}
|
|
2716
2731
|
isEmailLoading={isLoading}
|
|
2732
|
+
userLocale={this.state.translationLang}
|
|
2717
2733
|
/> : ''}
|
|
2718
2734
|
</Col>
|
|
2719
2735
|
</Row>
|