@@ -600,8 +600,6 @@ final class SettingsHeaderButton: HighlightableButtonNode {
600600 self . dotLayer. bounds = CGRect ( origin: CGPoint ( ) , size: dotFrame. size)
601601 }
602602 }
603-
604- //self.setBadges(speed: "1.5x", quality: "HD", transition: .immediate)
605603 }
606604
607605 override func didLoad( ) {
@@ -1619,12 +1617,11 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
16191617 activeEdgeRateIndicatorTransition = . immediate
16201618 }
16211619
1622- //TODO:localize
16231620 let activeEdgeRateIndicatorSize = activeEdgeRateIndicator. update (
16241621 transition: ComponentTransition ( activeEdgeRateIndicatorTransition) ,
16251622 component: AnyComponent ( GalleryRateToastComponent (
16261623 rate: activeEdgeRateState. currentRate,
1627- displayTooltip: " Swipe sideways to adjust speed. "
1624+ displayTooltip: self . presentationData . strings . Gallery_ToastVideoSpeedSwipe
16281625 ) ) ,
16291626 environment: { } ,
16301627 containerSize: CGSize ( width: layout. size. width - layout. safeInsets. left * 2.0 , height: 100.0 )
@@ -1902,15 +1899,15 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
19021899 var qualityString : String ?
19031900 if case let . quality( quality) = videoQuality {
19041901 if quality <= 360 {
1905- qualityString = " SD "
1902+ qualityString = self . presentationData . strings . Gallery_VideoSettings_IconQualityLow
19061903 } else if quality <= 480 {
1907- qualityString = " SD "
1904+ qualityString = self . presentationData . strings . Gallery_VideoSettings_IconQualityMedium
19081905 } else if quality <= 720 {
1909- qualityString = " HD "
1906+ qualityString = self . presentationData . strings . Gallery_VideoSettings_IconQualityHD
19101907 } else if quality <= 1080 {
1911- qualityString = " FHD "
1908+ qualityString = self . presentationData . strings . Gallery_VideoSettings_IconQualityFHD
19121909 } else {
1913- qualityString = " UHD "
1910+ qualityString = self . presentationData . strings . Gallery_VideoSettings_IconQualityQHD
19141911 }
19151912 }
19161913
@@ -3474,7 +3471,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
34743471
34753472 if isSettings {
34763473 let sliderValuePromise = ValuePromise < Double ? > ( nil )
3477- topItems. append ( . custom( SliderContextItem ( title: " Speed " , minValue: 0.2 , maxValue: 2.5 , value: status. baseRate, valueChanged: { [ weak self] newValue, _ in
3474+ topItems. append ( . custom( SliderContextItem ( title: strongSelf . presentationData . strings . Gallery_VideoSettings_SpeedControlTitle , minValue: 0.2 , maxValue: 2.5 , value: status. baseRate, valueChanged: { [ weak self] newValue, _ in
34783475 guard let strongSelf = self , let videoNode = strongSelf. videoNode else {
34793476 return
34803477 }
@@ -3488,7 +3485,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
34883485
34893486 if let videoQualityState = strongSelf. videoNode? . videoQualityState ( ) , !videoQualityState. available. isEmpty {
34903487 } else {
3491- items. append ( . custom( SectionTitleContextItem ( text: " PLAYBACK SPEED " ) , false ) )
3488+ items. append ( . custom( SectionTitleContextItem ( text: strongSelf . presentationData . strings . Gallery_VideoSettings_SpeedSectionTitle ) , false ) )
34923489 for (text, _, rate) in strongSelf. speedList ( strings: strongSelf. presentationData. strings) {
34933490 let isSelected = abs ( status. baseRate - rate) < 0.01
34943491 items. append ( . action( ContextMenuActionItem ( text: text, icon: { _ in return nil } , iconSource: ContextMenuActionItemIconSource ( size: CGSize ( width: 24.0 , height: 24.0 ) , signal: sliderValuePromise. get ( )
@@ -3514,12 +3511,11 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
35143511 }
35153512
35163513 if let videoQualityState = strongSelf. videoNode? . videoQualityState ( ) , !videoQualityState. available. isEmpty {
3517- items. append ( . custom( SectionTitleContextItem ( text: " VIDEO QUALITY " ) , false ) )
3514+ items. append ( . custom( SectionTitleContextItem ( text: strongSelf . presentationData . strings . Gallery_VideoSettings_QualitySectionTitle ) , false ) )
35183515
3519- //TODO:localize
35203516 do {
35213517 let isSelected = videoQualityState. preferred == . auto
3522- let qualityText : String = " Auto "
3518+ let qualityText : String = strongSelf . presentationData . strings . Gallery_VideoSettings_QualityAuto
35233519 let textLayout : ContextMenuActionItemTextLayout
35243520 if videoQualityState. current != 0 {
35253521 textLayout = . secondLineWithValue( " \( videoQualityState. current) p " )
@@ -3551,15 +3547,15 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
35513547 let isSelected = videoQualityState. preferred == . quality( quality)
35523548 let qualityTitle : String
35533549 if quality <= 360 {
3554- qualityTitle = " Low "
3550+ qualityTitle = strongSelf . presentationData . strings . Gallery_VideoSettings_QualityLow
35553551 } else if quality <= 480 {
3556- qualityTitle = " Medium "
3552+ qualityTitle = strongSelf . presentationData . strings . Gallery_VideoSettings_QualityMedium
35573553 } else if quality <= 720 {
3558- qualityTitle = " High "
3554+ qualityTitle = strongSelf . presentationData . strings . Gallery_VideoSettings_QualityHD
35593555 } else if quality <= 1080 {
3560- qualityTitle = " Full HD "
3556+ qualityTitle = strongSelf . presentationData . strings . Gallery_VideoSettings_QualityFHD
35613557 } else {
3562- qualityTitle = " Ultra HD "
3558+ qualityTitle = strongSelf . presentationData . strings . Gallery_VideoSettings_QualityQHD
35633559 }
35643560 items. append ( . action( ContextMenuActionItem ( text: qualityTitle, textLayout: . secondLineWithValue( " \( quality) p " ) , icon: { _ in
35653561 if isSelected {
@@ -3584,7 +3580,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
35843580 }
35853581 } else {
35863582 if let ( message, maybeFile, _) = strongSelf. contentInfo ( ) , let file = maybeFile, !message. isCopyProtected ( ) && !item. peerIsCopyProtected && message. paidContent == nil {
3587- items. append ( . action( ContextMenuActionItem ( text: " Save to Gallery " , icon: { theme in generateTintedImage ( image: UIImage ( bundleImageName: " Chat/Context Menu/Download " ) , color: theme. actionSheet. primaryTextColor) } , action: { c, _ in
3583+ items. append ( . action( ContextMenuActionItem ( text: strongSelf . presentationData . strings . Gallery_MenuSaveToGallery , icon: { theme in generateTintedImage ( image: UIImage ( bundleImageName: " Chat/Context Menu/Download " ) , color: theme. actionSheet. primaryTextColor) } , action: { c, _ in
35883584 guard let self else {
35893585 c? . dismiss ( result: . default, completion: nil )
35903586 return
@@ -3616,9 +3612,9 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
36163612 let fileSizeString = dataSizeString ( qualityFileSize, formatting: DataSizeStringFormatting ( presentationData: self . presentationData) )
36173613 let title : String
36183614 if let quality {
3619- title = " Save in \( quality) p "
3615+ title = self . presentationData . strings . Gallery_SaveToGallery_Quality ( " \( quality) " ) . string
36203616 } else {
3621- title = " Save Original "
3617+ title = self . presentationData . strings . Gallery_SaveToGallery_Original
36223618 }
36233619 items. append ( . action( ContextMenuActionItem ( text: title, textLayout: . secondLineWithValue( fileSizeString) , icon: { _ in
36243620 return nil
0 commit comments