@sanity/document-internationalization 0.1.7 → 0.3.2
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/README.md +5 -5
- package/lib/actions/index.js +12 -15
- package/lib/actions/index.js.map +1 -1
- package/lib/badges/index.js.map +1 -1
- package/lib/constants/index.js +2 -2
- package/lib/constants/index.js.map +1 -1
- package/lib/language-select/components/SingleFlag/SingleFlag.d.ts +0 -1
- package/lib/language-select/hooks/index.d.ts +0 -1
- package/lib/language-select/hooks/useListeningQuery.d.ts +12 -0
- package/lib/language-select/index.js +4128 -404
- package/lib/language-select/index.js.map +1 -1
- package/lib/structure/index.js +2 -2
- package/lib/structure/index.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/validators/index.js.map +1 -1
- package/package.json +13 -9
- package/lib/language-select/hooks/useManyEditStates.d.ts +0 -1
- package/lib/language-select/hooks/useManyObservables.d.ts +0 -2
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ There are two popular methods of internationalization in Sanity Studio:
|
|
|
21
21
|
|
|
22
22
|
This plugin adds features to the Studio to improve handling **document-level translations**.
|
|
23
23
|
|
|
24
|
-
- A
|
|
24
|
+
- A Language Selector to create and browse language-specific versions of each Document
|
|
25
25
|
- Document Actions to update base and translated documents to ensure references stay in tact
|
|
26
26
|
- Document Badges to highlight the language version of a document
|
|
27
27
|
|
|
@@ -47,12 +47,12 @@ The plugin is now installed, but you will need to complete the following steps t
|
|
|
47
47
|
|
|
48
48
|
## Setup next steps
|
|
49
49
|
|
|
50
|
-
1. [
|
|
51
|
-
To setup the 'Translations' View Pane on Documents
|
|
52
|
-
2. [Configuration options](docs/configuration-options.md)
|
|
50
|
+
1. [Configuration options](docs/configuration-options.md)
|
|
53
51
|
To declare available Languages and other settings
|
|
54
|
-
|
|
52
|
+
2. [Activating internationalization on schema](docs/activating-internationalization-on-schema.md)
|
|
55
53
|
To enable all the above features on schema
|
|
54
|
+
3. [Customise Desk Structure](docs/desk-structure.md)
|
|
55
|
+
To filter documents down to the base language version
|
|
56
56
|
|
|
57
57
|
## Other documentation
|
|
58
58
|
|
package/lib/actions/index.js
CHANGED
|
@@ -1518,7 +1518,7 @@ var UiMessages = {
|
|
|
1518
1518
|
publishing: 'Publishing...',
|
|
1519
1519
|
publish: 'Publish',
|
|
1520
1520
|
updatingIntlFields: 'Updating i18n fields',
|
|
1521
|
-
intlFieldsUpdated: '
|
|
1521
|
+
intlFieldsUpdated: 'i18n fields updated',
|
|
1522
1522
|
baseDocumentCopied: 'Base document copied',
|
|
1523
1523
|
translationCreatedToast: {
|
|
1524
1524
|
title: function title(name) {
|
|
@@ -1531,7 +1531,7 @@ var UiMessages = {
|
|
|
1531
1531
|
loading: 'Loading languages...',
|
|
1532
1532
|
draft: 'Draft',
|
|
1533
1533
|
missingTranslations: 'Following languages are missing some translations compared to the base language',
|
|
1534
|
-
base: 'Base
|
|
1534
|
+
base: 'Base',
|
|
1535
1535
|
missing: 'Missing',
|
|
1536
1536
|
deleteAll: {
|
|
1537
1537
|
buttonTitle: 'Delete (incl. translations)',
|
|
@@ -2006,15 +2006,10 @@ function useDelayedFlag() {
|
|
|
2006
2006
|
var delayedOn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2007
2007
|
var delayedOff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
2008
2008
|
|
|
2009
|
-
var _useState = React.useState(
|
|
2010
|
-
_useState2 = _slicedToArray__default["default"](_useState, 2)
|
|
2011
|
-
_useState2[0]
|
|
2012
|
-
_useState2[1];
|
|
2013
|
-
|
|
2014
|
-
var _useState3 = React.useState(value),
|
|
2015
|
-
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
2016
|
-
flag = _useState4[0],
|
|
2017
|
-
setFlag = _useState4[1];
|
|
2009
|
+
var _useState = React.useState(value),
|
|
2010
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
2011
|
+
flag = _useState2[0],
|
|
2012
|
+
setFlag = _useState2[1];
|
|
2018
2013
|
|
|
2019
2014
|
React.useEffect(function () {
|
|
2020
2015
|
if (flag !== value) {
|
|
@@ -2026,9 +2021,9 @@ function useDelayedFlag() {
|
|
|
2026
2021
|
return function () {
|
|
2027
2022
|
return clearTimeout(timeoutId);
|
|
2028
2023
|
};
|
|
2029
|
-
} else {
|
|
2030
|
-
setFlag(true);
|
|
2031
2024
|
}
|
|
2025
|
+
|
|
2026
|
+
setFlag(true);
|
|
2032
2027
|
} else if (!value) {
|
|
2033
2028
|
if (delayedOff) {
|
|
2034
2029
|
var _timeoutId = setTimeout(function () {
|
|
@@ -2038,11 +2033,13 @@ function useDelayedFlag() {
|
|
|
2038
2033
|
return function () {
|
|
2039
2034
|
return clearTimeout(_timeoutId);
|
|
2040
2035
|
};
|
|
2041
|
-
} else {
|
|
2042
|
-
setFlag(false);
|
|
2043
2036
|
}
|
|
2037
|
+
|
|
2038
|
+
setFlag(false);
|
|
2044
2039
|
}
|
|
2045
2040
|
}
|
|
2041
|
+
|
|
2042
|
+
return undefined;
|
|
2046
2043
|
}, [value, timeout, delayedOn, delayedOff]);
|
|
2047
2044
|
return flag;
|
|
2048
2045
|
}
|