Skip to content

Commit

Permalink
[docs] change interpolation library (#14481)
Browse files Browse the repository at this point in the history
The replacement uses handlebars syntax `{{var}}` instead of `%(var)s`, which was causing confusion for translators.
  • Loading branch information
mbrookes authored Feb 10, 2019
1 parent 46f1c8b commit 1445828
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ module.exports = [
name: 'The docs home page',
webpack: false,
path: `.next/static/${buildId}/pages/index.js`,
limit: '9.1 KB',
limit: '9.8 KB',
},
];
4 changes: 2 additions & 2 deletions docs/src/modules/components/HomeFooter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Interpolate from 'react-interpolate-component';
import Interpolate from '@trendmicro/react-interpolate';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Grid from '@material-ui/core/Grid';
Expand Down Expand Up @@ -86,7 +86,7 @@ function HomeFooter(props) {
</Typography>
<Typography className={classes.version}>
<Interpolate
with={{
replacement={{
versionNumber: `v${process.env.LIB_VERSION}`,
license: (
<Link color="inherit" href="https://github.com/mui-org/material-ui/blob/next/LICENSE">
Expand Down
2 changes: 1 addition & 1 deletion docs/translations/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"icons": "Icons",
"color": "Color",
"team": " Team",
"homeFooterRelease": "Currently %(versionNumber)s. Released under the %(license)s.",
"homeFooterRelease": "Currently {{versionNumber}}. Released under the {{license}}.",
"license": "MIT License",
"likeMui": "Like Material-UI?",
"adblock": "If you don't mind tech-related ads, and want to support Open Source, please whitelist Material-UI in your ad blocker.",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@date-io/date-fns": "^1.0.0",
"@emotion/core": "^10.0.0",
"@emotion/styled": "^10.0.0",
"@trendmicro/react-interpolate": "0.5.5",
"@types/enzyme": "^3.1.4",
"@types/react": "^16.7.10",
"@types/react-dom": "^16.0.9",
Expand Down Expand Up @@ -158,7 +159,6 @@
"react-final-form": "^4.0.2",
"react-frame-component": "^4.0.2",
"react-inspector": "^2.2.2",
"react-interpolate-component": "0.12.0",
"react-jss": "^8.6.1",
"react-number-format": "^4.0.0",
"react-redux": "^6.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/.size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"build/umd/material-ui.production.min.js": {
"bundled": 880073,
"minified": 327302,
"gzipped": 86445
"bundled": 867743,
"minified": 322841,
"gzipped": 85287
}
}
41 changes: 14 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,14 @@
array-from "^2.1.1"
lodash.get "^4.4.2"

"@trendmicro/react-interpolate@0.5.5":
version "0.5.5"
resolved "https://registry.yarnpkg.com/@trendmicro/react-interpolate/-/react-interpolate-0.5.5.tgz#70a5040524b46475ee0104939f371db201886a0d"
integrity sha512-PjkRT3XeK30kGjmSRn//4L106ekZfFkjqQ85G8K1hDdT7aYdng0Hz1MSLJjW9XNiljdTNB8D8Sm4tiBhdz5P3A==
dependencies:
lodash.omit "^4.5.0"
prop-types "^15.5.8"

"@types/cheerio@*":
version "0.22.10"
resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.10.tgz#780d552467824be4a241b29510a7873a7432c4a6"
Expand Down Expand Up @@ -4847,15 +4855,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

create-react-class@^15.5.2:
version "15.6.3"
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036"
integrity sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==
dependencies:
fbjs "^0.8.9"
loose-envify "^1.3.1"
object-assign "^4.1.1"

cross-env@^5.1.1:
version "5.2.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
Expand Down Expand Up @@ -6334,13 +6333,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
md5.js "^1.3.4"
safe-buffer "^5.1.1"

except@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/except/-/except-0.1.3.tgz#98261c91958551536b44482238e9783fb73d292a"
integrity sha1-mCYckZWFUVNrREgiOOl4P7c9KSo=
dependencies:
indexof "0.0.1"

execa@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50"
Expand Down Expand Up @@ -6574,7 +6566,7 @@ fastparse@^1.1.1:
resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9"
integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==

fbjs@^0.8.4, fbjs@^0.8.9:
fbjs@^0.8.4:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
Expand Down Expand Up @@ -9056,6 +9048,11 @@ lodash.merge@^4.6.0:
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54"
integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==

lodash.omit@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60"
integrity sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=

lodash.set@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
Expand Down Expand Up @@ -11628,16 +11625,6 @@ react-inspector@^2.2.2:
is-dom "^1.0.9"
prop-types "^15.6.1"

react-interpolate-component@0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/react-interpolate-component/-/react-interpolate-component-0.12.0.tgz#8ab3d6f8867162f551c43ced1857c034a90f909b"
integrity sha512-rVBZweihUTBvgN4bJqt+vD5uDrIb8a22K+vXml7RlJq/ahsvkYdhGgdnH1AQaAnpu6HOPNgrGCgvOnl2ci0n5Q==
dependencies:
create-react-class "^15.5.2"
except "^0.1.3"
invariant "^2.2.2"
object-assign "^4.1.1"

react-is@^16.5.2, react-is@^16.6.0, react-is@^16.6.3, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1:
version "16.8.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.1.tgz#a80141e246eb894824fb4f2901c0c50ef31d4cdb"
Expand Down

0 comments on commit 1445828

Please sign in to comment.