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.Avatar" = "Animated Profile Pictures";
"Premium.AvatarInfo" = "Video avatars animated in chat lists and chats to allow for additional self-expression."; "Premium.AvatarInfo" = "Video avatars animated in chat lists and chats to allow for additional self-expression.";
"Premium.AppIcon" = "App Icons"; "Premium.AppIcon" = "Telegram App Icon";
"Premium.AppIconInfo" = "Additional app icons description goes here."; "Premium.AppIconInfo" = "Choose from a selection of Telegram app icons for your homescreen.";
"Premium.AppIconStandalone" = "Additional App Icons"; "Premium.AppIconStandalone" = "Additional App Icons";
"Premium.AppIconStandaloneInfo" = "Unlock a wider range of app icons by subscribing to **Telegram Premium**."; "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 { public final class View: UIView {
private var component: AppIconsDemoComponent? private var component: AppIconsDemoComponent?
private var containerView: UIView
private var imageViews: [UIImageView] = [] 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 { 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.component = component
self.containerView.frame = CGRect(origin: .zero, size: availableSize)
if self.imageViews.isEmpty { if self.imageViews.isEmpty {
for icon in component.appIcons { for icon in component.appIcons {
if let image = UIImage(named: icon.imageName, in: getAppBundle(), compatibleWith: nil) { if let image = UIImage(named: icon.imageName, in: getAppBundle(), compatibleWith: nil) {
@ -61,7 +69,7 @@ final class AppIconsDemoComponent: Component {
imageView.clipsToBounds = true imageView.clipsToBounds = true
imageView.layer.cornerRadius = 24.0 imageView.layer.cornerRadius = 24.0
imageView.image = image imageView.image = image
self.addSubview(imageView) self.containerView.addSubview(imageView)
self.imageViews.append(imageView) self.imageViews.append(imageView)
} }
@ -92,6 +100,23 @@ final class AppIconsDemoComponent: Component {
if let _ = transition.userData(DemoAnimateInTransition.self), abs(mappedPosition) < .ulpOfOne { if let _ = transition.userData(DemoAnimateInTransition.self), abs(mappedPosition) < .ulpOfOne {
Queue.mainQueue().after(0.1) { Queue.mainQueue().after(0.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(availableSize: CGSize) {
var i = 0 var i = 0
for view in self.imageViews { for view in self.imageViews {
let from: CGPoint let from: CGPoint
@ -118,14 +143,6 @@ final class AppIconsDemoComponent: Component {
} }
} }
return availableSize
}
func animateIn() {
}
}
public func makeView() -> View { public func makeView() -> View {
return View() return View()
} }

View File

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

View File

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