File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,23 @@ When you create pages programmatically with `createPage()` by default the page w
85
85
- ` referTranslations: string[] ` : Refers translations for given locales.
86
86
- ` adjustPath: boolean ` : Add locale prefix and replaces slugs.
87
87
88
+ ### GraphQL data layer integration
89
+
90
+ All translation messages are sourced to Gatsbys GraphQL data layer with ` translation ` and ` allTranslation ` . Here is an example GraphQL query:
91
+
92
+ ``` typescript
93
+ export const query = graphql `
94
+ query SomePage($locale: String) {
95
+ pageTitle: translation(locale: { eq: $locale }, key: { eq: "page.some.title" }) {
96
+ message
97
+ }
98
+ pageDescription: translation(locale: { eq: $locale }, key: { eq: "page.some.description" }) {
99
+ message
100
+ }
101
+ }
102
+ ` ;
103
+ ```
104
+
88
105
## Development
89
106
90
107
1 . ** Clone** the project
You can’t perform that action at this time.
0 commit comments