Skip to content

Commit

Permalink
updated README, travis
Browse files Browse the repository at this point in the history
  • Loading branch information
aibobrov committed Nov 12, 2018
1 parent 0076f06 commit 61f43a7
Show file tree
Hide file tree
Showing 15 changed files with 272 additions and 33 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: swift
osx_image: xcode10
xcode_project: TranslateBar.xcworkspace
xcode_scheme: TranslateBar
podfile: Podfile
cache:
- bundler
- cocoapods
before_install:
- bundle install
- bundle exec pod keys set YandexDictionaryKey $YANDEXAPITRANSLATEKEY TranslateBar
- bundle exec pod keys set YandexTranslateKey $YANDEXAPIDICTIONARYKEY TranslateBar
- pod update
- chmod +x ./install_swiftlint.sh
install:
- ./install_swiftlint.sh
script:
- swiftlint
- xcodebuild clean build -workspace TranslateBar.xcworkspace -scheme TranslateBar | xcpretty -c && exit ${PIPESTATUS[0]}
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'cocoapods'
gem 'cocoapods-keys'
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2018

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.
1 change: 0 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ target 'TranslateBar' do

pod 'RxSwift'
pod 'RxCocoa'
pod 'RxSwiftExt'
pod 'Moya/RxSwift'
pod 'KeyHolder'
pod 'ITSwitch'
Expand Down
25 changes: 11 additions & 14 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ PODS:
- KeyHolder (3.0.1):
- Magnet (~> 2.3)
- Keys (1.0.1)
- Magnet (2.3.0)
- Magnet (2.3.1)
- Moya/Core (11.0.2):
- Alamofire (~> 4.1)
- Result (~> 3.0)
- Moya/RxSwift (11.0.2):
- Moya/Core
- RxSwift (~> 4.0)
- Result (3.2.4)
- RxCocoa (4.3.1):
- RxSwift (~> 4.0)
- RxSwift (4.3.1)
- RxSwiftExt (3.3.0):
- RxSwiftExt/Core (= 3.3.0)
- RxSwiftExt/Core (3.3.0):
- RxAtomic (4.4.0)
- RxCocoa (4.4.0):
- RxSwift (~> 4.0)
- RxSwift (4.4.0):
- RxAtomic (~> 4.4)

DEPENDENCIES:
- ITSwitch
Expand All @@ -27,7 +25,6 @@ DEPENDENCIES:
- Moya/RxSwift
- RxCocoa
- RxSwift
- RxSwiftExt

SPEC REPOS:
https://github.com/cocoapods/specs.git:
Expand All @@ -37,9 +34,9 @@ SPEC REPOS:
- Magnet
- Moya
- Result
- RxAtomic
- RxCocoa
- RxSwift
- RxSwiftExt

EXTERNAL SOURCES:
Keys:
Expand All @@ -50,13 +47,13 @@ SPEC CHECKSUMS:
ITSwitch: 7ff745d6f2a6910e9194b23e4eab9a843258a478
KeyHolder: 142932db4eac7420b003e2eae94c9a61b8b53cb1
Keys: a576f4c9c1c641ca913a959a9c62ed3f215a8de9
Magnet: 85344b019d023e26062199aeb5b4ad1f8d41c5df
Magnet: f8dac2ffc845ffe68b2dd21c68a801f866f4a098
Moya: a725035953bc1c0eb1be505ab903984501d82440
Result: d2d07204ce72856f1fd9130bbe42c35a7b0fea10
RxCocoa: 78763c7b07d02455598d9fc3c1ad091a28b73635
RxSwift: fe0fd770a43acdb7d0a53da411c9b892e69bb6e4
RxSwiftExt: 81afb48ab0602f503147417baeb3989d64c7687d
RxAtomic: eacf60db868c96bfd63320e28619fe29c179656f
RxCocoa: df63ebf7b9a70d6b4eeea407ed5dd4efc8979749
RxSwift: 5976ecd04fc2fefd648827c23de5e11157faa973

PODFILE CHECKSUM: 1806b7fe32f97a5c8cb0e2855080d6344ebaf1a1
PODFILE CHECKSUM: 817654156ded1ef5f7ade7c0dc00ac738eee4a92

COCOAPODS: 1.5.3
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Translate Bar

<p align="center">
<img width="128" height="128" src="./img/icon.png">
</p>

<p align="center">
<a href="https://github.com/artbobrov/Translate-Bar/blob/master/LICENSE.md">
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="License" />
</a>
<a href="https://travis-ci.com/artbobrov/Translate-Bar">
<img src="https://travis-ci.com/artbobrov/Translate-Bar.svg?branch=master" alt="Build Status">
</a>
<a href="https://app.codacy.com/app/artbobrov/Translate-Bar?utm_source=github.com&utm_medium=referral&utm_content=artbobrov/Translate-Bar&utm_campaign=badger">
<img src="https://api.codacy.com/project/badge/Grade/8bed2ddda5094f688e579ff3060157a8" alt="Codacy Badge" />
</a>
</p>

Translate Bar is an macOS app that allows you to translate text directly from your menu bar. Open-source appliction written in Swift using some third party libraries:
* RxSwift
* Moya
* ITSwitch
* KeyHolder

Translation was implemented via [Yandex Translate API](https://tech.yandex.com/translate/)

## Download
Download latest version of the application for [macOS](https://github.com/artbobrov/Translate-Bar/releases)

## Building
Translate Bar uses [CocoaPods](https://github.com/CocoaPods/CocoaPods/) as a dependency manager and [Cocoapods-Keys](https://github.com/orta/cocoapods-keys) to store application keys.

1. Clone project from Github to your local
```
git clone https://github.com/artbobrov/Translate-Bar.git
```
2. Get your [Yandex Dictionary API key](https://tech.yandex.com/dictionary/) and [Yandex Translate API key](https://tech.yandex.com/translate/)
3. Install all pods and save Yandex API keys
Run
```
$ pod install
CocoaPods-Keys has detected a keys mismatch for your setup.
What is the key for YandexDictionaryKey
> YOUR_YANDEX_DICTIONARY_API_KEY
Saved YandexDictionaryKey to Translate Bar.
What is the key for YandexTranslateKey
> YOUR_YANDEX_TRANSLATE_API_KEY
Saved YandexTranslateKey to Translate Bar.
Analyzing dependencies
Fetching podspec for `Keys` from `Pods/CocoaPodsKeys`
Downloading dependencies
Installing Alamofire (4.7.3)
Installing ITSwitch (1.0)
Installing KeyHolder (3.0.1)
Using Keys (1.0.1)
Installing Magnet (2.3.1)
Installing Moya (11.0.2)
Installing Result (3.2.4)
Installing RxAtomic (4.4.0)
Installing RxCocoa (4.4.0)
Installing RxSwift (4.4.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 8 dependencies from the Podfile and 11 total pods installed.
```
or later
```
pod keys set "YandexDictionaryKey" "YOUR_YANDEX_DICTIONARY_API_KEY"
pod keys set "YandexTranslateKey" "YOUR_YANDEX_TRANSLATE_API_KEY"
```
4. Just run your app in Xcode

## Screenshots

<img src="./img/screenshots/translate.png" alt="translation" width="400"/>
<img src="./img/screenshots/language_pick.png" alt="language_pick" width="400"/>
13 changes: 7 additions & 6 deletions TranslateBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,9 @@
"${BUILT_PRODUCTS_DIR}/Magnet/Magnet.framework",
"${BUILT_PRODUCTS_DIR}/Moya/Moya.framework",
"${BUILT_PRODUCTS_DIR}/Result/Result.framework",
"${BUILT_PRODUCTS_DIR}/RxAtomic/RxAtomic.framework",
"${BUILT_PRODUCTS_DIR}/RxCocoa/RxCocoa.framework",
"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
"${BUILT_PRODUCTS_DIR}/RxSwiftExt/RxSwiftExt.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
Expand All @@ -882,9 +882,9 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Magnet.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Moya.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxAtomic.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwiftExt.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -1091,7 +1091,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -1153,7 +1153,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
Expand Down Expand Up @@ -1181,7 +1181,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "TranslateBar/Translate Bar.entitlements";
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = EX9Z9UFRL5;
Expand All @@ -1204,10 +1204,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "TranslateBar/Translate Bar.entitlements";
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = EX9Z9UFRL5;
GCC_OPTIMIZATION_LEVEL = fast;
INFOPLIST_FILE = TranslateBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A1C38D4A217BCE94002B4995"
BuildableName = "Translate Bar.app"
BlueprintName = "TranslateBar"
ReferencedContainer = "container:TranslateBar.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A1C38D4A217BCE94002B4995"
BuildableName = "Translate Bar.app"
BlueprintName = "TranslateBar"
ReferencedContainer = "container:TranslateBar.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A1C38D4A217BCE94002B4995"
BuildableName = "Translate Bar.app"
BlueprintName = "TranslateBar"
ReferencedContainer = "container:TranslateBar.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A1C38D4A217BCE94002B4995"
BuildableName = "Translate Bar.app"
BlueprintName = "TranslateBar"
ReferencedContainer = "container:TranslateBar.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>TranslateBar.xcscheme</key>
<key>TranslateBar.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>13</integer>
<integer>1</integer>
</dict>
<key>TranslateBarTests.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>15</integer>
</dict>
<key>TranslateBar_en.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>14</integer>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
2 changes: 1 addition & 1 deletion TranslateBar/Controllers/TranslateViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class TranslateViewController: NSViewController {
languagePickerSelectedIndex: languagePickerSelectedIndex,
suggenstionLinkClicked: suggenstionLinkClicked.asDriverOnErrorJustComplete(),
translationFromClipboardNeeded: rx.viewWillAppear.asDriver(),
pinButtonState: appView.bottomBar.pinButton.rx.state.asDriver()
pinButtonState: appView.bottomBar.pinButton.rx.state.asDriver()
)
}

Expand Down
Loading

0 comments on commit 61f43a7

Please sign in to comment.