Ver código fonte

【fix】【注册登录】邮箱输入框未做50字符限制

tangchao 4 meses atrás
pai
commit
7eb7d60d54

+ 12 - 0
PDF Office/PDF Master/Class/Account/Controller/AccountInputController.swift

@@ -129,6 +129,12 @@ class AccountInputController: NSViewController {
                     return
                 }
                 
+                if email.count > 50 {
+                    let string = NSLocalizedString("Email address must be no longer than 50 characters.", comment: "")
+                    self?.signInView_?.inputView.showAccountError(string)
+                    return
+                }
+                
                 let valid = self?._validateEmail(email: email) ?? false
                 if valid == false {
                     let string = NSLocalizedString("Please enter a valid email address.", comment: "")
@@ -201,6 +207,12 @@ class AccountInputController: NSViewController {
                     return
                 }
                 
+                if email.count > 50 {
+                    let string = NSLocalizedString("Email address must be no longer than 50 characters.", comment: "")
+                    self?.loginView_?.inputView.showAccountError(string)
+                    return
+                }
+                
                 let valid = self?._validateEmail(email: email) ?? false
                 if valid == false {
                     let string = NSLocalizedString("Please enter a valid email address.", comment: "")

+ 5 - 2
PDF Office/PDF Master/Class/Account/View/AccountInputView.swift

@@ -241,8 +241,11 @@ extension AccountInputView: KMTextFieldDelegate {
         let string = self.accountTF_.stringValue
         let cnt = string?.count ?? 0
         if cnt > 50 {
-            self.accountTF_.stringValue = string?.substring(to: 50)
+//            self.accountTF_.stringValue = string?.substring(to: 50)
+            let string = NSLocalizedString("Email address must be no longer than 50 characters.", comment: "")
+            self.showAccountError(string)
+        } else {
+            self.hideAccountError()
         }
-        self.hideAccountError()
     }
 }

+ 1 - 1
PDF Office/PDF Master/Class/Account/Window/AccountCenterWindowController.swift

@@ -23,7 +23,7 @@ class AccountCenterWindowController: NSWindowController {
     
     private lazy var rightDatas_: [String] = {
         return [
-//            NSLocalizedString("Handle PDF Documents with AI", comment: ""),
+            NSLocalizedString("Handle PDF Documents with AI", comment: ""),
                 NSLocalizedString("Unlimited file conversion", comment: ""),
                 NSLocalizedString("PDF text and image editing", comment: ""),
                 NSLocalizedString("Batch PDF processing", comment: ""),

+ 1 - 0
PDF Office/PDF Master/Strings/ar.lproj/Localizable.strings

@@ -4796,3 +4796,4 @@
 "OK"="موافق";
 
 "Upgrade to authorized Pro version" = "الترقية إلى الإصدار الاحترافي المعتمد";
+"Email address must be no longer than 50 characters." = "يجب ألا يتجاوز عنوان البريد الإلكتروني 50 حرفًا.";

+ 1 - 0
PDF Office/PDF Master/Strings/de.lproj/Localizable.strings

@@ -3165,3 +3165,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Upgrade auf autorisierte Pro-Version";
+"Email address must be no longer than 50 characters." = "Die E-Mail-Adresse darf nicht länger als 50 Zeichen sein.";

+ 1 - 0
PDF Office/PDF Master/Strings/en.lproj/Localizable.strings

@@ -4328,3 +4328,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Upgrade to authorized Pro version";
+"Email address must be no longer than 50 characters." = "Email address must be no longer than 50 characters.";

+ 1 - 0
PDF Office/PDF Master/Strings/es.lproj/Localizable.strings

@@ -3247,3 +3247,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Actualizar a la versión Pro autorizada";
+"Email address must be no longer than 50 characters." = "La dirección de correo electrónico no debe tener más de 50 caracteres.";

+ 1 - 0
PDF Office/PDF Master/Strings/fr.lproj/Localizable.strings

@@ -3127,3 +3127,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Mise à niveau vers la version Pro autorisée";
+"Email address must be no longer than 50 characters." = "L'adresse e-mail ne doit pas dépasser 50 caractères.";

+ 1 - 0
PDF Office/PDF Master/Strings/it.lproj/Localizable.strings

@@ -3044,3 +3044,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Aggiorna alla versione Pro autorizzata";
+"Email address must be no longer than 50 characters." = "L'indirizzo email non deve superare i 50 caratteri.";

+ 1 - 0
PDF Office/PDF Master/Strings/ja.lproj/Localizable.strings

@@ -3322,3 +3322,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "認定されたProバージョンにアップグレード";
+"Email address must be no longer than 50 characters." = "メールアドレスは50文字以内でなければなりません。";

+ 1 - 0
PDF Office/PDF Master/Strings/nl.lproj/Localizable.strings

@@ -3203,3 +3203,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Upgrade naar een geautoriseerde Pro-versie";
+"Email address must be no longer than 50 characters." = "Het e-mailadres mag niet langer zijn dan 50 tekens.";

+ 1 - 0
PDF Office/PDF Master/Strings/pl.lproj/Localizable.strings

@@ -3259,3 +3259,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Uaktualnij do autoryzowanej wersji Pro";
+"Email address must be no longer than 50 characters." = "Adres e-mail nie może być dłuższy niż 50 znaków.";

+ 1 - 0
PDF Office/PDF Master/Strings/pt.lproj/Localizable.strings

@@ -4716,3 +4716,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Atualize para a versão Pro autorizada";
+"Email address must be no longer than 50 characters." = "O endereço de e-mail não deve ter mais de 50 caracteres.";

+ 1 - 0
PDF Office/PDF Master/Strings/ru.lproj/Localizable.strings

@@ -3192,3 +3192,4 @@
 "OK"="OK";
 
 "Upgrade to authorized Pro version" = "Обновитесь до авторизованной версии Pro";
+"Email address must be no longer than 50 characters." = "Адрес электронной почты не должен быть длиннее 50 символов.";

+ 1 - 0
PDF Office/PDF Master/Strings/zh-Hans.lproj/Localizable.strings

@@ -4249,3 +4249,4 @@
 "OK"="好的";
 
 "Upgrade to authorized Pro version" = "升级授权Pro版本";
+"Email address must be no longer than 50 characters." = "电子邮件地址不得超过 50 个字符。";

+ 1 - 0
PDF Office/PDF Master/Strings/zh-Hant.lproj/Localizable.strings

@@ -4362,3 +4362,4 @@
 "OK"="好的";
 
 "Upgrade to authorized Pro version" = "升級授權Pro版本";
+"Email address must be no longer than 50 characters." = "電子郵件地址不得超過 50 個字元。";