From f7f46cdfa4dcd514d4f31fb275a2100d15485916 Mon Sep 17 00:00:00 2001 From: Vaclav Klecanda Date: Thu, 27 Apr 2017 07:45:40 +0200 Subject: [PATCH 01/18] i18n vol.1 --- src/backends/test-repo/AuthenticationPage.js | 8 +++++--- src/components/AppHeader/AppHeader.js | 3 ++- src/components/EntryEditor/EntryEditorToolbar.js | 3 ++- src/components/FindBar/FindBar.js | 4 ++-- .../UnpublishedListing/UnpublishedListing.js | 6 ++++-- src/components/Widgets/FileControl.js | 4 +++- src/components/Widgets/ImageControl.js | 3 ++- .../MarkdownControlElements/Toolbar/Toolbar.js | 12 +++++++----- .../Toolbar/ToolbarPluginForm.js | 5 +++-- src/constants/publishModes.js | 8 +++++--- src/containers/App.js | 6 ++++-- src/i18n/index.js | 4 ++++ src/index.js | 5 +++-- 13 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 src/i18n/index.js diff --git a/src/backends/test-repo/AuthenticationPage.js b/src/backends/test-repo/AuthenticationPage.js index 92ac194d75b6..1eb1e22c6420 100644 --- a/src/backends/test-repo/AuthenticationPage.js +++ b/src/backends/test-repo/AuthenticationPage.js @@ -4,6 +4,8 @@ import Button from "react-toolbox/lib/button"; import { Card, Icon } from "../../components/UI"; import logo from "../netlify-auth/netlify_logo.svg"; import styles from "../netlify-auth/AuthenticationPage.css"; +import { __ } from '../../i18n'; + export default class AuthenticationPage extends React.Component { static propTypes = { @@ -25,10 +27,10 @@ export default class AuthenticationPage extends React.Component { return (
-

This is a demo, enter your email to start

+

{__('This is a demo, enter your email to start')}

- Login + {__('Login')}
); diff --git a/src/components/AppHeader/AppHeader.js b/src/components/AppHeader/AppHeader.js index 4746909907ec..1e63dad387fc 100644 --- a/src/components/AppHeader/AppHeader.js +++ b/src/components/AppHeader/AppHeader.js @@ -9,6 +9,7 @@ import FontIcon from "react-toolbox/lib/font_icon"; import FindBar from "../FindBar/FindBar"; import { stringToRGB } from "../../lib/textHelper"; import styles from "./AppHeader.css"; +import { __ } from '../../i18n'; export default class AppHeader extends React.Component { @@ -89,7 +90,7 @@ export default class AppHeader extends React.Component { - + ); diff --git a/src/components/EntryEditor/EntryEditorToolbar.js b/src/components/EntryEditor/EntryEditorToolbar.js index a5e29ba18c56..80c30c945d33 100644 --- a/src/components/EntryEditor/EntryEditorToolbar.js +++ b/src/components/EntryEditor/EntryEditorToolbar.js @@ -1,5 +1,6 @@ import React, { PropTypes } from 'react'; import { Button } from 'react-toolbox/lib/button'; +import { __ } from '../../i18n'; const EntryEditorToolbar = ( { @@ -16,7 +17,7 @@ const EntryEditorToolbar = ( onClick={onPersist} disabled={disabled} > - { isPersisting ? 'Saving...' : 'Save' } + { isPersisting ? __('Saving...') : __('Save') } {' '} + {' '} - + ); diff --git a/src/constants/publishModes.js b/src/constants/publishModes.js index 2cf4e4439a11..5bf28ff10d08 100644 --- a/src/constants/publishModes.js +++ b/src/constants/publishModes.js @@ -1,4 +1,6 @@ import { Map, OrderedMap } from 'immutable'; +import { __ } from '../i18n'; + // Create/edit workflow modes export const SIMPLE = 'simple'; @@ -12,7 +14,7 @@ export const status = OrderedMap({ }); export const statusDescriptions = Map({ - [status.get('DRAFT')]: 'Draft', - [status.get('PENDING_REVIEW')]: 'Waiting for Review', - [status.get('PENDING_PUBLISH')]: 'Waiting to go live', + [status.get('DRAFT')]: __('Draft'), + [status.get('PENDING_REVIEW')]: __('Waiting for Review'), + [status.get('PENDING_PUBLISH')]: __('Waiting to go live'), }); diff --git a/src/containers/App.js b/src/containers/App.js index 0b6cfed836e9..a3b890c4c666 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -24,6 +24,8 @@ import { getCollectionUrl, getNewEntryUrl } from '../lib/urlHelper'; import { SIMPLE, EDITORIAL_WORKFLOW } from '../constants/publishModes'; import styles from './App.css'; import sidebarStyles from './Sidebar.css'; +import { __ } from '../i18n'; + TopBarProgress.config({ barColors: { @@ -125,7 +127,7 @@ class App extends React.Component { } if (config.get('isFetching')) { - return Loading configuration...; + return {__('Loading configuration...')}; } if (user == null) { @@ -145,7 +147,7 @@ class App extends React.Component { }
-

Collections

+

{__('Collections')}

{ collections.valueSeq().map((collection) => { const collectionName = collection.get('name'); diff --git a/src/i18n/index.js b/src/i18n/index.js new file mode 100644 index 000000000000..cb896f430c33 --- /dev/null +++ b/src/i18n/index.js @@ -0,0 +1,4 @@ + +exports.__ = function(str) { + return '**' + str +} diff --git a/src/index.js b/src/index.js index 47de32d4f4ef..7af9d5c871af 100644 --- a/src/index.js +++ b/src/index.js @@ -5,6 +5,7 @@ import 'file?name=index.html!../example/index.html'; import 'react-toolbox/lib/commons.scss'; import Root from './root'; import registry from './lib/registry'; +import { __ } from './i18n'; import './index.css'; if (process.env.NODE_ENV !== 'production') { @@ -47,11 +48,11 @@ const buildtInPlugins = [{ toPreview: data => {data.alt}, pattern: /^!\[([^\]]+)]\(([^)]+)\)$/, fields: [{ - label: 'Image', + label: __('Image'), name: 'image', widget: 'image', }, { - label: 'Alt Text', + label: __('Alt Text'), name: 'alt', }], }]; From 905126b843f9e26bea8da4c6c40ff3525ff7d157 Mon Sep 17 00:00:00 2001 From: Vaclav Klecanda Date: Thu, 27 Apr 2017 09:16:19 +0200 Subject: [PATCH 02/18] extract npm script for extract i18n string --- docs/contributor-guide.md | 9 +++++++++ package.json | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/contributor-guide.md b/docs/contributor-guide.md index 94cdc43a0a0c..eb07edc1573e 100644 --- a/docs/contributor-guide.md +++ b/docs/contributor-guide.md @@ -7,3 +7,12 @@ While we work on building this page (and you can help!), here are some links wit * [Project Roadmap](https://github.com/netlify/netlify-cms/projects/3) * [Code of Conduct](https://github.com/netlify/netlify-cms/blob/master/CODE_OF_CONDUCT.md) * [Setup instructions and Contribution Guidelines](https://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md) + + +## i18n + +to extract/update i18n string run: + +``` +npm run extract --lang +``` diff --git a/package.json b/package.json index 04f76bc1655e..87cd9662cdea 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "lint:css:fix": "stylefmt --recursive src/", "lint:staged": "lint-staged", "deps": "npm-check -s", - "deps:update": "npm-check -u" + "deps:update": "npm-check -u", + "extract": "./node_modules/.bin/extract-gettext -p 'var langStrings = ' -o src/i18n src/" }, "lint-staged": { "*.js": [ @@ -64,6 +65,7 @@ "eslint": "^3.7.1", "eslint-config-netlify": "github:netlify/eslint-config-netlify", "exports-loader": "^0.6.3", + "extract-gettext": "github:blueskydigital/extract-gettext", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.5", "identity-obj-proxy": "^3.0.0", From 6f08d7d936c76543771d74479d97ae324c71f0d0 Mon Sep 17 00:00:00 2001 From: Vaclav Klecanda Date: Thu, 27 Apr 2017 09:28:21 +0200 Subject: [PATCH 03/18] __ impl --- src/i18n/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/index.js b/src/i18n/index.js index cb896f430c33..5f3780f0e181 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -1,4 +1,4 @@ exports.__ = function(str) { - return '**' + str + return window.langStrings ? window.langStrings[str] : str } From 4f48dba3506d4b2df177939a9b731444d88a7573 Mon Sep 17 00:00:00 2001 From: Vaclav Klecanda Date: Thu, 4 May 2017 19:17:11 +0200 Subject: [PATCH 04/18] cs strings --- src/i18n/cs.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/i18n/cs.js diff --git a/src/i18n/cs.js b/src/i18n/cs.js new file mode 100644 index 000000000000..fb5c494bc436 --- /dev/null +++ b/src/i18n/cs.js @@ -0,0 +1,27 @@ +var langStrings = { + "Alt Text": "Alt Text", + "Are you sure you want to delete this entry?": "Opradu to chceš smazat?", + "Are you sure you want to publish this entry?": "Opradu to chceš publikovat?", + "Bold": "Tučně", + "Cancel": "Zrušit", + "Collections": "Kolekce", + "Draft": "Koncept", + "Email": "Email", + "Header 1": "Nadpis úrovně 1", + "Header 2": "Nadpis úrovně 2", + "Image": "Obrázek", + "Insert": "Vložit", + "Italic": "Kurzíva", + "Link": "Odkaz", + "Loading configuration...": "Nahrávám nastavení ...", + "Log Out": "Odhlásit", + "Login": "Přihlásit", + "Save": "Uložit", + "Saving...": "Ukládám ...", + "Search entry titles...": "Prohledat nadpisy...", + "This is a demo, enter your email to start": "Tohle je demo, vlož svůj email a začni", + "Tip: Click here to select a file to upload, or drag an image directly into this box from your desktop": "Tip: Klikni zde a vyber soubor pro nahrání, nebo přetáhni obrázek přímo do tohoto boxu", + "Tip: Click here to upload an image from your file browser, or drag an image directly into this box from your desktop": "Tip: Klikni zde a vyber z tvého zařízení, nebo ho přetáhni přímo do tohoto boxu", + "Waiting for Review": "Čeká na schválení", + "Waiting to go live": "Čeká na publikování" +} From f2b1783dd825eb977bfa7cc493e1dd931d905e83 Mon Sep 17 00:00:00 2001 From: Vaclav Klecanda Date: Fri, 19 May 2017 10:43:02 +0200 Subject: [PATCH 05/18] transls made by polyglot --- extract.js | 54 +++++++++++++++++++ package.json | 5 +- src/backends/test-repo/AuthenticationPage.js | 8 +-- src/components/AppHeader/AppHeader.js | 4 +- .../EntryEditor/EntryEditorToolbar.js | 4 +- src/components/FindBar/FindBar.js | 4 +- .../UnpublishedListing/UnpublishedListing.js | 6 +-- src/components/Widgets/FileControl.js | 4 +- src/components/Widgets/ImageControl.js | 4 +- .../Toolbar/Toolbar.js | 10 ++-- .../Toolbar/ToolbarPluginForm.js | 4 +- src/constants/publishModes.js | 6 +-- src/containers/App.js | 4 +- src/i18n/cs.js | 27 ---------- src/i18n/cs.json | 27 ++++++++++ src/i18n/en.json | 27 ++++++++++ src/i18n/index.js | 4 -- src/index.js | 4 +- 18 files changed, 142 insertions(+), 64 deletions(-) create mode 100644 extract.js delete mode 100644 src/i18n/cs.js create mode 100644 src/i18n/cs.json create mode 100644 src/i18n/en.json delete mode 100644 src/i18n/index.js diff --git a/extract.js b/extract.js new file mode 100644 index 000000000000..a8a497c8799f --- /dev/null +++ b/extract.js @@ -0,0 +1,54 @@ +const i18n = require('i18n-extract'); +const path = require('path'); +const fs = require('fs'); +const _ = require('lodash') +const i18nFolder = path.join(__dirname, 'src/i18n'); + +const keys = i18n.extractFromFiles([ + 'src/**/*.js', +], { + marker: 'polyglot.t', +}); + +function _mergeMissing(transls, missing) { + _.each(missing, (i) => { + if (transls[i.key] === undefined) { + transls[i.key] = i.type; + } + }); +} + +// check english trans first, they MUST be complete !!! +const enFile = 'en.json'; +const enFilePath = path.join(i18nFolder, enFile); +const enTransls = JSON.parse(fs.readFileSync(enFilePath)); + +const enMissing = i18n.findMissing(enTransls, keys); +if (enMissing.length > 0) { + _mergeMissing(enTransls, enMissing); + fs.writeFileSync(enFilePath, JSON.stringify(enTransls, {}, 2)); + console.log('Some errors in english translation. Correct them:'); + console.log(JSON.stringify(enMissing, {}, 2)); + return -1; +} + +const errors = [] + +fs.readdirSync(i18nFolder).forEach(file => { + if (file === enFile) { + return + } + const filePath = path.join(i18nFolder, file); + const transls = JSON.parse(fs.readFileSync(filePath)); + + const missing = i18n.findMissing(transls, keys); + if (missing.length > 0) { + _mergeMissing(transls, missing) + fs.writeFileSync(filePath, JSON.stringify(transls, {}, 2)); + errors.push({file: file, missing: missing}) + } +}); + +if (errors.length > 0) { + console.log(JSON.stringify(errors, {}, 2)); +} diff --git a/package.json b/package.json index 87cd9662cdea..e10b590a7a3a 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "lint:staged": "lint-staged", "deps": "npm-check -s", "deps:update": "npm-check -u", - "extract": "./node_modules/.bin/extract-gettext -p 'var langStrings = ' -o src/i18n src/" + "extract": "node extract.js" }, "lint-staged": { "*.js": [ @@ -65,13 +65,14 @@ "eslint": "^3.7.1", "eslint-config-netlify": "github:netlify/eslint-config-netlify", "exports-loader": "^0.6.3", - "extract-gettext": "github:blueskydigital/extract-gettext", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.5", + "i18n-extract": "^0.4.2", "identity-obj-proxy": "^3.0.0", "imports-loader": "^0.6.5", "jest-cli": "^16.0.1", "lint-staged": "^3.1.0", + "lodash": "^4.17.4", "node-sass": "^3.10.0", "npm-check": "^5.2.3", "postcss-cssnext": "^2.7.0", diff --git a/src/backends/test-repo/AuthenticationPage.js b/src/backends/test-repo/AuthenticationPage.js index 1eb1e22c6420..ca2f9cc6f956 100644 --- a/src/backends/test-repo/AuthenticationPage.js +++ b/src/backends/test-repo/AuthenticationPage.js @@ -4,7 +4,7 @@ import Button from "react-toolbox/lib/button"; import { Card, Icon } from "../../components/UI"; import logo from "../netlify-auth/netlify_logo.svg"; import styles from "../netlify-auth/AuthenticationPage.css"; -import { __ } from '../../i18n'; + export default class AuthenticationPage extends React.Component { @@ -27,10 +27,10 @@ export default class AuthenticationPage extends React.Component { return (
-

{__('This is a demo, enter your email to start')}

+

{polyglot.t('demo_message')}

- {__('Login')} + {polyglot.t('login')}
); diff --git a/src/components/AppHeader/AppHeader.js b/src/components/AppHeader/AppHeader.js index 1e63dad387fc..ed3ad87467dd 100644 --- a/src/components/AppHeader/AppHeader.js +++ b/src/components/AppHeader/AppHeader.js @@ -9,7 +9,7 @@ import FontIcon from "react-toolbox/lib/font_icon"; import FindBar from "../FindBar/FindBar"; import { stringToRGB } from "../../lib/textHelper"; import styles from "./AppHeader.css"; -import { __ } from '../../i18n'; + export default class AppHeader extends React.Component { @@ -90,7 +90,7 @@ export default class AppHeader extends React.Component { - + ); diff --git a/src/components/EntryEditor/EntryEditorToolbar.js b/src/components/EntryEditor/EntryEditorToolbar.js index 80c30c945d33..ea228358d91e 100644 --- a/src/components/EntryEditor/EntryEditorToolbar.js +++ b/src/components/EntryEditor/EntryEditorToolbar.js @@ -1,6 +1,6 @@ import React, { PropTypes } from 'react'; import { Button } from 'react-toolbox/lib/button'; -import { __ } from '../../i18n'; + const EntryEditorToolbar = ( { @@ -17,7 +17,7 @@ const EntryEditorToolbar = ( onClick={onPersist} disabled={disabled} > - { isPersisting ? __('Saving...') : __('Save') } + { isPersisting ? polyglot.t('saving') + ' ...' : polyglot.t('save') } {' '} + {' '} - + ); diff --git a/src/constants/publishModes.js b/src/constants/publishModes.js index 5bf28ff10d08..58e0988fe4f6 100644 --- a/src/constants/publishModes.js +++ b/src/constants/publishModes.js @@ -14,7 +14,7 @@ export const status = OrderedMap({ }); export const statusDescriptions = Map({ - [status.get('DRAFT')]: __('Draft'), - [status.get('PENDING_REVIEW')]: __('Waiting for Review'), - [status.get('PENDING_PUBLISH')]: __('Waiting to go live'), + [status.get('DRAFT')]: polyglot.t('draft'), + [status.get('PENDING_REVIEW')]: polyglot.t('review_waiting'), + [status.get('PENDING_PUBLISH')]: polyglot.t('go_live_waiting'), }); diff --git a/src/containers/App.js b/src/containers/App.js index a3b890c4c666..f2da30c886f3 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -127,7 +127,7 @@ class App extends React.Component { } if (config.get('isFetching')) { - return {__('Loading configuration...')}; + return {polyglot.t('loading_configuration')}; } if (user == null) { @@ -147,7 +147,7 @@ class App extends React.Component {
}
-

{__('Collections')}

+

{polyglot.t('collections')}

{ collections.valueSeq().map((collection) => { const collectionName = collection.get('name'); diff --git a/src/i18n/cs.js b/src/i18n/cs.js deleted file mode 100644 index fb5c494bc436..000000000000 --- a/src/i18n/cs.js +++ /dev/null @@ -1,27 +0,0 @@ -var langStrings = { - "Alt Text": "Alt Text", - "Are you sure you want to delete this entry?": "Opradu to chceš smazat?", - "Are you sure you want to publish this entry?": "Opradu to chceš publikovat?", - "Bold": "Tučně", - "Cancel": "Zrušit", - "Collections": "Kolekce", - "Draft": "Koncept", - "Email": "Email", - "Header 1": "Nadpis úrovně 1", - "Header 2": "Nadpis úrovně 2", - "Image": "Obrázek", - "Insert": "Vložit", - "Italic": "Kurzíva", - "Link": "Odkaz", - "Loading configuration...": "Nahrávám nastavení ...", - "Log Out": "Odhlásit", - "Login": "Přihlásit", - "Save": "Uložit", - "Saving...": "Ukládám ...", - "Search entry titles...": "Prohledat nadpisy...", - "This is a demo, enter your email to start": "Tohle je demo, vlož svůj email a začni", - "Tip: Click here to select a file to upload, or drag an image directly into this box from your desktop": "Tip: Klikni zde a vyber soubor pro nahrání, nebo přetáhni obrázek přímo do tohoto boxu", - "Tip: Click here to upload an image from your file browser, or drag an image directly into this box from your desktop": "Tip: Klikni zde a vyber z tvého zařízení, nebo ho přetáhni přímo do tohoto boxu", - "Waiting for Review": "Čeká na schválení", - "Waiting to go live": "Čeká na publikování" -} diff --git a/src/i18n/cs.json b/src/i18n/cs.json new file mode 100644 index 000000000000..a850f4d11e8a --- /dev/null +++ b/src/i18n/cs.json @@ -0,0 +1,27 @@ +{ + "alttext": "Alt Text", + "really_delete": "Opradu to chceš smazat?", + "really_publish": "Opradu to chceš publikovat?", + "bold": "Tučně", + "cancel": "Zrušit", + "collections": "Kolekce", + "draft": "Koncept", + "email": "Email", + "header1": "Nadpis úrovně 1", + "header2": "Nadpis úrovně 2", + "image": "Obrázek", + "insert": "Vložit", + "italic": "Kurzíva", + "link": "Odkaz", + "loading_configuration": "Nahrávám nastavení ...", + "logout": "Odhlásit", + "login": "Přihlásit", + "save": "Uložit", + "saving": "Ukládám", + "search_entry_titles": "Prohledat nadpisy", + "demo_message": "Tohle je demo, vlož svůj email a začni", + "imagecontrol_tip": "Tip: Klikni zde a vyber soubor pro nahrání, nebo přetáhni obrázek přímo do tohoto boxu", + "filecontrol_tip": "Tip: Klikni zde a vyber z tvého zařízení, nebo ho přetáhni přímo do tohoto boxu", + "review_waiting": "Čeká na schválení", + "go_live_waiting": "Čeká na publikování" +} diff --git a/src/i18n/en.json b/src/i18n/en.json new file mode 100644 index 000000000000..0c4ab5256135 --- /dev/null +++ b/src/i18n/en.json @@ -0,0 +1,27 @@ +{ + "alttext": "Alt Text", + "really_delete": "Are you sure you want to delete this entry?", + "really_publish": "Are you sure you want to publish this entry?", + "bold": "Bold", + "cancel": "Cancel", + "collections": "Collections", + "draft": "Draft", + "email": "Email", + "header1": "Header 1", + "header1": "Header 2", + "image": "Image", + "insert": "Insert", + "italic": "Italic", + "link": "Link", + "loading_configuration": "Loading configuration...", + "logout": "Log Out", + "login": "Login", + "save": "Save", + "saving": "Saving", + "search_entry_titles": "Search entry titles", + "demo_message": "This is a demo, enter your email to start", + "imagecontrol_tip": "Tip: Click here to select a file to upload, or drag an image directly into this box from your desktop", + "filecontrol_tip": "Tip: Click here to upload an image from your file browser, or drag an image directly into this box from your desktop", + "review_waiting": "Waiting for Review", + "go_live_waiting": "Waiting to go live" +} diff --git a/src/i18n/index.js b/src/i18n/index.js deleted file mode 100644 index 5f3780f0e181..000000000000 --- a/src/i18n/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -exports.__ = function(str) { - return window.langStrings ? window.langStrings[str] : str -} diff --git a/src/index.js b/src/index.js index 7af9d5c871af..19a47823499c 100644 --- a/src/index.js +++ b/src/index.js @@ -48,11 +48,11 @@ const buildtInPlugins = [{ toPreview: data => {data.alt}, pattern: /^!\[([^\]]+)]\(([^)]+)\)$/, fields: [{ - label: __('Image'), + label: polyglot.t('image'), name: 'image', widget: 'image', }, { - label: __('Alt Text'), + label: polyglot.t('alttext'), name: 'alt', }], }]; From cec6835a4d7c592d332108179dfaa3acee50c6c6 Mon Sep 17 00:00:00 2001 From: Vaclav Klecanda Date: Fri, 19 May 2017 11:13:54 +0200 Subject: [PATCH 06/18] forgotten imports --- .../Widgets/MarkdownControlElements/Toolbar/Toolbar.js | 1 - .../Widgets/MarkdownControlElements/Toolbar/ToolbarPluginForm.js | 1 - src/constants/publishModes.js | 1 - src/containers/App.js | 1 - src/index.js | 1 - 5 files changed, 5 deletions(-) diff --git a/src/components/Widgets/MarkdownControlElements/Toolbar/Toolbar.js b/src/components/Widgets/MarkdownControlElements/Toolbar/Toolbar.js index 9b5f58a0ae3c..d285b60dfbf0 100644 --- a/src/components/Widgets/MarkdownControlElements/Toolbar/Toolbar.js +++ b/src/components/Widgets/MarkdownControlElements/Toolbar/Toolbar.js @@ -7,7 +7,6 @@ import ToolbarComponentsMenu from './ToolbarComponentsMenu'; import ToolbarPluginForm from './ToolbarPluginForm'; import { Icon } from '../../../UI'; import styles from './Toolbar.css'; -import { __ } from '../../../../i18n'; export default class Toolbar extends React.Component { diff --git a/src/components/Widgets/MarkdownControlElements/Toolbar/ToolbarPluginForm.js b/src/components/Widgets/MarkdownControlElements/Toolbar/ToolbarPluginForm.js index eac62b102749..57132e7c73ea 100644 --- a/src/components/Widgets/MarkdownControlElements/Toolbar/ToolbarPluginForm.js +++ b/src/components/Widgets/MarkdownControlElements/Toolbar/ToolbarPluginForm.js @@ -3,7 +3,6 @@ import { Map } from 'immutable'; import { Button } from 'react-toolbox/lib/button'; import ToolbarPluginFormControl from './ToolbarPluginFormControl'; import styles from './ToolbarPluginForm.css'; -import { __ } from '../../../../i18n'; export default class ToolbarPluginForm extends React.Component { static propTypes = { diff --git a/src/constants/publishModes.js b/src/constants/publishModes.js index 58e0988fe4f6..77a1b0c2ea66 100644 --- a/src/constants/publishModes.js +++ b/src/constants/publishModes.js @@ -1,5 +1,4 @@ import { Map, OrderedMap } from 'immutable'; -import { __ } from '../i18n'; // Create/edit workflow modes diff --git a/src/containers/App.js b/src/containers/App.js index f2da30c886f3..c55ebfb1c926 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -24,7 +24,6 @@ import { getCollectionUrl, getNewEntryUrl } from '../lib/urlHelper'; import { SIMPLE, EDITORIAL_WORKFLOW } from '../constants/publishModes'; import styles from './App.css'; import sidebarStyles from './Sidebar.css'; -import { __ } from '../i18n'; TopBarProgress.config({ diff --git a/src/index.js b/src/index.js index 19a47823499c..dcdc5a7389bc 100644 --- a/src/index.js +++ b/src/index.js @@ -5,7 +5,6 @@ import 'file?name=index.html!../example/index.html'; import 'react-toolbox/lib/commons.scss'; import Root from './root'; import registry from './lib/registry'; -import { __ } from './i18n'; import './index.css'; if (process.env.NODE_ENV !== 'production') { From 86018b9bb8b23f79c788c999e189470f370d7c5f Mon Sep 17 00:00:00 2001 From: Vaclav Klecanda Date: Fri, 19 May 2017 11:14:12 +0200 Subject: [PATCH 07/18] polyglot init --- example/index.html | 4 ++++ src/actions/config.js | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/example/index.html b/example/index.html index e7a96279d81b..bb4afa753372 100644 --- a/example/index.html +++ b/example/index.html @@ -6,6 +6,7 @@ This is an example +