Skip to content

Commit

Permalink
Fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdholtz committed Sep 11, 2024
1 parent 1c768bf commit aba2df3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions RevenueCatUI/Templates/Components/LocalizationProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
// LocalizationProvider.swift
//
// Created by Josh Holtz on 9/10/24.
// swiftlint:disable missing_docs todo

import Foundation
import RevenueCat
Expand Down Expand Up @@ -44,7 +43,7 @@ struct LocalizationProvider {
throw LocalizationValidationError.noDefaultLocalization
}

let defaultLocalizationInfo = LocalizationInfo.init(
let defaultLocalizationInfo = LocalizationInfo(
locale: defaultLocale,
localizedStrings: localizedStrings
)
Expand All @@ -54,7 +53,6 @@ struct LocalizationProvider {

// use default locale as a fallback if none of the user's preferred locales are not available in the paywall


// STEP 2: choose best locale based on device's list of preferred locales.
let chosenLocale = Self.preferredLocale(from: paywallLocales) ?? defaultLocale

Expand Down Expand Up @@ -137,7 +135,7 @@ extension LocalizationProvider {

extension LocalizationProvider {

public func string(key: String) throws -> String {
func string(key: String) throws -> String {
guard case let .string(value) = preferred.localizedStrings[key] else {
throw LocalizationValidationError.missingLocalization(
"Missing string localization for property with id: \"\(key)\""
Expand All @@ -146,7 +144,7 @@ extension LocalizationProvider {
return value
}

public func image(key: String) throws -> PaywallComponent.ThemeImageUrls {
func image(key: String) throws -> PaywallComponent.ThemeImageUrls {
let rawValue = preferred.localizedStrings[key] ?? `default`.localizedStrings[key]

guard case let .image(value) = rawValue else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class StackComponentViewModel {
) throws {
self.component = component
self.viewModels = try component.components.map {
try $0.toViewModel(offering: offering,
try $0.toViewModel(offering: offering,
localizationProvider: localizationProvider)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ extension TemplateComponentsView {
default: localizationInfo
)


let textComponent = PaywallComponent.TextComponent(
textLid: "errorID",
color: PaywallComponent.ColorInfo(light: "#000000")
Expand Down

0 comments on commit aba2df3

Please sign in to comment.