Skip to content

Commit

Permalink
Merge pull request #1 from lingui/master
Browse files Browse the repository at this point in the history
Update from upstream
  • Loading branch information
cristiingineru authored Feb 26, 2018
2 parents df95e35 + a5a359e commit a15e27d
Show file tree
Hide file tree
Showing 29 changed files with 1,000 additions and 954 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@
"bug",
"doc"
]
},
{
"login": "hiddenboox",
"name": "Sebastian Sobociński",
"avatar_url": "https://avatars1.githubusercontent.com/u/2965120?v=4",
"profile": "https:/hiddenboox",
"contributions": [
"code"
]
}
]
}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Seamless internationalization in Javascript and React
[![CircleCI][Badge-CI]][CI]
[![Code Coverage][Badge-Coverage]][Coverage]
[![PRs Welcome][Badge-PRWelcome]][PRWelcome]
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)
[![MIT License][Badge-License]][LICENSE]

[![Watch on GitHub][Badge-Watch]][Watch]
Expand Down Expand Up @@ -243,8 +243,9 @@ like `@lingui/react` only brings better performace for target environments.
Thanks goes to these people ([emoji key][emojis]):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars1.githubusercontent.com/u/827862?v=3" width="100px;"/><br /><sub><b>Tomáš Ehrlich</b></sub>](http://www.tomasehrlich.cz)<br />[💻](https:/lingui/js-lingui/commits?author=tricoder42 "Code") [📖](https:/lingui/js-lingui/commits?author=tricoder42 "Documentation") [💡](#example-tricoder42 "Examples") [✅](#tutorial-tricoder42 "Tutorials") | [<img src="https://avatars1.githubusercontent.com/u/3697116?v=3" width="100px;"/><br /><sub><b>Josef Hornych</b></sub>](https:/Peping)<br />[📖](https:/lingui/js-lingui/commits?author=Peping "Documentation") [🐛](https:/lingui/js-lingui/issues?q=author%3APeping "Bug reports") | [<img src="https://avatars2.githubusercontent.com/u/307006?v=3" width="100px;"/><br /><sub><b>Christian Kaps</b></sub>](https://www.silhouette.rocks)<br />[🐛](https:/lingui/js-lingui/issues?q=author%3Aakkie "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/2085291?v=3" width="100px;"/><br /><sub><b>brunesto</b></sub>](https:/brunesto)<br />[💻](https:/lingui/js-lingui/commits?author=brunesto "Code") [🐛](https:/lingui/js-lingui/issues?q=author%3Abrunesto "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/614768?v=3" width="100px;"/><br /><sub><b>David Furlong</b></sub>](https://davidfurlong.github.io/)<br />[💬](#question-davidfurlong "Answering Questions") | [<img src="https://avatars2.githubusercontent.com/u/1416801?v=4" width="100px;"/><br /><sub><b>Thibaut</b></sub>](http://thibaut.re)<br />[🐛](https:/lingui/js-lingui/issues?q=author%3AthibautRe "Bug reports") [📖](https:/lingui/js-lingui/commits?author=thibautRe "Documentation") |
| :---: | :---: | :---: | :---: | :---: | :---: |
<!-- prettier-ignore -->
| [<img src="https://avatars1.githubusercontent.com/u/827862?v=3" width="100px;"/><br /><sub><b>Tomáš Ehrlich</b></sub>](http://www.tomasehrlich.cz)<br />[💻](https:/lingui/js-lingui/commits?author=tricoder42 "Code") [📖](https:/lingui/js-lingui/commits?author=tricoder42 "Documentation") [💡](#example-tricoder42 "Examples") [✅](#tutorial-tricoder42 "Tutorials") | [<img src="https://avatars1.githubusercontent.com/u/3697116?v=3" width="100px;"/><br /><sub><b>Josef Hornych</b></sub>](https:/Peping)<br />[📖](https:/lingui/js-lingui/commits?author=Peping "Documentation") [🐛](https:/lingui/js-lingui/issues?q=author%3APeping "Bug reports") | [<img src="https://avatars2.githubusercontent.com/u/307006?v=3" width="100px;"/><br /><sub><b>Christian Kaps</b></sub>](https://www.silhouette.rocks)<br />[🐛](https:/lingui/js-lingui/issues?q=author%3Aakkie "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/2085291?v=3" width="100px;"/><br /><sub><b>brunesto</b></sub>](https:/brunesto)<br />[💻](https:/lingui/js-lingui/commits?author=brunesto "Code") [🐛](https:/lingui/js-lingui/issues?q=author%3Abrunesto "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/614768?v=3" width="100px;"/><br /><sub><b>David Furlong</b></sub>](https://davidfurlong.github.io/)<br />[💬](#question-davidfurlong "Answering Questions") | [<img src="https://avatars2.githubusercontent.com/u/1416801?v=4" width="100px;"/><br /><sub><b>Thibaut</b></sub>](http://thibaut.re)<br />[🐛](https:/lingui/js-lingui/issues?q=author%3AthibautRe "Bug reports") [📖](https:/lingui/js-lingui/commits?author=thibautRe "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/2965120?v=4" width="100px;"/><br /><sub><b>Sebastian Sobociński</b></sub>](https:/hiddenboox)<br />[💻](https:/lingui/js-lingui/commits?author=hiddenboox "Code") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors][all-contributors] specification.
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/plurals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If we use English in the source code, then we'll use only *one* and *other*:
.. code-block:: js
i18n.plural({
count: numBooks,
value: numBooks,
one: "# book",
other: "# books"
})
Expand Down Expand Up @@ -70,7 +70,7 @@ the process:
.. code-block:: js
i18n.plural({
count: numBooks,
value: numBooks,
one: "# book",
other: "# books"
})
Expand Down Expand Up @@ -101,7 +101,7 @@ languages has and then you can use them. Here's the example in Czech:
.. code-block:: js
i18n.plural({
count: numBooks,
value: numBooks,
one: '# kniha',
few: '# knihy',
other: '# knih'
Expand Down
4 changes: 2 additions & 2 deletions docs/ref/lingui-react.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
************************************
*************************************
API Reference - React (@lingui/react)
************************************
*************************************

Components from ``@lingui/react`` wrap the vanilla JS API from ``lingui-i18n``.
React components handle changes of active language or interpolated variables
Expand Down
7 changes: 3 additions & 4 deletions examples/react-redux-form/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
}
],
"@babel/preset-react",
"@babel/preset-flow"
"@babel/preset-flow",
"@lingui/babel-preset-react"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@lingui/babel-plugin-transform-js",
"@lingui/babel-plugin-transform-react"
"@babel/plugin-proposal-object-rest-spread"
],
"env": {
"test": {
Expand Down
7 changes: 3 additions & 4 deletions examples/webpack-react/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
}
],
"@babel/preset-react",
"@babel/preset-flow"
"@babel/preset-flow",
"@lingui/babel-preset-react"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@lingui/babel-plugin-transform-js",
"@lingui/babel-plugin-transform-react"
"@babel/plugin-proposal-object-rest-spread"
],
"env": {
"test": {
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.38",
"@babel/core": "^7.0.0-beta.38",
"@babel/core": "^7.0.0-beta.40",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.38",
"@babel/plugin-proposal-export-default-from": "^7.0.0-beta.38",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.38",
Expand All @@ -36,7 +36,7 @@
"all-contributors-cli": "^4.8.1",
"babel-core": "^7.0.0-0",
"babel-eslint": "^8.2.1",
"babel-jest": "^22.1.0",
"babel-jest": "^22.4.0",
"babel-plugin-resolver": "^1.1.0",
"chalk": "^2.3.0",
"cross-env": "^5.1.3",
Expand All @@ -47,16 +47,16 @@
"eslint-plugin-flowtype": "^2.41.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.7.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-prettier": "^2.5.0",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.5.1",
"filesize": "^3.5.11",
"flow-bin": "^0.63.1",
"flow-bin": "^0.66.0",
"glob": "^7.1.2",
"gzip-size": "^4.1.0",
"husky": "^0.14.3",
"jest": "^22.1.4",
"jest": "^22.4.0",
"jest-junit": "^3.3.0",
"lerna": "^2.8.0",
"memory-fs": "^0.4.1",
Expand All @@ -68,8 +68,9 @@
"prettier": "^1.10.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"regenerator-runtime": "^0.11.1",
"rimraf": "^2.6.1",
"rollup": "^0.54.1",
"rollup": "^0.56.2",
"rollup-plugin-babel": "^4.0.0-beta.0",
"rollup-plugin-closure-compiler-js": "^1.0.6",
"rollup-plugin-commonjs": "^8.2.6",
Expand Down
8 changes: 4 additions & 4 deletions packages/babel-plugin-extract-messages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/babel-plugin-extract-messages",
"version": "2.0.0",
"version": "2.0.4",
"description": "Extract messages for translation",
"main": "index.js",
"author": {
Expand Down Expand Up @@ -29,10 +29,10 @@
},
"dependencies": {
"@babel/generator": "^7.0.0-beta.38",
"@lingui/conf": "2.0.0"
"@lingui/conf": "2.0.4"
},
"devDependencies": {
"@lingui/babel-plugin-transform-js": "2.0.0",
"@lingui/babel-plugin-transform-react": "2.0.0"
"@lingui/babel-plugin-transform-js": "2.0.4",
"@lingui/babel-plugin-transform-react": "2.0.4"
}
}
4 changes: 3 additions & 1 deletion packages/babel-plugin-extract-messages/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export default function({ types: t }) {
importDeclarations[specifier.imported.name] = specifier.local.name
})

localTransComponentName = importDeclarations["Trans"]
if (importDeclarations["Trans"]) {
localTransComponentName = importDeclarations["Trans"]
}
}

// Remove imports of i18nMark identity
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/babel-plugin-transform-js",
"version": "2.0.0",
"version": "2.0.4",
"description": "Transform lingui-i18n methods to ICU message format",
"main": "index.js",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/babel-plugin-transform-react",
"version": "2.0.0",
"version": "2.0.4",
"description": "Transform React components to ICU message format",
"main": "index.js",
"author": {
Expand Down
8 changes: 6 additions & 2 deletions packages/babel-preset-js/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module.exports = {
plugins: [require("@lingui/babel-plugin-transform-js").default]
var transformJs = require("@lingui/babel-plugin-transform-js").default

module.exports = function(context, opts) {
return {
plugins: [transformJs]
}
}
4 changes: 2 additions & 2 deletions packages/babel-preset-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/babel-preset-js",
"version": "2.0.0",
"version": "2.0.4",
"description": "Lingui preset for Javascript apps",
"main": "index.js",
"author": {
Expand All @@ -20,6 +20,6 @@
"url": "https:/lingui/js-lingui/issues"
},
"dependencies": {
"@lingui/babel-plugin-transform-js": "2.0.0"
"@lingui/babel-plugin-transform-js": "2.0.4"
}
}
12 changes: 7 additions & 5 deletions packages/babel-preset-react/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
plugins: [
require("@lingui/babel-plugin-transform-js").default,
require("@lingui/babel-plugin-transform-react").default
]
var transformJs = require("@lingui/babel-plugin-transform-js").default
var transformReact = require("@lingui/babel-plugin-transform-react").default

module.exports = function(context, opts) {
return {
plugins: [transformJs, transformReact]
}
}
6 changes: 3 additions & 3 deletions packages/babel-preset-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/babel-preset-react",
"version": "2.0.0",
"version": "2.0.4",
"description": "Lingui preset for React apps",
"main": "index.js",
"author": {
Expand All @@ -20,7 +20,7 @@
"url": "https:/lingui/js-lingui/issues"
},
"dependencies": {
"@lingui/babel-plugin-transform-js": "2.0.0",
"@lingui/babel-plugin-transform-react": "2.0.0"
"@lingui/babel-plugin-transform-js": "2.0.4",
"@lingui/babel-plugin-transform-react": "2.0.4"
}
}
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/cli",
"version": "2.0.0",
"version": "2.0.4",
"description": "CLI for working wit message catalogs",
"keywords": [
"cli",
Expand Down Expand Up @@ -39,10 +39,10 @@
"@babel/generator": "^7.0.0-beta.38",
"@babel/runtime": "^7.0.0-beta.38",
"@babel/types": "^7.0.0-beta.38",
"@lingui/babel-plugin-extract-messages": "2.0.0",
"@lingui/babel-plugin-transform-js": "2.0.0",
"@lingui/babel-plugin-transform-react": "2.0.0",
"@lingui/conf": "2.0.0",
"@lingui/babel-plugin-extract-messages": "2.0.4",
"@lingui/babel-plugin-transform-js": "2.0.4",
"@lingui/babel-plugin-transform-react": "2.0.4",
"@lingui/conf": "2.0.4",
"babylon": "^6.18.0",
"chalk": "^2.3.0",
"cli-table": "^0.3.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/api/compile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @flow
import * as t from "babel-types"
import * as t from "@babel/types"
import { parse } from "messageformat-parser"
import { parseExpression } from "babylon"
import generate from "babel-generator"
import generate from "@babel/generator"
import plurals from "make-plural"
import R from "ramda"

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/api/extractors/babel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { transformFileSync } from "babel-core"
import { transformFileSync } from "@babel/core"

import linguiTransformJs from "@lingui/babel-plugin-transform-js"
import linguiTransformReact from "@lingui/babel-plugin-transform-react"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/api/formats/lingui.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import R from "ramda"
import type { LinguiConfig, CatalogFormat } from "./types"
import * as locales from "./utils/locales"

const sourceFilename = "{locale}/messages.json"
const compiledFilename = "{locale}/messages.js"
const sourceFilename = path.join("{locale}", "messages.json")
const compiledFilename = path.join("{locale}", "messages.js")

export default (config: LinguiConfig): CatalogFormat => ({
formatFilename(pattern, locale) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/api/formats/utils/locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type LocaleObject = {
* 4. country code
* @type {RegExp}
*/
export const localeRe = new RegExp(/(([a-z]+)(_([a-zA-Z]+))?)/)
export const localeRe = new RegExp(/(([a-z]+)(_([a-zA-Z]+))?)(\\|\/)?/)

export function isValid(locale: string): boolean {
const match = localeRe.exec(locale)
Expand Down
2 changes: 1 addition & 1 deletion packages/conf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/conf",
"version": "2.0.0",
"version": "2.0.4",
"description": "Get lingui configuration from package.json",
"keywords": [
"lingui",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/core",
"version": "2.0.0",
"version": "2.0.4",
"description": "I18n tools for javascript",
"keywords": [
"i18n",
Expand Down
6 changes: 3 additions & 3 deletions packages/loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/loader",
"version": "2.0.0",
"version": "2.0.4",
"description": "webpack loader for lingui message catalogs",
"main": "dist/index.js",
"author": {
Expand Down Expand Up @@ -30,8 +30,8 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.38",
"@lingui/cli": "2.0.0",
"@lingui/conf": "2.0.0",
"@lingui/cli": "2.0.4",
"@lingui/conf": "2.0.4",
"ramda": "^0.25.0"
}
}
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/react",
"version": "2.0.0",
"version": "2.0.4",
"description": "React components for translations",
"main": "index.js",
"module": "index.es.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.38",
"@lingui/core": "2.0.0",
"@lingui/core": "2.0.4",
"hash-sum": "^1.0.2",
"prop-types": "^15.6.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/typescript-extract-messages/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lingui/typescript-extract-messages",
"private": true,
"version": "2.0.0",
"version": "2.0.4",
"description": "Extract messages for translation from Typescript files",
"main": "index.js",
"author": {
Expand Down Expand Up @@ -29,7 +29,7 @@
"node": ">=4.0"
},
"dependencies": {
"@lingui/conf": "2.0.0"
"@lingui/conf": "2.0.4"
},
"devDependencies": {
"typescript": "^2.4.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.4
Loading

0 comments on commit a15e27d

Please sign in to comment.