Localize Twitter intent

This commit is contained in:
Davide De Rosa 2018-10-23 11:54:31 +02:00
parent 39c053bd54
commit 81c7236500
3 changed files with 22 additions and 1 deletions

View File

@ -187,6 +187,8 @@
"about.cells.request_support.caption" = "Request support";
"about.cells.write_review.caption" = "Write a review";
"share.message" = "Passepartout is an user-friendly, open source OpenVPN client for iOS and macOS";
"version.labels.intro" = "Passepartout and TunnelKit are written and maintained by Davide De Rosa (keeshux).\n\nTunnelKit is a native OpenVPN client originally forked from PIATunnel by Private Internet Access.\n\nSource code for Passepartout and TunnelKit is publicly available on GitHub under the GPLv3.";
"version.buttons.changelog" = "CHANGELOG";

View File

@ -115,7 +115,21 @@ class AppConstants {
static let subreddit = URL(string: "https://www.reddit.com/r/passepartout")!
static let twitterIntent = URL(string: "https://twitter.com/intent/tweet?url=https%3A%2F%2Fpassepartoutvpn.app%2F&via=keeshux&text=Passepartout%20is%20an%20user-friendly%2C%20open%20source%20%23OpenVPN%20client%20for%20%23iOS%20and%20%23macOS")!
private static let twitterHashtags = ["OpenVPN", "iOS", "macOS"]
static var twitterIntent: URL {
var text = L10n.Share.message
for ht in twitterHashtags {
text = text.replacingOccurrences(of: ht, with: "#\(ht)")
}
var comps = URLComponents(string: "https://twitter.com/intent/tweet")!
comps.queryItems = [
URLQueryItem(name: "url", value: website.absoluteString),
URLQueryItem(name: "via", value: "keeshux"),
URLQueryItem(name: "text", value: text)
]
return comps.url!
}
static func review(withId id: String) -> URL {
return URL(string: "https://itunes.apple.com/app/id\(id)?action=write-review")!

View File

@ -675,6 +675,11 @@ internal enum L10n {
}
}
internal enum Share {
/// Passepartout is an user-friendly, open source OpenVPN client for iOS and macOS
internal static let message = L10n.tr("Localizable", "share.message")
}
internal enum Version {
internal enum Buttons {