Fix localization

This commit is contained in:
Ilya Laktyushin 2022-06-01 11:43:30 +04:00
parent 76ff4e5dd9
commit 985a8f9135
4 changed files with 69 additions and 55 deletions

View File

@ -7621,8 +7621,8 @@ Sorry for the inconvenience.";
"Premium.Avatar" = "Animated Profile Pictures";
"Premium.AvatarInfo" = "Video avatars animated in chat lists and chats to allow for additional self-expression.";
"Premium.AppIcon" = "App Icons";
"Premium.AppIconInfo" = "Additional app icons description goes here.";
"Premium.AppIcon" = "Telegram App Icon";
"Premium.AppIconInfo" = "Choose from a selection of Telegram app icons for your homescreen.";
"Premium.AppIconStandalone" = "Additional App Icons";
"Premium.AppIconStandaloneInfo" = "Unlock a wider range of app icons by subscribing to **Telegram Premium**.";

View File

@ -37,23 +37,31 @@ final class AppIconsDemoComponent: Component {
public final class View: UIView {
private var component: AppIconsDemoComponent?
private var containerView: UIView
private var imageViews: [UIImageView] = []
private var isVisible = false
public override init(frame: CGRect) {
self.containerView = UIView()
self.containerView.clipsToBounds = true
super.init(frame: frame)
self.addSubview(self.containerView)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
public func update(component: AppIconsDemoComponent, availableSize: CGSize, environment: Environment<DemoPageEnvironment>, transition: Transition) -> CGSize {
// let isDisplaying = environment[DemoPageEnvironment.self].isDisplaying
let isDisplaying = environment[DemoPageEnvironment.self].isDisplaying
// if self.node == nil {
// let node = StickersCarouselNode(
// context: component.context,
// stickers: component.stickers
// )
// self.node = node
// self.addSubnode(node)
// }
// let isFirstTime = self.component == nil
self.component = component
self.containerView.frame = CGRect(origin: .zero, size: availableSize)
if self.imageViews.isEmpty {
for icon in component.appIcons {
if let image = UIImage(named: icon.imageName, in: getAppBundle(), compatibleWith: nil) {
@ -61,7 +69,7 @@ final class AppIconsDemoComponent: Component {
imageView.clipsToBounds = true
imageView.layer.cornerRadius = 24.0
imageView.image = image
self.addSubview(imageView)
self.containerView.addSubview(imageView)
self.imageViews.append(imageView)
}
@ -92,37 +100,46 @@ final class AppIconsDemoComponent: Component {
if let _ = transition.userData(DemoAnimateInTransition.self), abs(mappedPosition) < .ulpOfOne {
Queue.mainQueue().after(0.1) {
var i = 0
for view in self.imageViews {
let from: CGPoint
let delay: Double
switch i {
case 0:
from = CGPoint(x: -availableSize.width * 0.333, y: -availableSize.height * 0.8)
delay = 0.1
case 1:
from = CGPoint(x: -availableSize.width * 0.75, y: availableSize.height * 0.75)
delay = 0.15
case 2:
from = CGPoint(x: availableSize.width * 0.9, y: availableSize.height * 0.0)
delay = 0.0
default:
from = CGPoint(x: availableSize.width * 0.5, y: availableSize.height * 0.5)
delay = 0.0
}
view.layer.animateScale(from: 3.0, to: 1.0, duration: 0.5, delay: delay, timingFunction: kCAMediaTimingFunctionSpring)
view.layer.animatePosition(from: from, to: CGPoint(), duration: 0.5, delay: delay, timingFunction: kCAMediaTimingFunctionSpring, additive: true)
i += 1
}
self.animateIn(availableSize: availableSize)
}
}
if isDisplaying && !self.isVisible {
// var fast = false
// if let _ = transition.userData(DemoAnimateInTransition.self) {
// fast = true
// }
self.animateIn(availableSize: availableSize)
}
self.isVisible = isDisplaying
return availableSize
}
func animateIn() {
func animateIn(availableSize: CGSize) {
var i = 0
for view in self.imageViews {
let from: CGPoint
let delay: Double
switch i {
case 0:
from = CGPoint(x: -availableSize.width * 0.333, y: -availableSize.height * 0.8)
delay = 0.1
case 1:
from = CGPoint(x: -availableSize.width * 0.75, y: availableSize.height * 0.75)
delay = 0.15
case 2:
from = CGPoint(x: availableSize.width * 0.9, y: availableSize.height * 0.0)
delay = 0.0
default:
from = CGPoint(x: availableSize.width * 0.5, y: availableSize.height * 0.5)
delay = 0.0
}
view.layer.animateScale(from: 3.0, to: 1.0, duration: 0.5, delay: delay, timingFunction: kCAMediaTimingFunctionSpring)
view.layer.animatePosition(from: from, to: CGPoint(), duration: 0.5, delay: delay, timingFunction: kCAMediaTimingFunctionSpring, additive: true)
i += 1
}
}
}

View File

@ -942,19 +942,18 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
size.height += text.size.height
size.height += 21.0
let gradientColors: [(UIColor, UIColor)] = [
(UIColor(rgb: 0xF28528), UIColor(rgb: 0xEF7633)),
(UIColor(rgb: 0xEA5F43), UIColor(rgb: 0xE7504E)),
(UIColor(rgb: 0xDE4768), UIColor(rgb: 0xD54D82)),
(UIColor(rgb: 0xDE4768), UIColor(rgb: 0xD54D82)),
(UIColor(rgb: 0xC654A8), UIColor(rgb: 0xBE5AC2)),
(UIColor(rgb: 0xAF62E9), UIColor(rgb: 0xA668FF)),
(UIColor(rgb: 0x9674FF), UIColor(rgb: 0x8C7DFF)),
(UIColor(rgb: 0x9674FF), UIColor(rgb: 0x8C7DFF)),
(UIColor(rgb: 0x7B88FF), UIColor(rgb: 0x7091FF)),
(UIColor(rgb: 0x609DFF), UIColor(rgb: 0x56A5FF)),
(UIColor(rgb: 0x609DFF), UIColor(rgb: 0x56A5FF))
let gradientColors: [UIColor] = [
UIColor(rgb: 0xF27C30),
UIColor(rgb: 0xE36850),
UIColor(rgb: 0xD15078),
UIColor(rgb: 0xC14998),
UIColor(rgb: 0xB24CB5),
UIColor(rgb: 0xA34ED0),
UIColor(rgb: 0x9054E9),
UIColor(rgb: 0x7561EB),
UIColor(rgb: 0x5A6EEE),
UIColor(rgb: 0x548DFF),
UIColor(rgb: 0x54A3FF)
]
var items: [SectionGroupComponent.Item] = []
@ -976,8 +975,7 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
PerkComponent(
iconName: perk.iconName,
iconBackgroundColors: [
iconBackgroundColors.0,
iconBackgroundColors.1
iconBackgroundColors
],
title: perk.title(strings: strings),
titleColor: titleColor,

View File

@ -92,7 +92,6 @@ final class ReactionsCarouselComponent: Component {
private let itemSize = CGSize(width: 110.0, height: 110.0)
//private let order = ["👌","😍","🤡","🕊","🥱","🥴"]
private let order = ["😍","👌","🥴","🐳","🥱","🕊","🤡"]
private class ReactionCarouselNode: ASDisplayNode, UIScrollViewDelegate {