Browse Source

feat:多语言,修复bug

kailen 1 week ago
parent
commit
f53faf1582

+ 4 - 4
AIEmoji/Business/Data/TSDBHistoryManager.swift

@@ -221,10 +221,10 @@ extension TSRealmManager {
         let forKey = "insertAIGenerateExampleData"
         if history.listModels.count == 0,UserDefaults.standard.string(forKey: forKey) == nil {
             let id = Date.timestampInt
-            history.updateDatas([
-                createExampleModel(id:id, imageName: "ptp_example_image0"),
-                createExampleModel(id:id+1, imageName: "ptp_example_image1")
-            ])
+//            history.updateDatas([
+//                createExampleModel(id:id, imageName: "ptp_example_image0"),
+//                createExampleModel(id:id+1, imageName: "ptp_example_image1")
+//            ])
             
             mergeAllDataToAIGenerateDB(history: history)
             

+ 1 - 1
AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/VM/TSPhotoToPhotoVM.swift

@@ -111,7 +111,7 @@ class TSPhotoToPhotoVM {
     var isCanGennerateBlock:((Bool)->Void)?
     init() {
         if UserDefaults.standard.string(forKey: "insertPTPExampleData") == nil {
-            insertExampleData()
+//            insertExampleData()
             UserDefaults.standard.set("1", forKey: "insertPTPExampleData")
             UserDefaults.standard.synchronize()
         }

+ 32 - 8
AIEmoji/Business2/DIYVideo/Elements/TSDiyVideoPromptElementView.swift

@@ -15,17 +15,42 @@ class TSDiyTextPromptElementView: TSPromptTextView, TSDiyVideoElement {
     var param: String {
         ""
     }
-    
+
+    lazy var titleLabel: UILabel = {
+        let title: UILabel = .createLabel()
+        title.text = type.sectionTitle
+        title.textColor = .white.withAlphaComponent(0.8)
+        title.font = .font(size: 14, weight: .medium)
+        return title
+    }()
+
     override init(randomTextArray: [String], textChangedBlock: @escaping (String) -> Void) {
         super.init(randomTextArray: randomTextArray, textChangedBlock: textChangedBlock)
-       
     }
-    
+
+    override func creatUI() {
+        addChildren()
+        super.creatUI()
+    }
+
     override func makeConstraints() {
         super.makeConstraints()
+        titleLabel.snp.remakeConstraints { make in
+            make.leading.equalToSuperview().offset(16)
+            make.top.equalToSuperview().offset(22)
+        }
+        textBgView.snp.remakeConstraints { make in
+            make.top.equalTo(titleLabel.snp.bottom).offset(12)
+            make.horizontalEdges.equalToSuperview().inset(16)
+            make.height.equalTo(182.0)
+            make.bottom.equalToSuperview()
+        }
+    }
 
+    func addChildren() {
+        contentView.addSubview(titleLabel)
     }
-    
+
     @MainActor required init?(coder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
@@ -56,16 +81,16 @@ class TSDiyVideoPromptElementView: TSPromptTextView, TSDiyVideoElement {
     }()
 
     lazy var titleLabel: UILabel = {
-        let title : UILabel = .createLabel()
+        let title: UILabel = .createLabel()
         title.text = type.sectionTitle
         title.textColor = .white.withAlphaComponent(0.8)
-        title.font = .font(size: 14,weight: .medium)
+        title.font = .font(size: 14, weight: .medium)
         return title
     }()
 
     override init(randomTextArray: [String], textChangedBlock: @escaping (String) -> Void) {
         super.init(randomTextArray: randomTextArray, textChangedBlock: textChangedBlock)
-        self.inspirationBtn.isHidden = true
+        inspirationBtn.isHidden = true
     }
 
     override func creatUI() {
@@ -118,7 +143,6 @@ class TSDiyVideoPromptElementView: TSPromptTextView, TSDiyVideoElement {
 //            make.bottom.equalTo(textBgView.snp.bottom).offset(-12)
 //        }
 
-
         AIView.snp.remakeConstraints { make in
             make.height.equalTo(28)
             make.bottom.equalTo(-16)

+ 1 - 1
AIEmoji/Business2/DIYVideo/TSAIDiyVideoVC.swift

@@ -109,7 +109,7 @@ class TSAIDiyVideoVC: TSBaseVC {
     }
 
     override func createView() {
-        setPageTitle("Create Video")
+        setPageTitle("Create Video".localized)
         contentView.addSubview(segmentedView)
         contentView.addSubview(listContainerView)
 

+ 2 - 2
AIEmoji/Business2/DisCover/TSDiscoverVC/Cell/TSDiscoverBannerCell.swift

@@ -210,6 +210,7 @@ extension TSDiscoverBannerCell: TYCyclePagerViewDelegate, TYCyclePagerViewDataSo
 class TSDiscoverBannerViewImageCell: TSBaseCollectionCell {
     lazy var textLabel: UILabel = {
         let textLabel = UILabel.createLabel(font: .font(size: 22, weight: .semibold), textColor: .white)
+        textLabel.numberOfLines = 2
         return textLabel
     }()
 
@@ -256,9 +257,8 @@ class TSDiscoverBannerViewImageCell: TSBaseCollectionCell {
 
         textLabel.snp.makeConstraints { make in
             make.leading.equalTo(16)
-            make.trailing.equalTo(-111)
+            make.trailing.equalTo(tryNowBtn.snp.leading).offset(-16)
             make.bottom.equalTo(-75)//58
-            make.height.equalTo(52)
         }
 
         tryNowBtn.snp.makeConstraints { make in

+ 1 - 0
AIEmoji/de.lproj/Localizable.strings

@@ -577,3 +577,4 @@
 "No Creation yet" = "Noch keine Kreation";
 "Your creations will be listed here" = "Ihre Kreationen werden hier aufgelistet";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "Ihre Eingabeaufforderung kann Urheberrechtsverletzungen, Nacktheit, Blut oder Gewalt enthalten, die nicht den Gesundheitsrichtlinien entsprechen.";
+"Create Video" = "Video erstellen";

+ 1 - 0
AIEmoji/en.lproj/Localizable.strings

@@ -580,3 +580,4 @@ Small / Medium / Large: Manual amplitude selection ";
 "No Creation yet" = "No Creation yet";
 "Your creations will be listed here" = "Your creations will be listed here";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy.";
+"Create Video" = "Create Video";

+ 1 - 0
AIEmoji/es.lproj/Localizable.strings

@@ -575,3 +575,4 @@
 "No Creation yet" = "Aún no hay creación";
 "Your creations will be listed here" = "Tus creaciones aparecerán aquí";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "Su mensaje puede contener infracciones de derechos de autor, desnudez, sangre o violencia que no cumpla con la Política de salud.";
+"Create Video" = "Crear vídeo";

+ 1 - 0
AIEmoji/ja.lproj/Localizable.strings

@@ -574,3 +574,4 @@
 "No Creation yet" = "まだ創造はありません";
 "Your creations will be listed here" = "あなたの作品はここに掲載されます";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "プロンプトには、健康ポリシーに準拠していない著作権侵害、ヌード、流血、暴力が含まれる可能性があります。";
+"Create Video" = "ビデオを作成する";

+ 1 - 0
AIEmoji/ko.lproj/Localizable.strings

@@ -578,3 +578,4 @@
 "No Creation yet" = "아직 창조되지 않았습니다";
 "Your creations will be listed here" = "귀하의 창작물이 여기에 나열됩니다.";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "귀하의 프롬프트에는 건강 정책을 준수하지 않는 저작권 침해, 누드, 유혈 또는 폭력이 포함될 수 있습니다.";
+"Create Video" = "비디오 만들기";

+ 1 - 0
AIEmoji/pt-BR.lproj/Localizable.strings

@@ -574,3 +574,4 @@
 "No Creation yet" = "Nenhuma criação ainda";
 "Your creations will be listed here" = "Suas criações serão listadas aqui";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "Seu prompt pode conter violação de direitos autorais, nudez, sangue ou violência que não estejam em conformidade com a Política de Saúde.";
+"Create Video" = "Criar vídeo";

+ 1 - 0
AIEmoji/pt-PT.lproj/Localizable.strings

@@ -573,3 +573,4 @@
 "No Creation yet" = "Nenhuma criação ainda";
 "Your creations will be listed here" = "Suas criações serão listadas aqui";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "Seu prompt pode conter violação de direitos autorais, nudez, sangue ou violência que não estejam em conformidade com a Política de Saúde.";
+"Create Video" = "Criar vídeo";

+ 1 - 0
AIEmoji/zh-Hans.lproj/Localizable.strings

@@ -576,3 +576,4 @@
 "No Creation yet" = "尚未创建";
 "Your creations will be listed here" = "您的作品将在这里列出";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "您的提示可能包含不符合健康政策的版权侵权、裸体、血腥或暴力内容。";
+"Create Video" = "创建视频";

+ 1 - 0
AIEmoji/zh-Hant.lproj/Localizable.strings

@@ -564,3 +564,4 @@
 "No Creation yet" = "尚未創建";
 "Your creations will be listed here" = "您的作品將在這裡列出";
 "Your prompt may contain copyright infringement, nudity, gore or violence that does not comply with the Health Policy." = "您的提示可能包含侵犯版權、裸體、血腥或不符合健康政策的暴力。";
+"Create Video" = "創建視頻";