From 53a1b9677476048bf559d75b0702f1c63156deae Mon Sep 17 00:00:00 2001 From: Selim Mustafaev Date: Wed, 23 Dec 2020 23:45:46 +0300 Subject: [PATCH] Localization plus minor fixes for ads feature --- AutoCat/Controllers/AdsController.swift | 4 ++- AutoCat/Views/eureka/ImageGridRow.swift | 2 +- AutoCat/ru.lproj/Localizable.strings | 33 +++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/AutoCat/Controllers/AdsController.swift b/AutoCat/Controllers/AdsController.swift index 274618a..09061f1 100644 --- a/AutoCat/Controllers/AdsController.swift +++ b/AutoCat/Controllers/AdsController.swift @@ -11,6 +11,8 @@ class AdsController: FormViewController, MediaBrowserViewControllerDataSource { override func viewDidLoad() { super.viewDidLoad() + self.title = NSLocalizedString("Ads", comment: "") + let formatter = DateFormatter() formatter.dateStyle = .long formatter.timeStyle = .none @@ -49,7 +51,7 @@ class AdsController: FormViewController, MediaBrowserViewControllerDataSource { } } - if let description = ad.adDescription { + if let description = ad.adDescription, !description.isEmpty { section <<< MultilineLabelRow() { row in row.title = NSLocalizedString("Description", comment: "") row.value = description diff --git a/AutoCat/Views/eureka/ImageGridRow.swift b/AutoCat/Views/eureka/ImageGridRow.swift index fa3bb1e..18aea77 100644 --- a/AutoCat/Views/eureka/ImageGridRow.swift +++ b/AutoCat/Views/eureka/ImageGridRow.swift @@ -25,7 +25,7 @@ final class ImageGridCell: Cell<[String]>, CellType { override func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize { - self.grid.preferredMaxLayoutWidth = self.bounds.size.width - self.contentView.layoutMargins.left - self.contentView.layoutMargins.right + self.grid.preferredMaxLayoutWidth = self.bounds.size.width - self.layoutMargins.left - self.layoutMargins.right return super.systemLayoutSizeFitting(targetSize, withHorizontalFittingPriority: horizontalFittingPriority, verticalFittingPriority: verticalFittingPriority) } diff --git a/AutoCat/ru.lproj/Localizable.strings b/AutoCat/ru.lproj/Localizable.strings index 1d3e7c3..938cb5c 100644 --- a/AutoCat/ru.lproj/Localizable.strings +++ b/AutoCat/ru.lproj/Localizable.strings @@ -16,6 +16,12 @@ /* No comment provided by engineer. */ "Added by" = "Добавлено"; +/* No comment provided by engineer. */ +"Ads" = "Объявления"; + +/* No comment provided by engineer. */ +"All" = "Все"; + /* No comment provided by engineer. */ "Alternative order" = "Альтернативный порядок"; @@ -67,6 +73,9 @@ /* No comment provided by engineer. */ "Check parameters" = "Параметры проверки"; +/* No comment provided by engineer. */ +"City" = "Город"; + /* No comment provided by engineer. */ "Clear all filters" = "Очистить все фильтры"; @@ -91,6 +100,9 @@ /* No comment provided by engineer. */ "Delete" = "Удалить"; +/* No comment provided by engineer. */ +"Description" = "Описание"; + /* No comment provided by engineer. */ "Done" = "Готово"; @@ -112,6 +124,9 @@ /* No comment provided by engineer. */ "Events" = "События"; +/* No comment provided by engineer. */ +"Filter check history" = "Фильтр истории поиска"; + /* No comment provided by engineer. */ "From" = "С"; @@ -151,6 +166,9 @@ /* Owner type */ "legal" = "Юр. лицо"; +/* No comment provided by engineer. */ +"Link" = "Ссылка"; + /* No comment provided by engineer. */ "Location" = "Координаты"; @@ -163,6 +181,9 @@ /* Added by */ "Me" = "Мной"; +/* No comment provided by engineer. */ +"Mileage" = "Пробег"; + /* No comment provided by engineer. */ "Model" = "Модель"; @@ -193,6 +214,9 @@ /* No comment provided by engineer. */ "OSAGO contracts" = "Полисы ОСАГО"; +/* No comment provided by engineer. */ +"Outdated" = "Неактуальные"; + /* No comment provided by engineer. */ "Owner" = "Владелец"; @@ -220,6 +244,9 @@ /* No comment provided by engineer. */ "Power (kw)" = "Мощность (кВт)"; +/* No comment provided by engineer. */ +"Price" = "Цена"; + /* No comment provided by engineer. */ "Profile" = "Профиль"; @@ -235,6 +262,9 @@ /* No comment provided by engineer. */ "Recording..." = "Запись..."; +/* No comment provided by engineer. */ +"Region" = "Регион"; + /* No comment provided by engineer. */ "Regions" = "Регионы"; @@ -283,6 +313,9 @@ /* No comment provided by engineer. */ "Today" = "Сегодня"; +/* No comment provided by engineer. */ +"Unrecognized" = "Нераспознанные"; + /* No comment provided by engineer. */ "Update" = "Обновить";