-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d85bd2
commit 8de442a
Showing
28 changed files
with
293 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import i18n from 'i18next'; | ||
import LanguageDetector from 'i18next-browser-languagedetector'; | ||
import { initReactI18next } from 'react-i18next'; | ||
|
||
import enTranslations from './locales/en/translation.json'; | ||
import enDocExplorer from './locales/en/DocExplorer.json'; | ||
import enToolbar from './locales/en/Toolbar.json'; | ||
import enEditor from './locales/en/Editor.json'; | ||
import enErrors from './locales/en/Errors.json'; | ||
import ruTranslations from './locales/ru/translation.json'; | ||
import ruDocExplorer from './locales/ru/DocExplorer.json'; | ||
import ruToolbar from './locales/ru/Toolbar.json'; | ||
import ruEditor from './locales/ru/Editor.json'; | ||
import ruErrors from './locales/ru/Errors.json'; | ||
|
||
const resources = { | ||
en: { | ||
translations: enTranslations, | ||
DocExplorer: enDocExplorer, | ||
Toolbar: enToolbar, | ||
Editor: enEditor, | ||
Errors: enErrors, | ||
}, | ||
ru: { | ||
translations: ruTranslations, | ||
DocExplorer: ruDocExplorer, | ||
Toolbar: ruToolbar, | ||
Editor: ruEditor, | ||
Errors: ruErrors, | ||
}, | ||
}; | ||
|
||
i18n | ||
.use(LanguageDetector) | ||
.use(initReactI18next) | ||
.init({ | ||
// Language detector options | ||
detection: { | ||
// order and from where user language should be detected | ||
order: [ | ||
'querystring', | ||
'localStorage', | ||
'navigator', | ||
'htmlTag', | ||
'path', | ||
'subdomain', | ||
], | ||
|
||
// keys or params to lookup language from | ||
lookupQuerystring: 'lng', | ||
lookupCookie: 'i18next', | ||
lookupLocalStorage: 'i18nextLng', | ||
lookupFromPathIndex: 0, | ||
lookupFromSubdomainIndex: 0, | ||
|
||
// cache user language on | ||
caches: ['localStorage'], | ||
excludeCacheFor: ['cimode'], // languages to not persist (cookie, localStorage) | ||
|
||
// optional expire and domain for set cookie | ||
cookieMinutes: 10, | ||
cookieDomain: window.location.hostname, | ||
|
||
// optional htmlTag with lang attribute, the default is: | ||
htmlTag: document.documentElement, | ||
}, | ||
|
||
// we init with resources | ||
resources, | ||
fallbackLng: { | ||
'en-US': ['en'], | ||
default: ['en'], | ||
}, | ||
whitelist: ['en', 'ru'], | ||
// // have a common namespace used around the full app | ||
// ns: ['translations'], | ||
defaultNS: 'translation', | ||
load: 'currentOnly', | ||
preload: ['en', 'ru'], | ||
keySeparator: '.', // we use content as keys | ||
nsSeparator: ':', | ||
interpolation: { | ||
escapeValue: false, // not needed for react!! | ||
}, | ||
react: { | ||
wait: true, | ||
}, | ||
}); | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"Docs": "Docs", | ||
"Search {{name}}": "Search {{name}}...", | ||
"Schema": "Schema", | ||
"root types": "root types", | ||
"Documentation Explorer": "Documentation Explorer", | ||
"No Schema Available": "No Schema Available", | ||
"A GraphQL schema provides a root type for each kind of operation": "A GraphQL schema provides a root type for each kind of operation.", | ||
"query": "query", | ||
"mutation": "mutation", | ||
"subscription": "subscription", | ||
"Go back to {{value}}": "Go back to {{value}}", | ||
"Close History": "Close History", | ||
"Open Documentation Explorer": "Open Documentation Explorer", | ||
"Close Documentation Explorer": "Close Documentation Explorer" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"Welcome to GraphiQL": "# Welcome to GraphiQL\\r\\n#\\r\\n# GraphiQL is an in-browser tool for writing, validating, and\\r\\n# testing GraphQL queries.\\r\\n#\\r\\n# Type queries into this side of the screen, and you will see intelligent\\r\\n# typeaheads aware of the current GraphQL type schema and live syntax and\\r\\n# validation errors highlighted within the text.\\r\\n#\\r\\n# GraphQL queries typically start with a \\\"{\\\" character. Lines that starts\\r\\n# with a # are ignored.\\r\\n#\\r\\n# An example GraphQL query might look like:\\r\\n#\\r\\n# {\\r\\n# field(arg: \\\"value\\\") {\\r\\n# subField\\r\\n# }\\r\\n# }\\r\\n#\\r\\n# Keyboard shortcuts:\\r\\n#\\r\\n# Prettify Query: Shift-Ctrl-P (or press the prettify button above)\\r\\n#\\r\\n# Merge Query: Shift-Ctrl-M (or press the merge button above)\\r\\n#\\r\\n# Run Query: Ctrl-Enter (or press the play button above)\\r\\n#\\r\\n# Auto Complete: Ctrl-Space (or just start typing)\\r\\n#", | ||
"Automatically added leaf fields": "Automatically added leaf fields", | ||
"Query Variables": "Query Variables", | ||
"Query Editor": "Query Editor" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Fetcher or uri property are required": "fetcher or uri property are required", | ||
"Fetcher did not return a Promise for introspection": "Fetcher did not return a Promise for introspection.", | ||
"Variables are invalid JSON": "Variables are invalid JSON.", | ||
"Variables are not a JSON object": "Variables are not a JSON object.", | ||
"no value resolved": "no value resolved" | ||
} |
Oops, something went wrong.