@eeacms/volto-cca-policy 0.1.38 → 0.1.39
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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [0.1.39](https://github.com/eea/volto-cca-policy/compare/0.1.38...0.1.39) - 22 August 2023
|
|
8
|
+
|
|
7
9
|
### [0.1.38](https://github.com/eea/volto-cca-policy/compare/0.1.37...0.1.38) - 21 August 2023
|
|
8
10
|
|
|
9
11
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { connect } from 'react-redux';
|
|
|
10
10
|
import { asyncConnect } from '@plone/volto/helpers';
|
|
11
11
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
12
12
|
import { Container } from 'semantic-ui-react';
|
|
13
|
-
import { Helmet
|
|
13
|
+
import { Helmet } from '@plone/volto/helpers';
|
|
14
14
|
import { Link } from 'react-router-dom';
|
|
15
15
|
import config from '@plone/volto/registry';
|
|
16
16
|
|
|
@@ -29,6 +29,27 @@ export function getSitemapPath(pathname = '', lang) {
|
|
|
29
29
|
return path;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export const toReactIntlLang = (language) => {
|
|
33
|
+
if (language.includes('_') || language.includes('-')) {
|
|
34
|
+
let langCode = language.split(/[-_]/);
|
|
35
|
+
langCode = `${langCode[0]}-${langCode[1].toUpperCase()}`;
|
|
36
|
+
return langCode;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return language;
|
|
40
|
+
};
|
|
41
|
+
// export const toLangUnderscoreRegion = toReactIntlLang; // old name for backwards-compat
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Converts a language code like pt_BR or pt-BR to the format `pt-br`.
|
|
45
|
+
* This format is used on the backend and in volto config settings.
|
|
46
|
+
* @param {string} language Language to be converted
|
|
47
|
+
* @returns {string} Language converted
|
|
48
|
+
*/
|
|
49
|
+
export const toBackendLang = (language) => {
|
|
50
|
+
return toReactIntlLang(language).toLowerCase();
|
|
51
|
+
};
|
|
52
|
+
|
|
32
53
|
/**
|
|
33
54
|
* Sitemap class.
|
|
34
55
|
* @class Sitemap
|