mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Refactor string generation
This commit is contained in:
@@ -36,13 +36,13 @@ final class LanguageLinkPreviewContentNode: ASDisplayNode, ShareContentContainer
|
||||
let text: String
|
||||
if localizationInfo.totalStringCount == 0 {
|
||||
self.titleNode.attributedText = NSAttributedString(string: strings.ApplyLanguage_UnsufficientDataTitle, font: Font.medium(18.0), textColor: theme.actionSheet.primaryTextColor, paragraphAlignment: .center)
|
||||
text = strings.ApplyLanguage_UnsufficientDataText(localizationInfo.title).0
|
||||
text = strings.ApplyLanguage_UnsufficientDataText(localizationInfo.title).string
|
||||
} else {
|
||||
self.titleNode.attributedText = NSAttributedString(string: strings.ApplyLanguage_ChangeLanguageTitle, font: Font.medium(18.0), textColor: theme.actionSheet.primaryTextColor, paragraphAlignment: .center)
|
||||
if !localizationInfo.isOfficial {
|
||||
text = strings.ApplyLanguage_ChangeLanguageUnofficialText(localizationInfo.title, "\(completionScore)").0
|
||||
text = strings.ApplyLanguage_ChangeLanguageUnofficialText(localizationInfo.title, "\(completionScore)").string
|
||||
} else {
|
||||
text = strings.ApplyLanguage_ChangeLanguageOfficialText(localizationInfo.title).0
|
||||
text = strings.ApplyLanguage_ChangeLanguageOfficialText(localizationInfo.title).string
|
||||
}
|
||||
}
|
||||
let body = MarkdownAttributeSet(font: Font.regular(15.0), textColor: theme.actionSheet.primaryTextColor)
|
||||
|
||||
@@ -71,7 +71,7 @@ public final class LanguageLinkPreviewController: ViewController {
|
||||
return
|
||||
}
|
||||
if result.languageCode == strongSelf.presentationData.strings.primaryComponent.languageCode {
|
||||
strongSelf.present(textAlertController(context: strongSelf.context, title: nil, text: strongSelf.presentationData.strings.ApplyLanguage_ChangeLanguageAlreadyActive(result.localizedTitle).0, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root))
|
||||
strongSelf.present(textAlertController(context: strongSelf.context, title: nil, text: strongSelf.presentationData.strings.ApplyLanguage_ChangeLanguageAlreadyActive(result.localizedTitle).string, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root))
|
||||
strongSelf.dismiss()
|
||||
} else {
|
||||
strongSelf.localizationInfo = result
|
||||
|
||||
Reference in New Issue
Block a user