From 1d7fc7634075513564075b2a120f1be8f339396a Mon Sep 17 00:00:00 2001 From: Quentin Bandera Date: Thu, 11 Apr 2024 15:49:07 +0200 Subject: [PATCH] Changed the condition for moe visibility --- Sources/ResgenSwift/Strings/Model/Definition.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Sources/ResgenSwift/Strings/Model/Definition.swift b/Sources/ResgenSwift/Strings/Model/Definition.swift index d985e34..b059383 100644 --- a/Sources/ResgenSwift/Strings/Model/Definition.swift +++ b/Sources/ResgenSwift/Strings/Model/Definition.swift @@ -85,13 +85,12 @@ class Definition { } private func getBaseProperty(lang: String, translation: String, isStatic: Bool, comment: String?) -> String { - """ /// Translation in \(lang) : /// \(translation) /// /// Comment : - /// \((comment ?? "").isEmpty ? "No comment" : comment!) + /// \(comment?.isEmpty == false ? comment! : "No comment") \(isStatic ? "static ": "")var \(name): String { NSLocalizedString("\(name)", tableName: kStringsFileName, bundle: Bundle.main, value: "\(translation)", comment: "\(comment ?? "")") } @@ -107,7 +106,7 @@ class Definition { /// \(translation) /// /// Comment : - /// \((comment ?? "").isEmpty ? "No comment" : comment!) + /// \(comment?.isEmpty == false ? comment! : "No comment") \(isStatic ? "static ": "")func \(name)(\(inputParameters.joined(separator: ", "))) -> String { String(format: \(isStatic ? "Self" : "self").\(name), \(translationArguments.joined(separator: ", "))) } @@ -186,7 +185,7 @@ class Definition { /// \(translation) /// /// Comment : - /// \((comment ?? "").isEmpty ? "No comment" : comment!) + /// \(comment?.isEmpty == false ? comment! : "No comment") var \(name): String { "\(translation)" @@ -206,7 +205,7 @@ class Definition { /// \(translation) /// /// Comment : - /// \((comment ?? "").isEmpty ? "No comment" : comment!) + /// \(comment?.isEmpty == false ? comment! : "No comment") static var \(name): String { "\(translation)" }