Skip to content

Commit

Permalink
Add fix for tool default language
Browse files Browse the repository at this point in the history
  • Loading branch information
levieggertcru committed Jul 24, 2024
1 parent fdfc50d commit 1b1180d
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 1 deletion.
285 changes: 285 additions & 0 deletions godtools.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
{
"originHash" : "21bf5557cd80854fb30416658e2f4affd5f9a1aedfae78f9a812d457ecc91fbe",
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "748c7837511d0e6a507737353af268484e1745e2",
"version" : "1.2024011601.1"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "3b62f154d00019ae29a71e9738800bb6f18b236d",
"version" : "10.19.2"
}
},
{
"identity" : "appauth-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/openid/AppAuth-iOS.git",
"state" : {
"revision" : "c89ed571ae140f8eb1142735e6e23d7bb8c34cb2",
"version" : "1.7.5"
}
},
{
"identity" : "appsflyerframework-strict",
"kind" : "remoteSourceControl",
"location" : "https://github.com/AppsFlyerSDK/AppsFlyerFramework-Strict",
"state" : {
"revision" : "629e2e9873ec3f990b8be9500062b077cef730b9",
"version" : "6.14.6"
}
},
{
"identity" : "cwlcatchexception",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattgallagher/CwlCatchException.git",
"state" : {
"revision" : "3ef6999c73b6938cc0da422f2c912d0158abb0a0",
"version" : "2.2.0"
}
},
{
"identity" : "cwlpreconditiontesting",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git",
"state" : {
"revision" : "2ef56b2caf25f55fa7eef8784c30d5a767550f54",
"version" : "2.2.1"
}
},
{
"identity" : "facebook-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/facebook/facebook-ios-sdk.git",
"state" : {
"revision" : "3fe31c168903759de1c5752d12856c5c437c6862",
"version" : "16.3.1"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk.git",
"state" : {
"revision" : "42eae77a0af79e9c3f41df04a23c76f05cfdda77",
"version" : "10.24.0"
}
},
{
"identity" : "fuzi",
"kind" : "remoteSourceControl",
"location" : "https://github.com/cezheng/Fuzi.git",
"state" : {
"revision" : "f08c8323da21e985f3772610753bcfc652c2103f",
"version" : "3.1.3"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "51ba746a9d51a4bd0774b68499b0c73ef6e8570d",
"version" : "10.24.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "a637d318ae7ae246b02d7305121275bc75ed5565",
"version" : "9.4.0"
}
},
{
"identity" : "googlesignin-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleSignIn-iOS.git",
"state" : {
"revision" : "a7965d134c5d3567026c523e0a8a583f73b62b0d",
"version" : "7.1.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6",
"version" : "7.13.3"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359",
"version" : "1.62.2"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version" : "3.5.0"
}
},
{
"identity" : "gtmappauth",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GTMAppAuth.git",
"state" : {
"revision" : "5d7d66f647400952b1758b230e019b07c0b4b22a",
"version" : "4.1.1"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
"version" : "100.0.0"
}
},
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "lottie-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-ios.git",
"state" : {
"revision" : "769b88d83a42ca8d5572b020c96f47e3690b3796",
"version" : "4.4.3"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{
"identity" : "nimble",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Quick/Nimble.git",
"state" : {
"revision" : "1c49fc1243018f81a7ea99cb5e0985b00096e9f4",
"version" : "13.3.0"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0"
}
},
{
"identity" : "quick",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Quick/Quick.git",
"state" : {
"revision" : "26529ff2209c40ae50fd642b031f930d9d68ea02",
"version" : "7.5.0"
}
},
{
"identity" : "realm-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "9cf7ef4ad8e2f4c7a519c9a395ca3d253bb87aa8",
"version" : "14.6.2"
}
},
{
"identity" : "realm-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-swift.git",
"state" : {
"revision" : "6e0772315809ff0a11cd265126350039a6aac59d",
"version" : "10.50.1"
}
},
{
"identity" : "request-operation-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/CruGlobal/request-operation-ios.git",
"state" : {
"revision" : "165a4124e396214b759e40f1e4e69575d2a257f2",
"version" : "1.5.1"
}
},
{
"identity" : "social-authentication-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/CruGlobal/social-authentication-ios.git",
"state" : {
"revision" : "42af42b3f5cbbf2ca0cf42598b3d7ba4a4848714",
"version" : "0.5.0"
}
},
{
"identity" : "starscream",
"kind" : "remoteSourceControl",
"location" : "https://github.com/daltoniam/Starscream.git",
"state" : {
"revision" : "c6bfd1af48efcc9a9ad203665db12375ba6b145a",
"version" : "4.0.8"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "e17d61f26df0f0e06f58f6977ba05a097a720106",
"version" : "1.27.1"
}
},
{
"identity" : "youtube-ios-player-helper",
"kind" : "remoteSourceControl",
"location" : "https://github.com/youtube/youtube-ios-player-helper.git",
"state" : {
"revision" : "f57129cd4380ec0a74dd3a59da3270a1d653d59b",
"version" : "1.0.4"
}
},
{
"identity" : "ziparchive",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ZipArchive/ZipArchive.git",
"state" : {
"revision" : "79d4dc9729096c6ad83dd3cee2b9f354d1b4ab7b",
"version" : "2.5.5"
}
}
],
"version" : 3
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,18 @@ class GetToolDetailsRepository: GetToolDetailsRepositoryInterface {
.eraseToAnyPublisher()
}

guard let translation = translationsRepository.getLatestTranslation(resourceId: toolId, languageCode: translateInLanguage) else {
let translation: TranslationModel

if let appLanguagetranslation = translationsRepository.getLatestTranslation(resourceId: toolId, languageCode: translateInLanguage) {

translation = appLanguagetranslation
}
else if let defaultTranslation = translationsRepository.getLatestTranslation(resourceId: toolId, languageCode: toolDataModel.attrDefaultLocale) {

translation = defaultTranslation
}
else {

return Just(noToolDomainModel)
.eraseToAnyPublisher()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class DetermineToolTranslationsToDownload: DetermineToolTranslationsToDownloadTy
translations.append(translation)
}

if translations.isEmpty, let defaultTranslation = translationsRepository.getLatestTranslation(resourceId: resourceId, languageCode: resource.attrDefaultLocale) {
translations = [defaultTranslation]
}

if translations.isEmpty, let englishTranslation = translationsRepository.getLatestTranslation(resourceId: resourceId, languageCode: LanguageCodeDomainModel.english.value) {
translations = [englishTranslation]
}
Expand Down

0 comments on commit 1b1180d

Please sign in to comment.