From cd1018792bef873e9e2b086843516e875ae6c89c Mon Sep 17 00:00:00 2001 From: Guillaume Louel Date: Mon, 15 Jul 2019 17:21:40 +0200 Subject: [PATCH] Add Chinese Traditionnal --- Aerial.xcodeproj/project.pbxproj | 8 +++++ .../Models/Cache/PoiStringProvider.swift | 34 +++++++++++-------- Resources/PreferencesWindow.xib | 13 ++++--- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index 882af441..18ffbd9b 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -101,6 +101,9 @@ 03D3DAC5221F286D00BDA52F /* pl.json in Resources */ = {isa = PBXBuildFile; fileRef = 03D3DAC3221F286700BDA52F /* pl.json */; }; 03DAD470229EAC66000DA6D1 /* Installation.md in Resources */ = {isa = PBXBuildFile; fileRef = 03DAD46F229EAC66000DA6D1 /* Installation.md */; }; 03DAD473229EC031000DA6D1 /* Readme.md in Resources */ = {isa = PBXBuildFile; fileRef = 03DAD472229EC031000DA6D1 /* Readme.md */; }; + 03E4B20D22DC7F8800C22EBE /* zh_TW.json in Resources */ = {isa = PBXBuildFile; fileRef = 03E4B20C22DC7F8700C22EBE /* zh_TW.json */; }; + 03E4B20E22DC7FE200C22EBE /* zh_TW.json in Resources */ = {isa = PBXBuildFile; fileRef = 03E4B20C22DC7F8700C22EBE /* zh_TW.json */; }; + 03E4B20F22DC7FE600C22EBE /* zh_TW.json in Resources */ = {isa = PBXBuildFile; fileRef = 03E4B20C22DC7F8700C22EBE /* zh_TW.json */; }; 03E8730C2165013C002B469B /* DownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E8730B2165013C002B469B /* DownloadManager.swift */; }; 03E8730F216501ED002B469B /* AsynchronousOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E8730E216501ED002B469B /* AsynchronousOperation.swift */; }; 03E8731021662AEB002B469B /* DownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E8730B2165013C002B469B /* DownloadManager.swift */; }; @@ -207,6 +210,7 @@ 03DAD475229EC544000DA6D1 /* HardwareDecoding.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = HardwareDecoding.md; sourceTree = ""; }; 03DAD476229EC64D000DA6D1 /* Troubleshooting.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Troubleshooting.md; sourceTree = ""; }; 03DAD477229ECAAA000DA6D1 /* CustomVideos.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CustomVideos.md; sourceTree = ""; }; + 03E4B20C22DC7F8700C22EBE /* zh_TW.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = zh_TW.json; sourceTree = ""; }; 03E8730B2165013C002B469B /* DownloadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadManager.swift; sourceTree = ""; }; 03E8730E216501ED002B469B /* AsynchronousOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsynchronousOperation.swift; sourceTree = ""; }; 03E8731221675FE0002B469B /* TimeManagement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeManagement.swift; sourceTree = ""; }; @@ -282,6 +286,7 @@ 033192DF217B77E90073B580 /* Community */ = { isa = PBXGroup; children = ( + 03E4B20C22DC7F8700C22EBE /* zh_TW.json */, 038EBE9322D0AA3D00C7AD02 /* nl.json */, 036A34B4227309FB00A49135 /* zh_CN.json */, 035A92AB226754760095AB85 /* ar.json */, @@ -677,6 +682,7 @@ 03D1E79222848F7F00D10CF7 /* screen2.jpg in Resources */, FAC36F4A1BE1756D007F2A20 /* MainMenu.xib in Resources */, FAC36F501BE1756D007F2A20 /* icon-night.pdf in Resources */, + 03E4B20E22DC7FE200C22EBE /* zh_TW.json in Resources */, 035A92A9225F8C480095AB85 /* he.json in Resources */, 035A92A7225F8C480095AB85 /* de.json in Resources */, 0395835421807D1F008E8F9C /* thumbnail@2x.png in Resources */, @@ -691,6 +697,7 @@ files = ( 03D1E79322848F7F00D10CF7 /* screen2.jpg in Resources */, 036A34B722730A0700A49135 /* zh_CN.json in Resources */, + 03E4B20F22DC7FE600C22EBE /* zh_TW.json in Resources */, 033D62B1216CAE2C00F3AF83 /* icon-night-dark.pdf in Resources */, 03D1E79622848F7F00D10CF7 /* screen1.jpg in Resources */, 03D1E79922848F7F00D10CF7 /* screen0.jpg in Resources */, @@ -720,6 +727,7 @@ 038EBE9422D0AA3D00C7AD02 /* nl.json in Resources */, 033D62AF216CAE2C00F3AF83 /* icon-night-dark.pdf in Resources */, 0369985D2196103300E359D3 /* missingvideos.json in Resources */, + 03E4B20D22DC7F8800C22EBE /* zh_TW.json in Resources */, FAC36F4F1BE1756D007F2A20 /* icon-night.pdf in Resources */, 0313F9E622942AA500B074BB /* CustomVideos.xib in Resources */, 033192E1217B78240073B580 /* en.json in Resources */, diff --git a/Aerial/Source/Models/Cache/PoiStringProvider.swift b/Aerial/Source/Models/Cache/PoiStringProvider.swift index 8d6e46c4..908ae4ba 100644 --- a/Aerial/Source/Models/Cache/PoiStringProvider.swift +++ b/Aerial/Source/Models/Cache/PoiStringProvider.swift @@ -224,33 +224,37 @@ final class PoiStringProvider { } // Helpers for the main popup + // swiftlint:disable:next cyclomatic_complexity func getLanguagePosition() -> Int { let preferences = Preferences.sharedInstance // The list is alphabetized based on their english name in the UI switch preferences.ciOverrideLanguage { case "ar": // Arabic return 1 - case "zh_CN": // English + case "zh_CN": // Chinese Simplified return 2 - case "nl": // Dutch + case "zh_TW": // Chinese Traditional return 3 - case "en": // English + case "nl": // Dutch return 4 - case "fr": // French + case "en": // English return 5 - case "de": // German + case "fr": // French return 6 - case "he": // Hebrew + case "de": // German return 7 - case "pl": // Polish + case "he": // Hebrew return 8 - case "es": // Spanish + case "pl": // Polish return 9 + case "es": // Spanish + return 10 default: // This is the default, preferred language return 0 } } + // swiftlint:disable:next cyclomatic_complexity func getLanguageStringFromPosition(pos: Int) -> String { switch pos { case 1: @@ -258,18 +262,20 @@ final class PoiStringProvider { case 2: return "zh_CN" case 3: - return "nl" + return "zh_TW" case 4: - return "en" + return "nl" case 5: - return "fr" + return "en" case 6: - return "de" + return "fr" case 7: - return "he" + return "de" case 8: - return "pl" + return "he" case 9: + return "pl" + case 10: return "es" default: return "" diff --git a/Resources/PreferencesWindow.xib b/Resources/PreferencesWindow.xib index 98431659..2013f57e 100644 --- a/Resources/PreferencesWindow.xib +++ b/Resources/PreferencesWindow.xib @@ -766,7 +766,7 @@ is disabled - + @@ -1129,6 +1129,9 @@ should appear + + + @@ -1177,7 +1180,7 @@ should appear - + @@ -2808,7 +2811,7 @@ Gw - + @@ -2822,7 +2825,7 @@ Gw - + @@ -2835,7 +2838,7 @@ After changing the folder, please close System Preferences for this to be taken - +