@@ -41,11 +41,11 @@ public struct PStrengthViewStatesDecorator {
4141 public static func defaultValues( ) -> PStrengthViewStatesDecorator {
4242 return PStrengthViewStatesDecorator (
4343 emptyPasswordDecorator: StateDecorator ( text: " -- " , textColor: . gray, progressColor: . gray) ,
44- veryWeakPasswordDecorator: StateDecorator ( text: " Very Weak " , textColor: weakColor, progressColor: weakColor) ,
45- weakPasswordDecorator: StateDecorator ( text: " Weak " , textColor: weakColor, progressColor: weakColor) ,
46- fairPasswordDecorator: StateDecorator ( text: " Fair " , textColor: veryWeakColor, progressColor: veryWeakColor) ,
47- strongPasswordDecorator: StateDecorator ( text: " Strong " , textColor: strongColor, progressColor: strongColor) ,
48- veryStrongPasswordDecorator: StateDecorator ( text: " Very Strong " , textColor: veryStrongColor, progressColor: veryStrongColor) )
44+ veryWeakPasswordDecorator: StateDecorator ( text: " veryWeak " . localized , textColor: weakColor, progressColor: weakColor) ,
45+ weakPasswordDecorator: StateDecorator ( text: " weak " . localized , textColor: weakColor, progressColor: weakColor) ,
46+ fairPasswordDecorator: StateDecorator ( text: " fair " . localized , textColor: veryWeakColor, progressColor: veryWeakColor) ,
47+ strongPasswordDecorator: StateDecorator ( text: " strong " . localized , textColor: strongColor, progressColor: strongColor) ,
48+ veryStrongPasswordDecorator: StateDecorator ( text: " veryStrong " . localized , textColor: veryStrongColor, progressColor: veryStrongColor) )
4949 }
5050
5151}
@@ -70,3 +70,9 @@ protocol ViewDecoratorProtocol {
7070 var textColor : UIColor ! { get set }
7171 var progressColor : UIColor ! { get set }
7272}
73+
74+ extension String {
75+ var localized : String {
76+ return NSLocalizedString ( self , tableName: nil , bundle: Bundle . init ( for: PSMeter . self) , value: " " , comment: " " )
77+ }
78+ }
0 commit comments