-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add demo webpack starter with basic customer and provider usage
- Loading branch information
Дмитрий Коваленко
authored and
Дмитрий Коваленко
committed
Jun 23, 2018
1 parent
74c18e8
commit 6f534ef
Showing
15 changed files
with
6,900 additions
and
366 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,4 @@ typings/ | |
.next | ||
|
||
build/ | ||
.DS_Store |
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,18 @@ | ||
{ | ||
// Используйте IntelliSense, чтобы узнать о возможных атрибутах. | ||
// Наведите указатель мыши, чтобы просмотреть описания существующих атрибутов. | ||
// Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Запустить программу", | ||
"program": "${workspaceFolder}/index.js", | ||
"preLaunchTask": "tsc: build - tsconfig.json", | ||
"outFiles": [ | ||
"${workspaceFolder}/../build/**/*.js" | ||
] | ||
} | ||
] | ||
} |
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,22 @@ | ||
import * as React from 'react'; | ||
import { hot } from 'react-hot-loader' | ||
import Translate from '../src/Translate'; | ||
import NameSpaceProvider from '../src/NamespaceProvider'; | ||
|
||
interface AppProps { } | ||
|
||
const App: React.SFC<AppProps> = (props) => { | ||
return ( | ||
<div> | ||
<div> Here would be some examples </div> | ||
<Translate> hi </Translate> | ||
|
||
<NameSpaceProvider ns="specificNs"> | ||
<Translate> hi </Translate> | ||
<Translate> something-specific </Translate> | ||
</NameSpaceProvider> | ||
</div> | ||
) | ||
}; | ||
|
||
export default hot(module)(App) |
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,13 @@ | ||
import * as React from 'react' | ||
import * as ReactDom from 'react-dom' | ||
|
||
import App from './App' | ||
import I18NextProvider from '../src/I18NextProvider'; | ||
import i18n from './services/i18n'; | ||
|
||
ReactDom.render( | ||
<I18NextProvider i18n={i18n}> | ||
<App /> | ||
</I18NextProvider>, | ||
document.getElementById('root') | ||
) |
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,18 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> | ||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | ||
|
||
<title> Demo page </title> | ||
</head> | ||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
|
||
<div id="root"></div> | ||
</body> | ||
</html> |
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,17 @@ | ||
import * as i18n from 'i18next'; | ||
import * as translations from '../translations.json'; | ||
|
||
i18n | ||
.init({ | ||
resources: translations, | ||
fallbackLng: 'ru', | ||
debug: true, | ||
// have a comnpmmon namespace used around the full app | ||
ns: ['common'], | ||
defaultNS: 'common', | ||
fallbackNS: 'common', | ||
|
||
keySeparator: false, // we use content as keys | ||
}); | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"en": { | ||
"common": { | ||
"hi": "hi" | ||
}, | ||
"specificNs": { | ||
"somesthing_specific": "somesthing_specific" | ||
} | ||
}, | ||
"ru": { | ||
"common": { | ||
"hi": "Привет" | ||
}, | ||
"specificNs": { | ||
"somesthing_specific": "что-то специфичное" | ||
} | ||
} | ||
} |
Oops, something went wrong.