mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 00:58:14 -05:00
Merge pull request #3664 from LLK/develop
Update release branch to include develop
This commit is contained in:
commit
f9b85c7884
6 changed files with 36 additions and 18 deletions
17
.travis.yml
17
.travis.yml
|
@ -135,13 +135,12 @@ jobs:
|
|||
- master
|
||||
- stage: smoke
|
||||
script: npm run test:integration:remote
|
||||
stages:
|
||||
- test
|
||||
- name: smoke
|
||||
if: type != pull_request
|
||||
- provider: script
|
||||
on:
|
||||
branch: develop
|
||||
condition: $TRAVIS_EVENT_TYPE == cron
|
||||
skip_cleanup: true
|
||||
- stage: update translations
|
||||
script: npm run i18n:push
|
||||
stages:
|
||||
- name: test
|
||||
if: type != cron
|
||||
- name: smoke
|
||||
if: type NOT IN (cron, pull_request)
|
||||
- name: update translations
|
||||
if: branch == develop AND type == cron
|
||||
|
|
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -15756,15 +15756,15 @@
|
|||
}
|
||||
},
|
||||
"scratch-gui": {
|
||||
"version": "0.1.0-prerelease.20200127164821",
|
||||
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20200127164821.tgz",
|
||||
"integrity": "sha512-LyNzqx6wLxINFo74kcLtDumKV5MxsOQiqHSywEFESciUbScktCDp0UrYk7eu9b8A8/e3gUa/v4RM5Aqf5WPH7Q==",
|
||||
"version": "0.1.0-prerelease.20200129184440",
|
||||
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20200129184440.tgz",
|
||||
"integrity": "sha512-92BXenpNk6C87NNFfBbhdpJ08HFwUD3ySXtx31sGH+uTeyOs2s8Uzk7VsKqL0OiS0keAFtjzmFmF+rfMUQolVg==",
|
||||
"dev": true
|
||||
},
|
||||
"scratch-l10n": {
|
||||
"version": "3.7.20200121224403",
|
||||
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.7.20200121224403.tgz",
|
||||
"integrity": "sha512-IAg8e5GtD6dduQaV2CRkA4qXGxYQn62IzBBOSTukS4UqphfotsAAg9Qkykg+KbuCxET+v7ZEBu27yNjyG2p+ew==",
|
||||
"version": "3.7.20200128224436",
|
||||
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.7.20200128224436.tgz",
|
||||
"integrity": "sha512-ha/bTXYz8ke33leQRlraUB3n9qHneldoGdw66AN/Yho6b3uhq6qz89zditiTSv7LiGDIYpuXzBCEuiRDImK9DA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/cli": "^7.1.2",
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"deploy:s3:all": "npm run deploy:s3cmd -- --exclude '.DS_Store' --exclude '*.svg' --exclude '*.js' ./build/ s3://$S3_BUCKET_NAME/",
|
||||
"deploy:s3:svg": "npm run deploy:s3cmd -- --exclude '*' --include '*.svg' --mime-type 'image/svg+xml' ./build/ s3://$S3_BUCKET_NAME/",
|
||||
"deploy:s3:js": "npm run deploy:s3cmd -- --exclude '*' --include '*.js' --mime-type 'application/javascript' ./build/ s3://$S3_BUCKET_NAME/",
|
||||
"i18n:push": "tx-push-www --execute",
|
||||
"i18n:push": "./bin/tx-push-www --execute",
|
||||
"translate:urls": "node ./bin/get-localized-urls localized-urls.json",
|
||||
"translate:files": "node ./bin/build-locales node_modules/scratch-l10n/www intl",
|
||||
"translate": "npm run translate:urls && npm run translate:files"
|
||||
|
@ -128,7 +128,7 @@
|
|||
"redux-mock-store": "^1.2.3",
|
||||
"redux-thunk": "2.0.1",
|
||||
"sass-loader": "6.0.6",
|
||||
"scratch-gui": "0.1.0-prerelease.20200127164821",
|
||||
"scratch-gui": "0.1.0-prerelease.20200129184440",
|
||||
"scratch-l10n": "latest",
|
||||
"selenium-webdriver": "3.6.0",
|
||||
"slick-carousel": "1.6.0",
|
||||
|
|
|
@ -21,7 +21,11 @@ class LanguageChooser extends React.Component {
|
|||
]);
|
||||
}
|
||||
handleSetLanguage (name, value) {
|
||||
jar.set('scratchlanguage', value);
|
||||
let opts = {};
|
||||
if (window.location.hostname !== 'localhost') {
|
||||
opts = {domain: `.${window.location.hostname}`};
|
||||
}
|
||||
jar.set('scratchlanguage', value, opts);
|
||||
window.location.reload();
|
||||
}
|
||||
render () {
|
||||
|
|
11
src/init.js
11
src/init.js
|
@ -18,6 +18,17 @@ const jar = require('./lib/jar');
|
|||
if (['pt', 'pt-pt', 'PT', 'PT-PT'].indexOf(obj) !== -1) {
|
||||
obj = 'pt-br'; // default Portuguese users to Brazilian Portuguese due to our user base. Added in 2.2.5.
|
||||
}
|
||||
} else {
|
||||
// delete the old cookie (just hostname) by setting it to null and expiring in the past
|
||||
/* eslint-disable max-len */
|
||||
document.cookie = `scratchlanguage=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`;
|
||||
/* eslint-enable max-len */
|
||||
// create the new cookie
|
||||
let opts = {};
|
||||
if (window.location.hostname !== 'localhost') {
|
||||
opts = {domain: `.${window.location.hostname}`};
|
||||
}
|
||||
jar.set('scratchlanguage', obj, opts);
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
|
|
@ -626,7 +626,11 @@ class Preview extends React.Component {
|
|||
);
|
||||
}
|
||||
handleSetLanguage (locale) {
|
||||
jar.set('scratchlanguage', locale);
|
||||
let opts = {};
|
||||
if (window.location.hostname !== 'localhost') {
|
||||
opts = {domain: `.${window.location.hostname}`};
|
||||
}
|
||||
jar.set('scratchlanguage', locale, opts);
|
||||
}
|
||||
handleUpdateProjectId (projectId, callback) {
|
||||
this.setState({projectId: projectId}, () => {
|
||||
|
|
Loading…
Reference in a new issue