调整文案及翻译

This commit is contained in:
Qiu Yuzhou
2019-09-12 00:46:38 +08:00
parent 8018e47e05
commit 56c0ef68ae
7 changed files with 132 additions and 88 deletions

View File

@ -169,7 +169,7 @@
9B16E5991F99FD0700E54DC5 /* icons8-Blind Filled-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icons8-Blind Filled-50.png"; sourceTree = "<group>"; };
9B172A601D0ADA5B00B87B9A /* genstrings.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = genstrings.py; sourceTree = "<group>"; };
9B172A6B1D0ADDDD00B87B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
9B172A6D1D0ADDE800B87B9A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
9B172A6D1D0ADDE800B87B9A /* zh-Hans */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
9B2080482326AC460075386C /* kcptun.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = kcptun.sh; sourceTree = "<group>"; };
9B2080492326AC460075386C /* client */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = client; sourceTree = "<group>"; };
9B2491B51D0ACC3A003BBECC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PreferencesWindowController.xib; sourceTree = "<group>"; };
@ -610,7 +610,6 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
"zh-Hans",

View File

@ -404,7 +404,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
@IBAction func exportDiagnosis(_ sender: NSMenuItem) {
let savePanel = NSSavePanel()
savePanel.title = "Save All Server URLs To File".localized
savePanel.title = "Save Diagnosis to File".localized
savePanel.canCreateDirectories = true
savePanel.allowedFileTypes = ["txt"]
savePanel.isExtensionHidden = false
@ -438,7 +438,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
let defaults = UserDefaults.standard
let mode = defaults.string(forKey: "ShadowsocksRunningMode")
var serverMenuText = "Servers".localized
var serverMenuText = "Servers - (No Selected)".localized
let mgr = ServerProfileManager.instance
for p in mgr.profiles {
@ -449,7 +449,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
} else {
profileName = p.serverHost
}
serverMenuText = "\(serverMenuText) - \(profileName)"
serverMenuText = "Servers".localized + " - \(profileName)"
break
}
}
serversMenuItem.title = serverMenuText
@ -581,22 +582,25 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
let urls: [URL] = userInfo["urls"] as! [URL]
let mgr = ServerProfileManager.instance
var subtitle: String = ""
if userInfo["source"] as! String == "qrcode" {
subtitle = "By scan QR Code".localized
} else if userInfo["source"] as! String == "url" {
subtitle = "By handle SS URL".localized
} else if userInfo["source"] as! String == "pasteboard" {
subtitle = "By import from pasteboard".localized
}
let addCount = mgr.addServerProfileByURL(urls: urls)
if addCount > 0 {
var subtitle: String = ""
if userInfo["source"] as! String == "qrcode" {
subtitle = "By scan QR Code".localized
} else if userInfo["source"] as! String == "url" {
subtitle = "By handle SS URL".localized
} else if userInfo["source"] as! String == "pasteboard" {
subtitle = "By import from pasteboard".localized
}
sendNotify("Add \(addCount) Shadowsocks Server Profile".localized, subtitle, "")
} else {
sendNotify("", "", "Not found valid qrcode or url of shadowsocks profile".localized)
if userInfo["source"] as! String == "qrcode" {
sendNotify("", "", "Not found valid QRCode of shadowsocks profile".localized)
} else if userInfo["source"] as! String == "url" {
sendNotify("", "", "Not found valid URL of shadowsocks profile".localized)
}
}
}
}

View File

@ -1,9 +1,67 @@
/*
* SHARED STRINGS
*/
/*
* ./PACUtils.swift
* ./ShadowsocksX-NG/UserRulesController.swift
*/
"PAC has been updated by User Rules." = "PAC has been updated by User Rules.";
"It's failed to update PAC by User Rules." = "It's failed to update PAC by User Rules.";
/*
* ./ShadowsocksX-NG/AppDelegate.swift
*/
"Global Mode" = "Global Mode";
"Manual Mode" = "Manual Mode";
"Auto Mode By PAC" = "Auto Mode By PAC";
"Shadowsocks: On" = "Shadowsocks: On";
"Shadowsocks: Off" = "Shadowsocks: Off";
"Export Command Copied." = "Export Command Copied.";
"Save Diagnosis to File" = "Save Diagnosis to File";
"Servers" = "Servers";
"Turn Shadowsocks Off" = "Turn Shadowsocks Off";
"Turn Shadowsocks On" = "Turn Shadowsocks On";
"By scan QR Code" = "By scan QR Code";
"By handle SS URL" = "By handle SS URL";
"By import from pasteboard" = "By import from pasteboard";
"Add \(addCount) Shadowsocks Server Profile" = "Add \(addCount) Shadowsocks Server Profile";
"Not found valid QRCode of shadowsocks profile" = "Not found valid QRCode of shadowsocks profile";
"Not found valid URL of shadowsocks profile" = "Not found valid URL of shadowsocks profile";
/*
* ./ShadowsocksX-NG/ShareServerProfilesWindowController.swift
*/
"Save QRCode As File" = "Save QRCode As File";
"Save All Server URLs To File" = "Save All Server URLs To File";
/*
* ./ShadowsocksX-NG/PACUtils.swift
*/
"PAC has been updated by latest GFW List." = "PAC has been updated by latest GFW List.";
@ -11,51 +69,16 @@
"Failed to download latest GFW List." = "Failed to download latest GFW List.";
/*
* ./PreferencesWindowController.swift
* ./ShadowsocksX-NG/ImportWindowController.swift
*/
"Success to add \(addCount) server." = "Success to add \(addCount) server.";
"Not found valid shadowsocks server urls." = "Not found valid shadowsocks server urls.";
/*
* ./ShadowsocksX-NG/PreferencesWindowController.swift
*/
"New Server" = "New Server";
/*
* ./AppDelegate.swift
*/
"Add \(addCount) Shadowsocks Server Profile" = "Add \(addCount) Shadowsocks Server Profile";
"Not found valid qrcode or url of shadowsocks profile" = "Not found valid qrcode or url of shadowsocks profile";
"By scan QR Code" = "By scan QR Code";
"By Handle SS URL" = "By Handle SS URL";
" Encryption Method: \(profile.method)" = " Encryption Method: \(profile.method)";
"Current server profile is not valid." = "Current server profile is not valid.";
"No current server profile." = "No current server profile.";
"Shadowsocks: On" = "Shadowsocks: On";
"Turn Shadowsocks Off" = "Turn Shadowsocks Off";
"Shadowsocks: Off" = "Shadowsocks: Off";
"Turn Shadowsocks On" = "Turn Shadowsocks On";
"Proxy - Auto By PAC" = "Proxy - Auto By PAC";
"Proxy - Global" = "Proxy - Global";
"Proxy - Manual" = "Proxy - Manual";
"Servers" = "Servers";
"Auto" = "PAC";
"Global" = "Global";
"Manual" = "Manual";
"Show Running Mode On Status Bar" = "Show Running Mode On Status Bar";
"Timeout" = "Timeout";

View File

@ -72,7 +72,7 @@ class ShareServerProfilesWindowController: NSWindowController
@IBAction func saveQRCodeAsFile(_ sender: NSButton) {
if let img = qrCodeImageView.image {
let savePanel = NSSavePanel()
savePanel.title = "Save All Server URLs To File".localized
savePanel.title = "Save QRCode As File".localized
savePanel.canCreateDirectories = true
savePanel.allowedFileTypes = ["gif"]
savePanel.isExtensionHidden = false

View File

@ -10,7 +10,11 @@ import Foundation
extension String {
var localized: String {
return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: "")
return NSLocalizedString(self, tableName: "Localizable", comment: "")
}
func localized(withComment:String) -> String {
return NSLocalizedString(self, tableName: "Localizable", comment: withComment)
}
}

View File

@ -2,8 +2,6 @@
/*
* SHARED STRINGS
*/
@ -14,30 +12,28 @@
"PAC has been updated by latest GFW List." = "已经使用最新的 GFW List 更新PAC";
"Failed to download latest GFW List." = "下载 GFW List 失败";
"It's failed to update PAC by User Rules." = "更新 PAC 失败";
/*
* ./PreferencesWindowController.swift
*/
"New Server" = "新服务器";
"Failed to download latest GFW List." = "下载最新的 GFW 列表失败";
/*
* ./AppDelegate.swift
*/
"Save Diagnosis to File" = "保存诊断信息到文件";
"Global Mode" = "全局模式";
"Manual Mode" = "手动模式";
"Auto Mode By PAC" = "PAC自动模式";
"Add \(addCount) Shadowsocks Server Profile" = "已添加\(addCount)个Shadowsocks服务器配置";
"Not found valid qrcode or url of shadowsocks profile" = "没有找到有效的shadowsocks配置二维码或链接";
"By scan QR Code" = "通过扫描二维码";
" Encription Method: \(profile.method)" = " 加密方法: \(profile.method)";
"Current server profile is not valid." = "当前服务器配置无效";
"No current server profile." = "未设置当前服务器配置";
"Shadowsocks: On" = "Shadowsocks: On";
"Turn Shadowsocks Off" = "关闭 Shadowsocks";
@ -46,21 +42,15 @@
"Turn Shadowsocks On" = "打开 Shadowsocks";
"Proxy - Auto By PAC" = "代理 - PAC自动⌃⌘P";
"Proxy - Global" = "代理 - 全局⌃⌘P";
"Proxy - Manual" = "代理 - 手动";
"Servers" = "服务器";
"Auto" = "自动";
"Servers - (No Selected)" = "服务器 - (未选择)";
"Global" = "全局";
"Add \(addCount) Shadowsocks Server Profile" = "新增 \(addCount) 个 Shadowsocks 服务器配置";
"Manual" = "手动";
"Not found valid QRCode of shadowsocks profile" = "未找到有效的 shadowsocks 二维码";
"Show Running Mode On Status Bar" = "在状态栏显示运行模式";
"Not found valid URL of shadowsocks profile" = "未找到有效的 shadowsocks 链接";
/*
* ./HTTPPreferencesWindowController.swift
@ -69,3 +59,27 @@
"Export Command Copied." = "Export 命令已复制至剪贴板";
"Timeout" = "超时";
/*
* ./ShadowsocksX-NG/ShareServerProfilesWindowController.swift
*/
"Save All Server URLs To File" = "保存所有服务器 URL 到文件";
"Save QRCode As File" = "保存 QRCode 为文件";
/*
* ./ShadowsocksX-NG/ImportWindowController.swift
*/
"Success to add \(addCount) server." = "成功添加 \(addCount) 个服务器";
"Not found valid shadowsocks server urls." = "未找到有效的shadowsocks服务器URL";
/*
* ./ShadowsocksX-NG/PreferencesWindowController.swift
*/
"New Server" = "新建服务器";

View File

@ -114,4 +114,4 @@
"eNh-vY-utd.title" = "导出诊断信息...";
/* Class = "NSMenuItem"; title = "Import Server URLs..."; ObjectID = "geG-dQ-OYl"; */
"geG-dQ-OYl.title" = "导入服务器URLs...";
"geG-dQ-OYl.title" = "导入服务器URL...";