mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-20 14:34:30 +00:00
Update Localization
Update Localization
This commit is contained in:
@@ -93,6 +93,7 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
085641E71D711AEF00116B27 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.strings"; sourceTree = "<group>"; };
|
||||
085641E91D7188C400116B27 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
0880CE3F1D6FE6D900BD39E2 /* example-gui-config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "example-gui-config.json"; sourceTree = "<group>"; };
|
||||
0880CE411D6FF7F600BD39E2 /* BunchImportUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BunchImportUtils.swift; sourceTree = "<group>"; };
|
||||
088EC3961D5F5B8600E40791 /* whitelist.pac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = whitelist.pac; sourceTree = "<group>"; };
|
||||
@@ -124,7 +125,6 @@
|
||||
9B0D554B1D2CC87400A4A8E2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ProxyPreferencesController.xib; sourceTree = "<group>"; };
|
||||
9B172A5D1D0ACEA100B87B9A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/AdvPreferencesWindowController.strings"; 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>"; };
|
||||
9B2491B51D0ACC3A003BBECC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PreferencesWindowController.xib; sourceTree = "<group>"; };
|
||||
9B2491B81D0ACC3E003BBECC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AdvPreferencesWindowController.xib; sourceTree = "<group>"; };
|
||||
@@ -706,8 +706,8 @@
|
||||
9B172A6C1D0ADDDD00B87B9A /* Localizable.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
9B172A6B1D0ADDDD00B87B9A /* Base */,
|
||||
9B172A6D1D0ADDE800B87B9A /* zh-Hans */,
|
||||
085641E91D7188C400116B27 /* Base */,
|
||||
);
|
||||
name = Localizable.strings;
|
||||
sourceTree = "<group>";
|
||||
|
||||
@@ -262,14 +262,16 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
}
|
||||
|
||||
@IBAction func showBunchJsonExampleFile(sender: NSMenuItem) {
|
||||
showExampleConfigFile()
|
||||
}
|
||||
|
||||
@IBAction func importBunchJsonFile(sender: NSMenuItem) {
|
||||
importConfigFile()
|
||||
updateServersMenu()//not working
|
||||
//updateServersMenu()//not working
|
||||
}
|
||||
|
||||
@IBAction func exportAllServerProfile(sender: NSMenuItem) {
|
||||
exportConfigFile()
|
||||
}
|
||||
|
||||
@IBAction func toggleLaunghAtLogin(sender: NSMenuItem) {
|
||||
|
||||
@@ -61,3 +61,9 @@
|
||||
"White List Domain" = "White List Domain";
|
||||
|
||||
"White List IP" = "White List IP";
|
||||
|
||||
"Import Server Profile succeed!" = "Import Server Profile succeed!"
|
||||
|
||||
"Import Server Profile failed!" = "Import Server Profile failed!"
|
||||
|
||||
|
||||
|
||||
@@ -11,10 +11,7 @@ import Foundation
|
||||
|
||||
//Function 3 导出json配置文件
|
||||
func showExampleConfigFile() {
|
||||
let savePanel = NSSavePanel()
|
||||
savePanel.canCreateDirectories = true
|
||||
savePanel.beginWithCompletionHandler { (result) -> Void in
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//importConfigFile, String->void
|
||||
@@ -33,9 +30,7 @@ func importConfigFile() {
|
||||
let data = fileManager.contentsAtPath(filePath)
|
||||
let readString = NSString(data: data!, encoding: NSUTF8StringEncoding)!
|
||||
let readStringData = readString.dataUsingEncoding(NSUTF8StringEncoding)
|
||||
if (NSJSONSerialization.isValidJSONObject(readString)) {
|
||||
print("is not a valid json object")
|
||||
}
|
||||
|
||||
let jsonArr1 = try! NSJSONSerialization.JSONObjectWithData(readStringData!, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary
|
||||
|
||||
for item in jsonArr1.objectForKey("configs") as! [[String: AnyObject]]{
|
||||
@@ -57,14 +52,34 @@ func importConfigFile() {
|
||||
profileMgr.save()
|
||||
NSNotificationCenter.defaultCenter().postNotificationName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil)
|
||||
}
|
||||
let notification = NSUserNotification()
|
||||
notification.title = "Import Server Profile succeed!".localized
|
||||
NSUserNotificationCenter.defaultUserNotificationCenter()
|
||||
.deliverNotification(notification)
|
||||
}else{
|
||||
//todo not close view and shake or alert
|
||||
let notification = NSUserNotification()
|
||||
notification.title = "Import Server Profile failed!".localized
|
||||
NSUserNotificationCenter.defaultUserNotificationCenter()
|
||||
.deliverNotification(notification)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func exportConfigFile(FilePath:String) {
|
||||
func exportConfigFile() {
|
||||
//读取example文件,删掉configs里面的配置,再用NSDictionary填充到configs里面
|
||||
let fileManager = NSFileManager.defaultManager()
|
||||
let filePath:String = NSBundle.mainBundle().bundlePath + "/Contents/Resources/example-gui-config.json"
|
||||
let data = fileManager.contentsAtPath(filePath)
|
||||
let readString = NSString(data: data!, encoding: NSUTF8StringEncoding)!
|
||||
let readStringData = readString.dataUsingEncoding(NSUTF8StringEncoding)
|
||||
let jsonArr1 = try! NSJSONSerialization.JSONObjectWithData(readStringData!, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary
|
||||
jsonArr1.setValue(nil, forKey: "configs")
|
||||
let savePanel = NSSavePanel()
|
||||
savePanel.canCreateDirectories = true
|
||||
savePanel.beginWithCompletionHandler { (result) -> Void in
|
||||
if (result == NSFileHandlingPanelOKButton && (savePanel.URL) != nil) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+2078
-1986
File diff suppressed because it is too large
Load Diff
@@ -64,4 +64,8 @@
|
||||
|
||||
"White List Domain" = "域名白名单";
|
||||
|
||||
"White List IP" = "IP白名单";
|
||||
"White List IP" = "IP白名单";
|
||||
|
||||
"Import Server Profile succeed!" = "导入服务器配置文件成功!"
|
||||
|
||||
"Import Server Profile failed!" = "导入服务器配置文件失败!"
|
||||
|
||||
Reference in New Issue
Block a user