diff --git a/Scripts/EmojiGenerator.swift b/Scripts/EmojiGenerator.swift index 0c991433b..937032a22 100755 --- a/Scripts/EmojiGenerator.swift +++ b/Scripts/EmojiGenerator.swift @@ -52,6 +52,33 @@ enum RemoteModel { case symbols = "Symbols" case flags = "Flags" case components = "Component" + + var localizedKey: String = { + switch self { + case .smileys: + return "Smileys" + case .people: + return "People" + case .smileysAndPeople: + return "Smileys" + case .animals: + return "Animals" + case .food: + return "Food" + case .activities: + return "Activities" + case .travel: + return "Travel" + case .objects: + return "Objects" + case .symbols: + return "Symbols" + case .flags: + return "Flags" + case .components: + return "Component" + } + }() } static func fetchEmojiData() throws -> Data { @@ -551,7 +578,7 @@ extension EmojiGenerator { for category in outputCategories { fileHandle.writeLine("case .\(category):") fileHandle.indent { - let stringKey = "EMOJI_CATEGORY_\("\(category)".uppercased())_NAME" + let stringKey = "emojiCategory\(category.localizedKey)" let stringComment = "The name for the emoji category '\(category.rawValue)'" fileHandle.writeLine("return NSLocalizedString(\"\(stringKey)\", comment: \"\(stringComment)\")") diff --git a/Scripts/LintLocalizableStrings.swift b/Scripts/LintLocalizableStrings.swift index e26e2d096..6161f6b3f 100755 --- a/Scripts/LintLocalizableStrings.swift +++ b/Scripts/LintLocalizableStrings.swift @@ -138,7 +138,7 @@ let projectState: ProjectState = ProjectState( ), loadSourceFiles: targetActions.contains(.lintStrings) ) -print("------------ Processing \(projectState.localizationFile) ------------") +print("------------ Processing \(projectState.localizationFile.path) ------------") targetActions.forEach { $0.perform(projectState: projectState) } // MARK: - ScriptAction diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 6eacac5cf..81c37c963 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -1271,7 +1271,6 @@ 4CC613352227A00400E21A3A /* ConversationSearch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversationSearch.swift; sourceTree = ""; }; 70377AAA1918450100CAF501 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; - 7B02DF432A16F47B00ADCFD2 /* EmojiGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiGenerator.swift; sourceTree = ""; }; 7B0EFDED274F598600FFAAE7 /* TimestampUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimestampUtils.swift; sourceTree = ""; }; 7B0EFDEF275084AA00FFAAE7 /* CallMessageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallMessageCell.swift; sourceTree = ""; }; 7B0EFDF3275490EA00FFAAE7 /* ringing.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = ringing.mp3; sourceTree = ""; }; @@ -4364,7 +4363,6 @@ isa = PBXGroup; children = ( 7BD687D22A5D283200D8E455 /* build_libSession_util.sh */, - 7B02DF432A16F47B00ADCFD2 /* EmojiGenerator.swift */, FDE7214F287E50D50093DF33 /* ProtoWrappers.py */, FDCCC6E82ABA7402002BBEF5 /* EmojiGenerator.swift */, FDE72150287E50D50093DF33 /* LintLocalizableStrings.swift */,