@sanity/document-internationalization 0.0.1-beta.2 → 0.0.1-beta.3

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.
Files changed (2) hide show
  1. package/README.md +22 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,21 +2,37 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@sanity/document-internationalization.svg?style=flat)](https://www.npmjs.com/package/@sanity/document-internationalization)
4
4
 
5
- ![Document Level Internationalization UI](img/document-level-translation.gif)
5
+ ![Document Level Internationalization UI](docs/img/document-level-translation.gif)
6
6
 
7
7
  ## What this plugin solves
8
8
 
9
9
  There are two popular methods of internationalization in Sanity Studio:
10
10
 
11
- - **Document-level translation** refers to a schema type having a unique document for every language, joined together by references and/or a predictable `_id`
12
- - **Field-level translation** refers to mapping over languages to create an object, within which there is a language-specific version of each field
11
+ - **Document-level translation**
12
+ - A unique document version for every language
13
+ - Joined together by references and/or a predictable `_id`
14
+ - Best for documents that have unique, language-specific fields and no common content across languages
15
+ - Best for translating content using Portable Text
16
+ - **Field-level translation**
17
+ - A single document with many languages of content
18
+ - Achieved by mapping over languages on each field, to create an object
19
+ - Best for documents that have a mix of language-specific and common fields
20
+ - Not recommended for Portable Text
13
21
 
14
- You'll need to decide on the approach for each schema individually, and you're likely going to have a mix of both.
22
+ This plugin adds features to the Studio to improve handling **document-level translations**.
15
23
 
16
- This plugin adds UI to the Studio to improve handling **document-level translations**.
24
+ - A View Pane to create language versions of each Document
25
+ - Document Actions to update base and translated documents to ensure references stay in tact
26
+ - Document Badges to highlight the language version of a document
17
27
 
18
28
  For **field-level translations** you should use the [@sanity/language-filter plugin](https://www.npmjs.com/package/@sanity/language-filter).
19
29
 
30
+ ### Many projects use both!
31
+
32
+ An example of document-level translation could be a `lesson` schema, the `title`, `slug` and `content` fields would be unique in every language.
33
+
34
+ A good use of field-level translation could be a `person` schema. It could have the same `name` and `image` in every language, but only the `biography` would need translating.
35
+
20
36
  ## Installation
21
37
 
22
38
  With the [Sanity CLI installed](https://www.sanity.io/docs/getting-started-with-sanity-cli), from the same directory as the Studio run:
@@ -45,7 +61,7 @@ The plugin is now installed, but you will need to complete the following steps t
45
61
  3. [GraphQL support](docs/graphql-intl-doc.md)
46
62
  4. [Advanced languages](docs/advanced-languages.md)
47
63
  5. [Usage with custom publish action](docs/usage-with-custom-publish.md)
48
- 6. [GROQ Cheatsheet](/docs/groq-cheatsheet.md)
64
+ 6. [GROQ query examples](/docs/groq-query-examples.md)
49
65
 
50
66
  ## Migrating from sanity-plugin-intl-input
51
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/document-internationalization",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.0.1-beta.3",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": ">=14"