This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c47a5e
commit 3408a69
Showing
18 changed files
with
317 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
"repository": "https://github.com/translatium/translatium", | ||
"author": { | ||
"name": "Quang Lam", | ||
"email": "quang.[email protected]" | ||
"email": "quang.[email protected]" | ||
}, | ||
"license": "MPL-2.0", | ||
"engines": { | ||
|
@@ -20,7 +20,7 @@ | |
"test-ui": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject", | ||
"dist": "yarn run build && babel-node dist.js", | ||
"dist:no-sign": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false yarn dist", | ||
"dist-dev": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false yarn dist", | ||
"lint": "eslint ./src ./public ./*.js ./test --ext js", | ||
"test": "mocha" | ||
}, | ||
|
@@ -34,11 +34,13 @@ | |
"fs-extra": "9.0.1", | ||
"menubar": "8.0.2", | ||
"node-fetch": "2.6.1", | ||
"node-mac-permissions": "2.2.0" | ||
"node-mac-permissions": "2.2.0", | ||
"node-machine-id": "1.1.12" | ||
}, | ||
"devDependencies": { | ||
"@material-ui/core": "4.11.0", | ||
"@material-ui/icons": "4.9.1", | ||
"amplitude-js": "7.3.3", | ||
"babel-cli": "6.26.0", | ||
"babel-preset-env": "1.7.0", | ||
"babel-preset-react": "6.24.1", | ||
|
@@ -49,7 +51,7 @@ | |
"cross-env": "7.0.2", | ||
"del": "5.1.0", | ||
"dotenv": "8.2.0", | ||
"electron": "8.5.3", | ||
"electron": "8.5.4", | ||
"electron-builder": "22.9.1", | ||
"electron-notarize": "1.0.0", | ||
"eslint": "6.8.0", | ||
|
@@ -74,6 +76,7 @@ | |
"react-scripts": "3.4.4", | ||
"redux": "4.0.5", | ||
"redux-thunk": "2.3.0", | ||
"uuid": "8.3.1", | ||
"wait-on": "5.2.0" | ||
}, | ||
"homepage": "./", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' data: gap: https://translate.google.com https://translate.googleapis.com http://clients1.google.com http://clients2.google.com http://clients3.google.com http://clients4.google.com http://clients5.google.com https://api.ocr.space 'unsafe-eval' ws: ms-appx: filesystem blob:; style-src 'self' 'unsafe-inline'; media-src blob:; img-src 'self' data: content: blob:;"> | ||
<meta name="format-detection" content="telephone=no"> | ||
<meta name="msapplication-tap-highlight" content="no"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="format-detection" content="telephone=no"> | ||
<meta name="msapplication-tap-highlight" content="no"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | ||
<title>Translatium</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
<title>Translatium</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import amplitude from 'amplitude-js'; | ||
import { v5 as uuidv5 } from 'uuid'; | ||
|
||
amplitude.getInstance().init(process.env.REACT_APP_AMPLITUDE_API_KEY); | ||
amplitude.getInstance().setVersionName(window.remote.app.getVersion()); | ||
|
||
// custom device id based on WebCatalog code | ||
// to have some control over device id | ||
if (window.machineId) { | ||
// unique namespace for translatium | ||
const DEVICE_ID_NAMESPACE = '0a641322-b40e-4a51-aa9f-3c16e91f4db2'; | ||
const deviceId = uuidv5(window.machineId, DEVICE_ID_NAMESPACE); | ||
amplitude.getInstance().setDeviceId(deviceId); | ||
} | ||
|
||
export default amplitude; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import { useEffect } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import connectComponent from '../../helpers/connect-component'; | ||
|
||
import amplitude from '../../amplitude'; | ||
|
||
const TelemetryManager = ({ displayLanguage }) => { | ||
useEffect(() => { | ||
amplitude.getInstance().setUserProperties({ | ||
displayLanguage, | ||
}); | ||
}, [displayLanguage]); | ||
|
||
// run after setUserProperties | ||
// https://blog.logrocket.com/post-hooks-guide-react-call-order | ||
useEffect(() => { | ||
amplitude.getInstance().logEvent('start app'); | ||
}, []); | ||
|
||
return null; | ||
}; | ||
|
||
TelemetryManager.propTypes = { | ||
displayLanguage: PropTypes.string.isRequired, | ||
}; | ||
|
||
const mapStateToProps = (state) => ({ | ||
displayLanguage: state.preferences.displayLanguage, | ||
}); | ||
|
||
export default connectComponent( | ||
TelemetryManager, | ||
mapStateToProps, | ||
null, | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.