Skip to content

Commit 95d1ee8

Browse files
committed
bump up version
1 parent 5989f39 commit 95d1ee8

File tree

6 files changed

+37
-60
lines changed

6 files changed

+37
-60
lines changed

examples/gatsby-starter-default-intl/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"version": "0.2.1",
66
"author": "Daewoong Moon <wiziple@gmail.com>",
77
"dependencies": {
8-
"gatsby": "^2.8.4",
8+
"gatsby": "2.8.4",
99
"gatsby-image": "^2.1.2",
10-
"gatsby-plugin-intl": "^0.2.1",
10+
"gatsby-plugin-intl": "^0.2.4",
1111
"gatsby-plugin-manifest": "^2.1.1",
1212
"gatsby-plugin-offline": "^2.1.1",
1313
"gatsby-plugin-react-helmet": "^3.0.12",

examples/gatsby-starter-default-intl/yarn.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4644,15 +4644,14 @@ gatsby-link@^2.1.1:
46444644
"@types/reach__router" "^1.0.0"
46454645
prop-types "^15.6.1"
46464646

4647-
gatsby-plugin-intl@^0.2.1:
4648-
version "0.2.1"
4649-
resolved "https://registry.yarnpkg.com/gatsby-plugin-intl/-/gatsby-plugin-intl-0.2.1.tgz#6c6e42acd76458119534ff141be123e40b383ecf"
4650-
integrity sha512-kXhE7FFemrjXCIk8Uc1dcnFzXU50zP0CnLVT0x5WgWRGy3nBCEdri4vfnwcqFeK23RRvhPuJ0/FspvnXehNLjA==
4647+
gatsby-plugin-intl@^0.2.4:
4648+
version "0.2.4"
4649+
resolved "https://registry.yarnpkg.com/gatsby-plugin-intl/-/gatsby-plugin-intl-0.2.4.tgz#6e86c3df9ee39c1e49d931a70843bcc730b6333f"
4650+
integrity sha512-+K+y8p92RzSZ8dl0bT5LpUrkPknUQj7l6cc1Y/cGqr0t7Vs616xbgV0/NKabcfd4EnN0tbIp1iIlPWvCujm2Kg==
46514651
dependencies:
46524652
"@babel/runtime" "^7.4.5"
46534653
browser-lang "^0.1.0"
46544654
intl "^1.2.5"
4655-
react "^16.8.6"
46564655
react-intl "^2.9.0"
46574656

46584657
gatsby-plugin-manifest@^2.1.1:
@@ -4782,7 +4781,7 @@ gatsby-transformer-sharp@^2.1.21:
47824781
semver "^5.6.0"
47834782
sharp "^0.22.1"
47844783

4785-
gatsby@^2.8.4:
4784+
gatsby@2.8.4:
47864785
version "2.8.4"
47874786
resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-2.8.4.tgz#485e45e938c5ddd21b8439bbb7946d225b76b6cf"
47884787
integrity sha512-vy4MLOl1JfZ1XCttOznHpZW9tMOquRzsNGsXB2JO/2cCTIeoACb0PiiqTpoNvBteNTizCzxRFmsWsZXJj9d9rQ==

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gatsby-plugin-intl",
33
"description": "Gatsby plugin to add react-intl onto a site",
4-
"version": "0.2.1",
4+
"version": "0.2.4",
55
"author": "Daewoong Moon <wiziple@gmail.com>",
66
"bugs": {
77
"url": "https://github.com/wiziple/gatsby-plugin-intl"
@@ -10,14 +10,13 @@
1010
"@babel/runtime": "^7.4.5",
1111
"browser-lang": "^0.1.0",
1212
"intl": "^1.2.5",
13-
"react": "^16.8.6",
1413
"react-intl": "^2.9.0"
1514
},
1615
"devDependencies": {
1716
"@babel/cli": "^7.4.4",
1817
"@babel/core": "^7.4.5",
1918
"babel-preset-gatsby-package": "^0.1.4",
20-
"prettier": "^1.17.1",
19+
"prettier": "^1.18.2",
2120
"rimraf": "^2.6.3"
2221
},
2322
"homepage": "https://github.com/wiziple/gatsby-plugin-intl",

src/wrap-page.js

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,30 @@ export default ({ element, props }) => {
5050
const { intl } = props.pageContext
5151
const { language, languages, messages, redirect, routed } = intl
5252

53+
/* eslint-disable no-undef */
5354
const isRedirect = redirect && !routed
5455

55-
if (isRedirect && typeof window !== "undefined") {
56-
let detected =
57-
window.localStorage.getItem("gatsby-intl-language") ||
58-
browserLang({
59-
languages,
60-
fallback: language,
61-
})
56+
if (isRedirect) {
57+
const { pathname, search } = props.location
6258

63-
if (!languages.includes(detected)) {
64-
detected = language
59+
// Skip build, Browsers only
60+
if (typeof window !== "undefined") {
61+
let detected =
62+
window.localStorage.getItem("gatsby-intl-language") ||
63+
browserLang({
64+
languages,
65+
fallback: language,
66+
})
67+
68+
if (!languages.includes(detected)) {
69+
detected = language
70+
}
71+
72+
const queryParams = search || ""
73+
const newUrl = withPrefix(`/${detected}${pathname}${queryParams}`)
74+
window.localStorage.setItem("gatsby-intl-language", detected)
75+
window.location.replace(newUrl)
6576
}
66-
const { pathname, search } = props.location
67-
const queryParams = search || ""
68-
const newUrl = withPrefix(`/${detected}${pathname}${queryParams}`)
69-
window.localStorage.setItem("gatsby-intl-language", detected)
70-
window.location.replace(newUrl)
7177
}
7278

7379
if (typeof window !== "undefined") {

yarn.lock

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ lodash@^4.17.10, lodash@^4.17.11:
16271627
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
16281628
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
16291629

1630-
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
1630+
loose-envify@^1.0.0:
16311631
version "1.4.0"
16321632
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
16331633
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -1824,7 +1824,7 @@ number-is-nan@^1.0.0:
18241824
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
18251825
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
18261826

1827-
object-assign@^4.1.0, object-assign@^4.1.1:
1827+
object-assign@^4.1.0:
18281828
version "4.1.1"
18291829
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
18301830
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
@@ -1911,10 +1911,10 @@ posix-character-classes@^0.1.0:
19111911
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
19121912
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=
19131913

1914-
prettier@^1.17.1:
1915-
version "1.17.1"
1916-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db"
1917-
integrity sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==
1914+
prettier@^1.18.2:
1915+
version "1.18.2"
1916+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
1917+
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
19181918

19191919
private@^0.1.6:
19201920
version "0.1.8"
@@ -1926,15 +1926,6 @@ process-nextick-args@~2.0.0:
19261926
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
19271927
integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
19281928

1929-
prop-types@^15.6.2:
1930-
version "15.7.2"
1931-
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
1932-
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
1933-
dependencies:
1934-
loose-envify "^1.4.0"
1935-
object-assign "^4.1.1"
1936-
react-is "^16.8.1"
1937-
19381929
rc@^1.2.7:
19391930
version "1.2.8"
19401931
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
@@ -1956,21 +1947,11 @@ react-intl@^2.9.0:
19561947
intl-relativeformat "^2.1.0"
19571948
invariant "^2.1.1"
19581949

1959-
react-is@^16.7.0, react-is@^16.8.1:
1950+
react-is@^16.7.0:
19601951
version "16.8.6"
19611952
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
19621953
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
19631954

1964-
react@^16.8.6:
1965-
version "16.8.6"
1966-
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
1967-
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
1968-
dependencies:
1969-
loose-envify "^1.1.0"
1970-
object-assign "^4.1.1"
1971-
prop-types "^15.6.2"
1972-
scheduler "^0.13.6"
1973-
19741955
readable-stream@^2.0.2, readable-stream@^2.0.6:
19751956
version "2.3.6"
19761957
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
@@ -2115,14 +2096,6 @@ sax@^1.2.4:
21152096
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
21162097
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
21172098

2118-
scheduler@^0.13.6:
2119-
version "0.13.6"
2120-
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
2121-
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
2122-
dependencies:
2123-
loose-envify "^1.1.0"
2124-
object-assign "^4.1.1"
2125-
21262099
semver@^5.3.0, semver@^5.4.1, semver@^5.5.1, semver@^5.6.0:
21272100
version "5.7.0"
21282101
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"

0 commit comments

Comments
 (0)