Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Decouple the app from Atomery and make it free (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
quanglam2807 authored Sep 28, 2020
1 parent 548ad55 commit 1584856
Show file tree
Hide file tree
Showing 74 changed files with 884 additions and 621 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/_sass/bulma"]
path = docs/_sass/bulma
url = https://github.com/jgthms/bulma.git
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,17 @@

|macOS|Linux|Windows|
|---|---|---|
|[![GitHub Actions Build Status](https://github.com/atomery/translatium/workflows/macOS/badge.svg)](https://github.com/atomery/translatium/actions)|[![GitHub Actions Build Status](https://github.com/atomery/translatium/workflows/Linux/badge.svg)](https://github.com/atomery/translatium/actions)|[![GitHub Actions Build Status](https://github.com/atomery/translatium/workflows/Windows/badge.svg)](https://github.com/atomery/translatium/actions)|
|[![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://atomery.com/translatium)** - Translate Any Languages like a Pro.
**[Translatium](https://translatiumapp.com)** - Translate Any Languages like a Pro.

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

---
## Licensing
### Usage
**Translatium is paid software.** [Pay just $9.99](https://webcatalog.onfastspring.com/translatium) to unlock the app perpetually.

The license:
- Has no time limit and never expires.
- Works with all versions (including major updates).
- Permits uses on all of the devices you own (regardless of platforms or operating systems).

### Source Code
On the other hand, **the source code is freely available** for use, modification and distribution under the permissions, limitations and conditions listed in the [Mozilla Public License 2.0](LICENSE).

---
## Development
```
# First, clone the project:
git clone https://github.com/atomery/translatium.git
git clone https://github.com/quanglam2807/translatium.git
cd translatium
# set API keys
Expand Down
2 changes: 1 addition & 1 deletion description-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Object.keys(displayLanguages).forEach((langCode) => {
const desc = rawDesc
.replace(/{appName}/g, 'Translatium')
.replace(/{operatingSystem}/g, operatingSystem)
.replace(/{appUrl}/g, 'https://atomery.com/translatium')
.replace(/{appUrl}/g, 'https://translatiumapp.com')
.replace(/{supportedLanguages}/g, supportedLanguages.join(langCode === 'zh-CN' ? ',' : ', '));
const distDescFilePath = path.join(__dirname, 'dist', 'description', langCode, `${operatingSystem}.txt`);
fs.outputFileSync(distDescFilePath, desc, 'utf8');
Expand Down
7 changes: 6 additions & 1 deletion dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ switch (process.platform) {
break;
}
case 'win32': {
targets = Platform.WINDOWS.createTarget(['nsis']);
targets = Platform.WINDOWS.createTarget(['appx', 'nsis']);
break;
}
default:
Expand Down Expand Up @@ -79,6 +79,11 @@ const opts = {
name: 'Translatium',
schemes: ['translatium'],
},
appx: {
applicationId: 'translatium',
identityName: '55974nhutquang97.5translate',
publisher: 'CN=C635F506-DEEB-41A4-8CAA-16689F486ED2',
},
mac: {
darkModeSupport: true,
// https://github.com/electron/electron/issues/15958#issuecomment-447685065
Expand Down
9 changes: 9 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
_site
.sass-cache
.jekyll-metadata
.DS_Store
.jekyll-cache
node_modules
_catalog_apps/*
!_catalog_apps/gmail.md
.env
24 changes: 24 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: '404'
---

<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">

{% include head.html %}

<body>
<section class="hero is-success is-fullheight">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-1 is-spaced">
404 - Page Not Found
</h1>
<h2 class="subtitle">
<a href="/" class="is-text-link">Take me back to home page</a>
</h2>
</div>
</div>
</section>
</body>
</html>
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
translatiumapp.com
25 changes: 25 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.1.1"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'jekyll-sitemap'
gem 'jekyll-feed'
gem 'jekyll-paginate-v2'
84 changes: 84 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.7)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.13.1)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jekyll (4.1.1)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 1.8)
jekyll-feed (0.15.0)
jekyll (>= 3.7, < 5.0)
jekyll-paginate-v2 (3.0.0)
jekyll (>= 3.0, < 5.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.4)
rouge (3.22.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)

PLATFORMS
ruby

DEPENDENCIES
jekyll (~> 4.1.1)
jekyll-feed
jekyll-paginate-v2
jekyll-sitemap
minima (~> 2.0)
tzinfo-data

BUNDLED WITH
2.1.2
38 changes: 38 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.

# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Translatium
description: Translatium lets you translate words, phrases and images between over 100 languages with dictionary, transliteration and voice output support.
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://translatiumapp.com" # the base hostname & protocol for your site, e.g. http://example.com

translatium_version: 13.8.2

pagination:
enabled: true

markdown: kramdown
plugins:
- jekyll-sitemap
- jekyll-feed
- jekyll-paginate-v2

exclude:
- yarn.lock
- package.json
- scripts

include:
- _redirects
14 changes: 14 additions & 0 deletions docs/_includes/google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% if jekyll.environment == 'production' and site.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
</script>
<script>
window.ga('create', '{{ site.google_analytics }}', 'auto');
window.ga('require', 'linker');
window.ga('linker:autoLink', ['{{ site.fastspring_account_id }}.onfastspring.com','{{ site.fastspring_account_id }}.test.onfastspring.com']);
window.ga('send', 'pageview');
</script>
{% endif %}
28 changes: 28 additions & 0 deletions docs/_includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% assign page_description = site.description %}

{% if page.id != 'landing' %}
{% capture page_title %}{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}{% endcapture %}
{% else %}
{% capture page_title %}{% if page.title %}{{ page.title }}{% endif %}{% endcapture %}
{% endif %}

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

{% include social-meta.html %}

<title>{{ page_title | escape }}</title>
<link rel="stylesheet" href="{{ '/assets/main.css' | relative_url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
<link rel="shortcut icon" href="{{ '/images/favicon.png' | relative_url }}" type="image/png">
{% if paginator.previous_page %}
<link rel="prev" href="{{ paginator.previous_page_path | replace: 'index.html', '' | absolute_url }}" />
{% endif %}
{% if paginator.next_page %}
<link rel="next" href="{{ paginator.next_page_path | replace: 'index.html', '' | absolute_url }}" />
{% endif %}
<script src="{{ '/assets/app.min.js' | relative_url }}" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/js/all.min.js" defer></script>
</head>
13 changes: 13 additions & 0 deletions docs/_includes/social-meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<meta name="description" content="{{ page_description | strip_html | strip | escape }}">

<meta property="og:type" content="website">
<meta property="og:url" content="{{ page.url | replace:'index.html','' | absolute_url }}">
<meta property="og:title" content="{{ page_title | escape }}">
<meta property="og:description" content="{{ page_description | strip_html | strip | escape }}">
<meta property="og:image" content="{{ '/images/social-preview.png' | absolute_url }}">

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="{{ page.url | replace:'index.html','' | absolute_url }}">
<meta name="twitter:title" content="{{ page_title | escape }}">
<meta name="twitter:description" content="{{ page_description | strip_html | strip | escape }}">
<meta name="twitter:image" content="{{ '/images/social-preview.png' | absolute_url }}">
10 changes: 10 additions & 0 deletions docs/_layouts/compress.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Jekyll layout that compresses HTML
# v3.1.0
# http://jch.penibelst.de/
# © 2014–2015 Anatol Broder
# MIT License
---

{% capture _LINE_FEED %}
{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs == "all" %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "<!-- -->" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}{% unless _pre_before contains "</pre>" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %} <table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile"> <thead> <tr> <td>Step <td>Bytes <tbody> <tr> <td>raw <td>{{ content | size }}{% if _profile_endings %} <tr> <td>endings <td>{{ _profile_endings }}{% endif %}{% if _profile_startings %} <tr> <td>startings <td>{{ _profile_startings }}{% endif %}{% if _profile_comments %} <tr> <td>comments <td>{{ _profile_comments }}{% endif %}{% if _profile_collapse %} <tr> <td>collapse <td>{{ _profile_collapse }}{% endif %}{% if _profile_clippings %} <tr> <td>clippings <td>{{ _profile_clippings }}{% endif %} </table>{% endif %}{% endif %}
44 changes: 44 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
layout: compress
---
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">

{% include head.html %}

<body>
<nav class="bd-navbar navbar is-spaced navbar-2">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="/" title="Translatium">
<p class="is-size-4 has-text-weight-semibold mb-0">Translatium</p>
</a>
<span class="burger navbar-burger" data-target="navbarMenu2" aria-label="menu" aria-expanded="false">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</span>
</div>
<div id="navbarMenu2" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="https://github.com/quanglam2807/translatium/">
GitHub
</a>
<a class="navbar-item {% if page.id == 'support' %}has-text-weight-semibold{% endif %}" href="/support">
Support
</a>
</div>
</div>
</div>
</nav>
<main>
{{ content }}
</main>
<footer class="footer">
<div class="container has-text-centered">
<p>Made by <a href="https://github.com/quanglam2807">Quang Lam</a>.</p>
</div>
</footer>
{% include google-analytics.html %}
</body>
</html>
Loading

0 comments on commit 1584856

Please sign in to comment.