Commit 408ba7b
feat(gatsby-source-drupal): Add toggleable multilingual support by prefixing nodes with their langcode (#26720)
* Determine languages from JSON:API content, use languages to fetch translations if 'translations' param provided
* Sort configurable languages by weight to retrieve default
* Fix lint issues
* Allow for more than 50 configurable_language and language_content_settings entities
* Default to und language if no langcode is provided by node
* Add await to promises.
Assign concats to the original variables.
Fix deleteNode to use langcodes
Fix for default languages url building
* fix: extract href from link objects when fetching translation settings
* refactor: use getHref in gatsby-source-drupal when possible
* Update gatsby-node.js
* Update normalize.js
* Update normalize.js
* Update gatsby-node.js
* Update gatsby-node.js
Avoid silently failing to fetch enabled language from Drupal
* Update gatsby-node.js
* Fix lint issues
* Update utils.js
* Update utils.js
* Remove dependence on languageConfig from handleReferences
* Fix lint
* fix id creation
* If translation is not enabled, always use for langcode
* Catch and report error in multilingual not enabled in Drupal + ensure all langcode still
* The default language JSONAPI root doesn't include its language code
* Use url-join + check for non-default langauges
* Use urlJoin more
* update yarn.lock
* update tests"
* Remove dynamically fetching language config
Instead set the config in the plugin options e.g.:
```js
options: {
translation: true,
languageConfig: {
defaultLanguage: `en`,
enabledLanguages: [`en`, `fil`],
translatableEntities: [`node--article`],
}
}
```
* remove import
* Remove mistakenly committed file and ignore it
* Add docs & just use existance of languageConfig to determine if translations are enabled or not
* Fix check
Co-authored-by: Hannes Vermeire <[email protected]>
Co-authored-by: Błażej Owczarczyk <[email protected]>
Co-authored-by: nbaosullivan <[email protected]>
Co-authored-by: Kyle Mathews <[email protected]>1 parent 757c81d commit 408ba7b
File tree
9 files changed
+256
-116
lines changed- packages/gatsby-source-drupal
- src
- __tests__
9 files changed
+256
-116
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
295 | 318 | | |
296 | 319 | | |
297 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
0 commit comments