Showing with 1,412 additions and 2,046 deletions.
  1. +2 −0 .github/workflows/linux-arm64.yml
  2. +2 −0 .github/workflows/linux-x64.yml
  3. +7 −2 README.md
  4. +6 −1 main-src/preload/default.js → config-overrides.js
  5. +12 −0 dist.js
  6. +0 −3 main-src/electron.js
  7. +0 −2 main-src/preload/menubar.js
  8. +0 −18 main-src/preload/shared.js
  9. +11 −10 package.json
  10. +94 −1 public/open-source-notices.txt
  11. +7 −20 src/components/app-wrapper.js
  12. +159 −204 src/components/app.js
  13. +109 −153 src/components/pages/history/index.js
  14. +20 −44 src/components/pages/history/search-box.js
  15. +15 −43 src/components/pages/home/dictionary.js
  16. +70 −113 src/components/pages/home/history.js
  17. +64 −141 src/components/pages/home/index.js
  18. +20 −38 src/components/pages/home/rating-card.js
  19. +54 −86 src/components/pages/language-list/index.js
  20. +18 −49 src/components/pages/language-list/list.js
  21. +19 −42 src/components/pages/language-list/search-box.js
  22. +201 −259 src/components/pages/ocr/index.js
  23. +98 −142 src/components/pages/phrasebook/index.js
  24. +20 −44 src/components/pages/phrasebook/search-box.js
  25. +66 −100 src/components/pages/preferences/dialog-shortcut.js
  26. +32 −78 src/components/pages/preferences/index.js
  27. +83 −96 src/components/pages/preferences/list-item-sliders.js
  28. +25 −42 src/components/root/alert.js
  29. +15 −37 src/components/root/dialog-about.js
  30. +12 −32 src/components/root/dialog-open-source-notices.js
  31. +18 −21 src/components/shared/enhanced-dialog-title.js
  32. +40 −77 src/components/shared/enhanced-menu.js
  33. +14 −23 src/components/shared/windows-title-bar.js
  34. +0 −28 src/helpers/connect-component.js
  35. +2 −1 src/helpers/open-file-to-blob-async.js
  36. +15 −8 src/helpers/take-screenshot-to-blob-async.js
  37. +3 −0 src/index.js
  38. +25 −22 src/listeners/index.js
  39. +18 −16 src/senders/index.js
  40. +0 −2 src/state/reducers.js
  41. +2 −1 src/state/root/general/reducers.js
  42. +0 −9 src/state/root/screen/actions.js
  43. +0 −19 src/state/root/screen/reducers.js
  44. +1 −2 webpack.config.js
  45. +33 −17 yarn.lock
2 changes: 2 additions & 0 deletions .github/workflows/linux-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ jobs:
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_OCR_SPACE_API_KEY: ${{ secrets.REACT_APP_OCR_SPACE_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: startsWith(github.ref, 'refs/tags/')
2 changes: 2 additions & 0 deletions .github/workflows/linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ jobs:
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_OCR_SPACE_API_KEY: ${{ secrets.REACT_APP_OCR_SPACE_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: startsWith(github.ref, 'refs/tags/')
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Translatium [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](LICENSE)

## Archived
This repository is archived. To help us better improve the product and protect our intellectual assets, Translatium's development has been moved to a **closed source** universal code base that runs across macOS, Windows, Linux, Android, iOS and iPadOS.

## Introduction

|macOS|Linux|Windows|
|---|---|---|
|[![GitHub Actions Build Status](https://github.com/quanglam2807/translatium/workflows/macOS/badge.svg)](https://github.com/quanglam2807/translatium/actions)|[![GitHub Actions Build Status](https://github.com/quanglam2807/translatium/workflows/Linux/badge.svg)](https://github.com/quanglam2807/translatium/actions)|[![GitHub Actions Build Status](https://github.com/quanglam2807/translatium/workflows/Windows/badge.svg)](https://github.com/quanglam2807/translatium/actions)|

**[Translatium](https://webcatalog.io/translatium/)** - Translate Any Languages like a Pro.
The legacy code of **[Translatium](https://webcatalog.io/translatium/)** for desktop (version 20 and earlier).

**master** branch only includes the source code of Translatium 9 & up. For older versions, check out the **legacy-** branches.
**master** branch only includes the source code of Translatium 9+. For older versions, check out the **legacy-** branches.

---
## Development
Expand Down
7 changes: 6 additions & 1 deletion main-src/preload/default.js → config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/* 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/. */
require('./shared');

/* eslint-disable no-param-reassign */
module.exports = (config) => {
config.target = 'electron-renderer';
return config;
};
12 changes: 12 additions & 0 deletions dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ const opts = {
'github',
],
},
appImage: {
publish: [
{
provider: 's3',
channel: 'latest',
bucket: 'cdn-2.webcatalog.io',
region: 'us-east-2',
path: '/translatium',
},
'github',
],
},
afterPack: (context) => Promise.resolve()
.then(() => new Promise((resolve, reject) => {
const { appOutDir } = context;
Expand Down
3 changes: 0 additions & 3 deletions main-src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,6 @@ if (!gotTheLock) {
nodeIntegration: true,
contextIsolation: false,
webSecurity: false,
preload: process.env.NODE_ENV === 'production'
? path.join(__dirname, 'preload-default.js')
: path.join(__dirname, 'preload', 'default.js'),
},
};

Expand Down
2 changes: 0 additions & 2 deletions main-src/preload/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
* 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/. */
window.mode = 'menubar';

require('./shared');
18 changes: 0 additions & 18 deletions main-src/preload/shared.js

This file was deleted.

21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "translatium",
"productName": "Translatium",
"description": "Translate 100+ Languages Instantly",
"version": "20.4.0",
"version": "20.5.0",
"main": "main-src/electron.js",
"repository": "https://github.com/webcatalog/translatium",
"repository": "https://github.com/webcatalog/translatium-desktop",
"author": {
"name": "WebCatalog Ltd",
"email": "contact@webcatalog.io"
Expand All @@ -16,12 +16,12 @@
"scripts": {
"postinstall": "npx patch-package && yarn generate-open-source-notices",
"generate-open-source-notices": "yarn licenses generate-disclaimer > public/open-source-notices.txt",
"start": "cross-env BROWSER=none react-scripts start",
"start": "cross-env BROWSER=none react-app-rewired start",
"electron-dev": "concurrently \"yarn start\" \"wait-on http://localhost:3000 && electron .\" -k",
"build": "react-scripts build && webpack",
"build": "react-app-rewired build && webpack",
"webpack": "webpack",
"test-ui": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"test-ui": "react-app-rewired test --env=jsdom",
"eject": "react-app-rewired eject",
"dist": "yarn run build && babel-node dist.js",
"dist-dev": "cross-env FORCE_DEV=1 yarn dist",
"lint": "eslint ./src ./main-src ./*.js ./test --ext js",
Expand All @@ -31,7 +31,7 @@
"node-mac-permissions": "2.2.0"
},
"devDependencies": {
"@electron/remote": "2.0.5",
"@electron/remote": "2.0.8",
"@fontsource/roboto": "4.5.3",
"@material-ui/core": "4.12.3",
"@material-ui/icons": "4.11.2",
Expand All @@ -48,7 +48,7 @@
"cross-env": "7.0.3",
"del": "6.0.0",
"dotenv": "10.0.0",
"electron": "16.0.9",
"electron": "16.1.0",
"electron-builder": "22.14.13",
"electron-is-dev": "2.0.0",
"electron-settings": "4.0.2",
Expand All @@ -59,9 +59,9 @@
"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "1.7.0",
"fs-extra": "10.0.0",
"fs-extra": "10.0.1",
"glob": "7.2.0",
"lunr": "2.3.9",
"lunr-languages": "1.9.0",
Expand All @@ -72,6 +72,7 @@
"pouchdb-quick-search": "1.3.0",
"prop-types": "15.8.1",
"react": "16.14.0",
"react-app-rewired": "2.2.1",
"react-dom": "16.14.0",
"react-redux": "7.2.6",
"react-scripts": "3.4.4",
Expand Down
95 changes: 94 additions & 1 deletion public/open-source-notices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,31 @@ SOFTWARE.

-----

The following software may be included in this product: @electron/remote. A copy of the source code may be downloaded from https://github.com/electron/remote. This software contains the following license and notice below:

Copyright (c) 2019-2022 Electron contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----

The following software may be included in this product: @emotion/hash. A copy of the source code may be downloaded from https://github.com/emotion-js/emotion/tree/master/packages/hash. This software contains the following license and notice below:

MIT License
Expand All @@ -588,6 +613,20 @@ SOFTWARE.

-----

The following software may be included in this product: @gar/promisify. A copy of the source code may be downloaded from https://github.com/wraithgar/gar-promisify.git. This software contains the following license and notice below:

The MIT License (MIT)

Copyright © 2020-2022 Michael Garvin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----

The following software may be included in this product: @hapi/address. A copy of the source code may be downloaded from git://github.com/hapijs/address. This software contains the following license and notice below:

Copyright (c) 2019, Project contributors
Expand Down Expand Up @@ -4988,7 +5027,7 @@ SOFTWARE.
The following software may be included in this product: boolean. A copy of the source code may be downloaded from git://github.com/thenativeweb/boolean.git. This software contains the following license and notice below:

The MIT License (MIT)
Copyright (c) 2014-2021 the native web.
Copyright (c) 2014-2022 the native web.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down Expand Up @@ -15316,6 +15355,34 @@ THE SOFTWARE.

-----

The following software may be included in this product: mime-db. A copy of the source code may be downloaded from https://github.com/jshttp/mime-db.git. This software contains the following license and notice below:

(The MIT License)

Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----

The following software may be included in this product: minimalistic-assert. A copy of the source code may be downloaded from https://github.com/calvinmetcalf/minimalistic-assert.git. This software contains the following license and notice below:

Copyright 2015 Calvin Metcalf
Expand Down Expand Up @@ -18312,6 +18379,32 @@ limitations under the License.

-----

The following software may be included in this product: react-app-rewired. A copy of the source code may be downloaded from git+https://github.com/timarney/react-app-rewired. This software contains the following license and notice below:

MIT License

Copyright (c) 2016 Tim Arney

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

-----

The following software may be included in this product: react-redux, redux, redux-thunk. A copy of the source code may be downloaded from https://github.com/reduxjs/react-redux.git (react-redux), https://github.com/reduxjs/redux.git (redux), https://github.com/reduxjs/redux-thunk.git (redux-thunk). This software contains the following license and notice below:

The MIT License (MIT)
Expand Down
27 changes: 7 additions & 20 deletions src/components/app-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
* 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 React from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';

import { ThemeProvider as MuiThemeProvider, createMuiTheme, withStyles } from '@material-ui/core/styles';
import { ThemeProvider as MuiThemeProvider, createTheme, withStyles } from '@material-ui/core/styles';
import pink from '@material-ui/core/colors/blue';
import red from '@material-ui/core/colors/pink';
import grey from '@material-ui/core/colors/grey';
import green from '@material-ui/core/colors/green';

import connectComponent from '../helpers/connect-component';

import App from './app';

const GlobalCss = withStyles({
Expand All @@ -33,7 +31,9 @@ const GlobalCss = withStyles({
},
})(() => null);

const AppWrapper = ({ shouldUseDarkColors }) => {
const AppWrapper = () => {
const shouldUseDarkColors = useSelector((state) => state.general.shouldUseDarkColors);

const themeObj = {
typography: {
fontSize: 13.5,
Expand Down Expand Up @@ -64,7 +64,7 @@ const AppWrapper = ({ shouldUseDarkColors }) => {
};
}

const theme = createMuiTheme(themeObj);
const theme = createTheme(themeObj);

return (
<MuiThemeProvider theme={theme}>
Expand All @@ -74,17 +74,4 @@ const AppWrapper = ({ shouldUseDarkColors }) => {
);
};

AppWrapper.propTypes = {
shouldUseDarkColors: PropTypes.bool.isRequired,
};

const mapStateToProps = (state) => ({
shouldUseDarkColors: state.general.shouldUseDarkColors,
});

export default connectComponent(
AppWrapper,
mapStateToProps,
null,
null,
);
export default AppWrapper;