This commit is contained in:
17
node_modules/react-polyglot/example/app.js
generated
vendored
Normal file
17
node_modules/react-polyglot/example/app.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { I18n } from '../lib';
|
||||
import Greeter from './greeter';
|
||||
|
||||
const locale = window.locale || 'en';
|
||||
const messages = {
|
||||
"hello_name": "Hello, %{name}.",
|
||||
"num_cars": "%{smart_count} car |||| %{smart_count} cars",
|
||||
}
|
||||
|
||||
render(
|
||||
<I18n locale={locale} messages={messages}>
|
||||
<Greeter name="Batsy" />
|
||||
</I18n>,
|
||||
document.getElementById('app')
|
||||
);
|
||||
21487
node_modules/react-polyglot/example/dist.js
generated
vendored
Normal file
21487
node_modules/react-polyglot/example/dist.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8
node_modules/react-polyglot/example/greeter.js
generated
vendored
Normal file
8
node_modules/react-polyglot/example/greeter.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import { translate } from '../lib';
|
||||
|
||||
const Greeter = ({ name, t }) => (
|
||||
<h3>{t('hello_name', { name })}</h3>
|
||||
);
|
||||
|
||||
export default translate()(Greeter);
|
||||
10
node_modules/react-polyglot/example/index.html
generated
vendored
Normal file
10
node_modules/react-polyglot/example/index.html
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>react-polygot demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="dist.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user