Accessibility improvements

This commit is contained in:
Ilya Laktyushin
2023-02-07 16:21:02 +04:00
parent f1f4eefcbf
commit 050418b0b8
27 changed files with 299 additions and 45 deletions

View File

@@ -64,7 +64,7 @@ func localizedCountryNamesAndCodes(strings: PresentationStrings) -> [((String, S
let locale = localeWithStrings(strings)
var result: [((String, String), String, [Int])] = []
for country in AuthorizationSequenceCountrySelectionController.countries() {
if country.hidden {
if country.hidden || country.id == "FT" {
continue
}
if let englishCountryName = usEnglishLocale.localizedString(forRegionCode: country.id), let countryName = locale.localizedString(forRegionCode: country.id) {
@@ -362,20 +362,24 @@ final class AuthorizationSequenceCountrySelectionControllerNode: ASDisplayNode,
}
var countryName: String
var cleanCountryName: String
let originalCountryName: String
let code: String
if tableView === self.tableView {
countryName = self.sections[indexPath.section].1[indexPath.row].0.1
countryName = "\(emojiFlagForISOCountryCode(self.sections[indexPath.section].1[indexPath.row].1)) \(countryName)"
cleanCountryName = self.sections[indexPath.section].1[indexPath.row].0.1
countryName = "\(emojiFlagForISOCountryCode(self.sections[indexPath.section].1[indexPath.row].1)) \(cleanCountryName)"
originalCountryName = self.sections[indexPath.section].1[indexPath.row].0.0
code = "+\(self.sections[indexPath.section].1[indexPath.row].2)"
} else {
countryName = self.searchResults[indexPath.row].0.1
countryName = "\(emojiFlagForISOCountryCode(self.searchResults[indexPath.row].1)) \(countryName)"
cleanCountryName = self.searchResults[indexPath.row].0.1
countryName = "\(emojiFlagForISOCountryCode(self.searchResults[indexPath.row].1)) \(cleanCountryName)"
originalCountryName = self.searchResults[indexPath.row].0.0
code = "+\(self.searchResults[indexPath.row].2)"
}
cell.accessibilityLabel = cleanCountryName
cell.accessibilityValue = code
cell.textLabel?.text = countryName
cell.detailTextLabel?.text = originalCountryName
if self.displayCodes, let label = cell.accessoryView as? UILabel {