diff --git a/.github/actions/pod-install/action.yml b/.github/actions/pod-install/action.yml new file mode 100644 index 0000000000..fe721362b7 --- /dev/null +++ b/.github/actions/pod-install/action.yml @@ -0,0 +1,36 @@ +name: 'Run Cocoapods Pod Install' +description: 'This action contains steps for running pod install on a project.' +runs: + using: "composite" + steps: + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.4.0' + # Required for KotlinMultiplatform + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version-file: ".java-version" + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Setup Gradle + uses: gradle/gradle-build-action@v3 + - name: Cache Cocoapods + uses: actions/cache@v4 + with: + path: ~/.cocoapods/repos + key: ${{ runner.os }}-cocoapods-${{ github.sha }} + restore-keys: ${{ runner.os }}-cocoapods- + - name: Cache Konan + uses: actions/cache@v4 + with: + path: ~/.konan + key: ${{ runner.os }}-konan-${{ github.sha }} + restore-keys: ${{ runner.os }}-konan- + - name: Pod install + shell: bash + run: bundle exec pod install --repo-update \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 48a91f8332..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: Build App - -on: - push: - branches: [ develop, master, feature/* ] - pull_request: - branches: [ develop, master, feature/* ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -permissions: - id-token: write - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: macos-14 - env: - FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60 - - steps: - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Select Xcode Version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '15.4.0' - - # Required for KotlinMultiplatform - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: "temurin" - java-version-file: ".java-version" - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - - - name: Cache Cocoapods - uses: actions/cache@v4 - with: - path: ~/.cocoapods/repos - key: ${{ runner.os }}-cocoapods-${{ github.sha }} - restore-keys: ${{ runner.os }}-cocoapods- - - - name: Cache Konan - uses: actions/cache@v4 - with: - path: ~/.konan - key: ${{ runner.os }}-konan-${{ github.sha }} - restore-keys: ${{ runner.os }}-konan- - - - name: Pod install - run: bundle exec pod install --repo-update - - # (Levi) Disabling UITests until random crash can be resolved. "godtoolsUITests-Runner (45101) encountered an error (The test runner failed to initialize for UI testing. (Underlying Error: Timed out while loading Accessibility.))" - #- name: Run UITests - # run: bundle exec fastlane cru_shared_lane_run_tests scheme:GodTools-UITests reset_simulator:true should_clear_derived_data:true - - - name: Run Tests and Generate Code Coverage Report (.xcresult) - run: bundle exec fastlane cru_shared_lane_run_tests output_directory:fastlane_scan_output_directory result_bundle:true reset_simulator:true should_clear_derived_data:true - - - name: Upload Xcode Code Coverage Report to CodeCov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true - xcode: true - xcode_archive_path: /Users/runner/work/godtools-swift/godtools-swift/fastlane_scan_output_directory/GodTools-Production.xcresult - - - name: Configure AWS credentials - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_IAM_ONESKY_ROLE_ARN }} - aws-region: us-east-1 - - - name: Import OneSky Keys - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: dkershner6/aws-ssm-getparameters-action@v2 - with: - parameterPairs: | - /shared/onesky/PUBLIC_KEY = ONESKY_PUBLIC_KEY, - /shared/onesky/SECRET_KEY = ONESKY_SECRET_KEY - - - name: Download And Commit Latest OneSky Localizations - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: bundle exec fastlane cru_shared_lane_download_and_commit_latest_one_sky_localizations - - - name: Import App Store Connect API Key - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - env: - APP_STORE_CONNECT_API_JSON_PAYLOAD: ${{ secrets.APP_STORE_CONNECT_API_JSON_PAYLOAD }} - run: echo $APP_STORE_CONNECT_API_JSON_PAYLOAD > fastlane/AppleAppStoreApi.json - - - name: Increment Xcode Project Build Number - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: bundle exec fastlane cru_shared_lane_increment_xcode_project_build_number - - - name: Build And Deploy For TestFlight Release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - env: - MATCH_GIT_BASIC_AUTHORIZATION_PAT: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION_PAT }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - run: bundle exec fastlane cru_shared_lane_build_and_deploy_for_testflight_release is_running_in_ci:true - - - name: Push Commits To Remote - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: git push - - - name: Archive XCode Logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: xcode-logs - path: "/Users/runner/Library/Developer/Xcode/DerivedData/Logs/godtools-*/**" - - - name: Archive Fastlane Gym Logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: fastlane-gym-logs - path: "/Users/runner/Library/Logs/gym/godtools-*/**" diff --git a/.github/workflows/create-version.yml b/.github/workflows/create-version.yml new file mode 100644 index 0000000000..5671485bc7 --- /dev/null +++ b/.github/workflows/create-version.yml @@ -0,0 +1,177 @@ +name: Create Version + +on: + push: + branches: [ main, releases/* ] + pull_request: + branches: [ main, releases/* ] + + workflow_dispatch: + inputs: + versionIncrementType: + description: 'Version Increment Type' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + - manual + manualVersionNumber: + description: 'Manually Enter Version Number (Requires manual Version Increment Type)' + required: false + type: string + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + version_increment_is_bump: + name: Check If Version Increment Is Bump + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' + outputs: + isBump: ${{ steps.check_if_increment_is_bump.outputs.value }} + steps: + - name: Check If Version Increment Is Bump + id: check_if_increment_is_bump + run: | + if [ ${{ inputs.versionIncrementType }} == 'patch' ]; then + echo "value=true" >> "$GITHUB_OUTPUT" + elif [ ${{ inputs.versionIncrementType }} == 'minor' ]; then + echo "value=true" >> "$GITHUB_OUTPUT" + elif [ ${{ inputs.versionIncrementType }} == 'major' ]; then + echo "value=true" >> "$GITHUB_OUTPUT" + else + echo echo "value=false" >> "$GITHUB_OUTPUT" + fi + + current_version: + name: Store Current Version + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set Version Output + id: version + run: | + echo "version=$(grep -m 1 MARKETING_VERSION godtools.xcodeproj/project.pbxproj | sed 's/;//g' | sed 's/ //g' | sed 's/=//g' | sed 's/MARKETING_VERSION//g' | sed 's/^ *//g' | sed 's/^[[:space:]]*//g')" >> $GITHUB_OUTPUT + + print_current_version: + name: Print Current Version + runs-on: ubuntu-latest + needs: [ current_version ] + steps: + - name: Print Current Version + env: + VERSION: ${{ needs.current_version.outputs.version }} + run: | + printf '%s\n' "$VERSION" + + bump_version: + name: Store Bump Version + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + needs: [ current_version, version_increment_is_bump ] + steps: + - name: Bump Version + if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }} + id: bump-semver + uses: actions-ecosystem/action-bump-semver@v1 + with: + current_version: ${{ needs.current_version.outputs.version }} + level: ${{ inputs.versionIncrementType }} + - name: Store Bump Version + id: version + run: | + echo "version=${{ steps.bump-semver.outputs.new_version }}" >> $GITHUB_OUTPUT + + print_bump_version: + name: Print Bump Version + runs-on: ubuntu-latest + needs: [ bump_version, version_increment_is_bump ] + if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }} + steps: + - name: Print Bump Version + env: + VERSION: ${{ needs.bump_version.outputs.version }} + run: | + printf '%s\n' "$VERSION" + + manual_version: + name: Store Manual Version + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + if: inputs.versionIncrementType == 'manual' + steps: + - name: Store Manual Version + id: version + run: | + echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT + + print_manual_version: + name: Print Manual Version + runs-on: ubuntu-latest + needs: [ manual_version ] + if: inputs.versionIncrementType == 'manual' + steps: + - name: Print Manual Version + env: + VERSION: ${{ needs.manual_version.outputs.version }} + run: | + printf '%s\n' "$VERSION" + + new_version: + name: Store New Version + runs-on: ubuntu-latest + needs: [ version_increment_is_bump, bump_version ] + if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' || inputs.versionIncrementType == 'manual' }} + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - name: Store New Version + id: version + run: | + if [ ${{ needs.version_increment_is_bump.outputs.isBump }} == 'true' ]; then + echo "version=${{ needs.bump_version.outputs.version }}" >> $GITHUB_OUTPUT + elif [ ${{ inputs.versionIncrementType }} == 'manual' ]; then + echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT + else + echo "No Version" + fi + + print_new_version: + name: Print New Version + runs-on: ubuntu-latest + needs: [ new_version ] + steps: + - name: Print New Version + env: + VERSION: ${{ needs.new_version.outputs.version }} + run: | + printf '%s\n' "$VERSION" + + create_version_branch_and_pull_request: + name: Create Version Branch and PR + runs-on: ubuntu-latest + needs: [ current_version, new_version ] + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set Podspec Version to New Version + run: | + sed -i "s/MARKETING_VERSION = ${{ needs.current_version.outputs.version }}/MARKETING_VERSION = ${{ needs.new_version.outputs.version }}/g" godtools.xcodeproj/project.pbxproj + - name: Create Version Branch and PR + uses: peter-evans/create-pull-request@v6 + with: + branch: "versions/${{ needs.new_version.outputs.version }}" + title: "Version ${{needs.new_version.outputs.version}}" + commit-message: "Increase version to ${{needs.new_version.outputs.version}}" \ No newline at end of file diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000000..38517a2ddb --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,46 @@ +name: Run Tests + +on: + push: + branches: [ develop, master ] + pull_request: + branches: [ develop, master, feature/*, releases/* ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + run_tests: + runs-on: macos-14 + env: + FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Pod Install + uses: ./.github/actions/pod-install + + - name: Run Tests and Generate Code Coverage Report (.xcresult) + run: bundle exec fastlane cru_shared_lane_run_tests output_directory:fastlane_scan_output_directory result_bundle:true reset_simulator:true should_clear_derived_data:true + + - name: Upload Xcode Code Coverage Report to CodeCov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + xcode: true + xcode_archive_path: /Users/runner/work/godtools-swift/godtools-swift/fastlane_scan_output_directory/GodTools-Production.xcresult + + # - name: Archive XCode Logs + # if: always() + # uses: actions/upload-artifact@v4 + # with: + # name: xcode-logs + # path: "/Users/runner/Library/Developer/Xcode/DerivedData/Logs/godtools-*/**" \ No newline at end of file diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml new file mode 100644 index 0000000000..9a62487f85 --- /dev/null +++ b/.github/workflows/testflight.yml @@ -0,0 +1,45 @@ +name: Distribute To Testflight + +on: + push: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + distribute_to_testflight: + runs-on: macos-14 + env: + FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Pod Install + uses: ./.github/actions/pod-install + + - name: Import App Store Connect API Key + env: + APP_STORE_CONNECT_API_JSON_PAYLOAD: ${{ secrets.APP_STORE_CONNECT_API_JSON_PAYLOAD }} + run: echo $APP_STORE_CONNECT_API_JSON_PAYLOAD > fastlane/AppleAppStoreApi.json + + - name: Increment Xcode Project Build Number + run: bundle exec fastlane cru_shared_lane_increment_xcode_project_build_number + + - name: Build And Deploy For TestFlight Release + env: + MATCH_GIT_BASIC_AUTHORIZATION_PAT: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION_PAT }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + run: bundle exec fastlane cru_shared_lane_build_and_deploy_for_testflight_release is_running_in_ci:true + + - name: Archive Fastlane Gym Logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: fastlane-gym-logs + path: "/Users/runner/Library/Logs/gym/godtools-*/**" diff --git a/godtools.xcodeproj/project.pbxproj b/godtools.xcodeproj/project.pbxproj index 0651e5ae24..a71d5b8873 100644 --- a/godtools.xcodeproj/project.pbxproj +++ b/godtools.xcodeproj/project.pbxproj @@ -13508,7 +13508,7 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 6.3.1; + MARKETING_VERSION = 6.3.2; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -DDEBUG"; PRODUCT_BUNDLE_IDENTIFIER = org.cru.godtools; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -13709,7 +13709,7 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 6.3.1; + MARKETING_VERSION = 6.3.2; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -DDEBUG"; PRODUCT_BUNDLE_IDENTIFIER = org.cru.godtools.beta; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -13909,7 +13909,7 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 6.3.1; + MARKETING_VERSION = 6.3.2; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -DDEBUG"; PRODUCT_BUNDLE_IDENTIFIER = org.cru.godtools.beta; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -14109,7 +14109,7 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 6.3.1; + MARKETING_VERSION = 6.3.2; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -DDEBUG"; PRODUCT_BUNDLE_IDENTIFIER = org.cru.godtools; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -14345,7 +14345,7 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 6.3.1; + MARKETING_VERSION = 6.3.2; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -DRELEASE"; PRODUCT_BUNDLE_IDENTIFIER = org.cru.godtools; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/godtools.xcworkspace/xcshareddata/swiftpm/Package.resolved b/godtools.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3ece0bf092..52e992ebe0 100644 --- a/godtools.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/godtools.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/app-check.git", "state" : { - "revision" : "c218c2054299b15ae577e818bbba16084d3eabe6", - "version" : "10.18.2" + "revision" : "3b62f154d00019ae29a71e9738800bb6f18b236d", + "version" : "10.19.2" } }, { @@ -33,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/AppsFlyerSDK/AppsFlyerFramework-Strict", "state" : { - "revision" : "beffb10e977bcf5881c282351772868f43d1fe1a", - "version" : "6.14.3" + "revision" : "629e2e9873ec3f990b8be9500062b077cef730b9", + "version" : "6.14.6" } }, { @@ -114,8 +114,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55", - "version" : "7.13.1" + "revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6", + "version" : "7.13.3" } }, { @@ -132,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/gtm-session-fetcher.git", "state" : { - "revision" : "0382ca27f22fb3494cf657d8dc356dc282cd1193", - "version" : "3.4.1" + "revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b", + "version" : "3.5.0" } }, { @@ -159,8 +159,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/leveldb.git", "state" : { - "revision" : "0706abcc6b0bd9cedfbb015ba840e4a780b5159b", - "version" : "1.22.2" + "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1", + "version" : "1.22.5" } }, { @@ -177,8 +177,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/nanopb.git", "state" : { - "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692", - "version" : "2.30909.0" + "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", + "version" : "2.30910.0" } }, { @@ -222,8 +222,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/realm/realm-swift.git", "state" : { - "revision" : "2000569f03948c281afc83c36c710ab15e5dd33c", - "version" : "10.50.0" + "revision" : "6e0772315809ff0a11cd265126350039a6aac59d", + "version" : "10.50.1" } }, { @@ -258,8 +258,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "f25867a208f459d3c5a06935dceb9083b11cd539", - "version" : "1.22.0" + "revision" : "e17d61f26df0f0e06f58f6977ba05a097a720106", + "version" : "1.27.1" } }, { diff --git a/godtools/App/Features/AppLanguage/Data/AppLanguagesRepository/Cache/AppLanguagesCache.swift b/godtools/App/Features/AppLanguage/Data/AppLanguagesRepository/Cache/AppLanguagesCache.swift index c7b8ea21a7..cc3af0a008 100644 --- a/godtools/App/Features/AppLanguage/Data/AppLanguagesRepository/Cache/AppLanguagesCache.swift +++ b/godtools/App/Features/AppLanguage/Data/AppLanguagesRepository/Cache/AppLanguagesCache.swift @@ -15,6 +15,7 @@ class AppLanguagesCache { init() { appLanguages = [ + AppLanguageDataModel(languageCode: "am", languageDirection: .leftToRight, languageScriptCode: nil), AppLanguageDataModel(languageCode: "ar", languageDirection: .rightToLeft, languageScriptCode: nil), AppLanguageDataModel(languageCode: "en", languageDirection: .leftToRight, languageScriptCode: nil), AppLanguageDataModel(languageCode: "es", languageDirection: .leftToRight, languageScriptCode: nil), diff --git a/godtools/App/Features/ToolDetails/Data-DomainInterface/GetToolDetailsRepository.swift b/godtools/App/Features/ToolDetails/Data-DomainInterface/GetToolDetailsRepository.swift index ddbd704eec..97ae0b1cc0 100644 --- a/godtools/App/Features/ToolDetails/Data-DomainInterface/GetToolDetailsRepository.swift +++ b/godtools/App/Features/ToolDetails/Data-DomainInterface/GetToolDetailsRepository.swift @@ -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() } diff --git a/godtools/App/Share/Data/RealmDatabase/RealmDatabase.swift b/godtools/App/Share/Data/RealmDatabase/RealmDatabase.swift index 5b5ff6e792..5fa966a44b 100644 --- a/godtools/App/Share/Data/RealmDatabase/RealmDatabase.swift +++ b/godtools/App/Share/Data/RealmDatabase/RealmDatabase.swift @@ -20,8 +20,38 @@ class RealmDatabase { self.databaseConfiguration = databaseConfiguration config = databaseConfiguration.getRealmConfig() + + _ = checkForUnsupportedFileFormatVersionAndDeleteRealmFilesIfNeeded(config: config) } - + + private func checkForUnsupportedFileFormatVersionAndDeleteRealmFilesIfNeeded(config: Realm.Configuration) -> Error? { + + do { + + _ = try Realm(configuration: config) + + } + catch let realmConfigError as NSError { + + if realmConfigError.code == Realm.Error.unsupportedFileFormatVersion.rawValue { + + do { + _ = try Realm.deleteFiles(for: config) + } + catch let deleteFilesError { + + return deleteFilesError + } + } + else { + + return realmConfigError + } + } + + return nil + } + func openRealm() -> Realm { return try! Realm(configuration: config) } diff --git a/godtools/App/Share/Domain/UseCases/GetToolTranslationsFilesUseCase/DetermineToolTranslationsToDownload/DetermineToolTranslationsToDownload.swift b/godtools/App/Share/Domain/UseCases/GetToolTranslationsFilesUseCase/DetermineToolTranslationsToDownload/DetermineToolTranslationsToDownload.swift index 3a9d4dbd0a..76bed3f84c 100644 --- a/godtools/App/Share/Domain/UseCases/GetToolTranslationsFilesUseCase/DetermineToolTranslationsToDownload/DetermineToolTranslationsToDownload.swift +++ b/godtools/App/Share/Domain/UseCases/GetToolTranslationsFilesUseCase/DetermineToolTranslationsToDownload/DetermineToolTranslationsToDownload.swift @@ -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] } diff --git a/godtools/Base.lproj/Localizable.strings b/godtools/Base.lproj/Localizable.strings index 086d9b0b5d..172dc3af71 100644 --- a/godtools/Base.lproj/Localizable.strings +++ b/godtools/Base.lproj/Localizable.strings @@ -448,3 +448,5 @@ Press the About button on any tool for more info."; "onboardingTutorial.appUsageItem.3.message" = "Choose from over 90 languages"; "onboardingTutorial.appUsageItem.4.message" = "Help someone get started as a Christian"; "onboardingTutorial.showMoreButton.title" = "Show Me More"; + +"language_name_fil" = "Filipino (Tagalog)"; diff --git a/godtools/am.lproj/Localizable.strings b/godtools/am.lproj/Localizable.strings index 1b6fe347b9..80a57817e3 100755 --- a/godtools/am.lproj/Localizable.strings +++ b/godtools/am.lproj/Localizable.strings @@ -84,4 +84,7 @@ // Language Name Strings "language_name_fa" = "ፐርሽያን (ፋርሲ)"; +"language_name_fil" = "ፊሊፒኖ (ታጋሎግ)"; +"onboardingTutorial.0.title" = "ለእያንዳንዱ ውይይት ተዘጋጅተዋል"; +"onboardingTutorial.1.title" = "ከሁሉም ጋር ስለ እግዚአብሔር ተነጋገሩ"; diff --git a/godtools/ar.lproj/Localizable.strings b/godtools/ar.lproj/Localizable.strings index 45275a2ccf..e16ecd81a1 100755 --- a/godtools/ar.lproj/Localizable.strings +++ b/godtools/ar.lproj/Localizable.strings @@ -422,3 +422,5 @@ https://godtoolsapp.com "accountActivity.globalAnalytics.countries.title" = "البلدان"; "onboardingTutorial.showMoreButton.title" = "أعرض لي المزيد"; + +"language_name_fil" = "الفلبينية (تاجالوج)"; diff --git a/godtools/bn.lproj/Localizable.strings b/godtools/bn.lproj/Localizable.strings index d722feb62e..6f178f526c 100755 --- a/godtools/bn.lproj/Localizable.strings +++ b/godtools/bn.lproj/Localizable.strings @@ -429,3 +429,5 @@ knowgod.com. আপনার নিজের সাইটে স্থাপ "onboardingTutorial.appUsageItem.3.message" = "90 টি ভাষার অধিক থেকে পছন্দ করুন"; "onboardingTutorial.appUsageItem.4.message" = "একজন খ্রীষ্টান হিসাবে শুরু করতে কাউকে সাহায্য করুন"; "onboardingTutorial.showMoreButton.title" = "আমাকে আরও দেখান"; + +"language_name_fil" = "ফিলিপিনো (ট্যাগালগ)"; diff --git a/godtools/es.lproj/Localizable.strings b/godtools/es.lproj/Localizable.strings index 1c2f2756ac..92d786f61c 100755 --- a/godtools/es.lproj/Localizable.strings +++ b/godtools/es.lproj/Localizable.strings @@ -443,3 +443,5 @@ La aplicación se puede descargar en https://godtoolsapp.com"; "onboardingTutorial.appUsageItem.3.message" = "Elige ente más de 90 idiomas"; "onboardingTutorial.appUsageItem.4.message" = "Ayuda a los demás a iniciarse en el cristianismo"; "onboardingTutorial.showMoreButton.title" = "Mostrarme más"; + +"language_name_fil" = "Filipino (Tagalog)"; diff --git a/godtools/fr.lproj/Localizable.strings b/godtools/fr.lproj/Localizable.strings index 5b4de338c1..c74fc19fbd 100755 --- a/godtools/fr.lproj/Localizable.strings +++ b/godtools/fr.lproj/Localizable.strings @@ -439,3 +439,5 @@ Colossiens 4:6"; "onboardingTutorial.appUsageItem.3.message" = "Choisissez parmi plus de 90 langues"; "onboardingTutorial.appUsageItem.4.message" = "Aidez quelqu'un à faire ses premiers pas en tant que Chrétien"; "onboardingTutorial.showMoreButton.title" = "Me montrer plus"; + +"language_name_fil" = "Philippine (Tagalog)"; diff --git a/godtools/hi.lproj/Localizable.strings b/godtools/hi.lproj/Localizable.strings index 22a1f30479..347c875b21 100755 --- a/godtools/hi.lproj/Localizable.strings +++ b/godtools/hi.lproj/Localizable.strings @@ -440,3 +440,5 @@ "onboardingTutorial.appUsageItem.3.message" = "90 से अधिक भाषाओं में से चुनें"; "onboardingTutorial.appUsageItem.4.message" = "किसी को मसीही के रूप में आरम्भ करने में मदद करें।"; "onboardingTutorial.showMoreButton.title" = "अधिक दिखाएं"; + +"language_name_fil" = "फिलिपीनी"; diff --git a/godtools/id.lproj/Localizable.strings b/godtools/id.lproj/Localizable.strings index 396df99641..7965c7df5b 100755 --- a/godtools/id.lproj/Localizable.strings +++ b/godtools/id.lproj/Localizable.strings @@ -441,3 +441,5 @@ Kolose 4:6"; "onboardingTutorial.appUsageItem.3.message" = "Pilih dari lebih dari 90 bahasa"; "onboardingTutorial.appUsageItem.4.message" = "Membantu seseorang memulai sebagai seorang Kristen"; "onboardingTutorial.showMoreButton.title" = "Lebih"; + +"language_name_fil" = "Filipina (Tagalog)"; diff --git a/godtools/lv-LV.lproj/Localizable.strings b/godtools/lv-LV.lproj/Localizable.strings index d02e298b11..c7d9c4873c 100755 --- a/godtools/lv-LV.lproj/Localizable.strings +++ b/godtools/lv-LV.lproj/Localizable.strings @@ -442,3 +442,5 @@ Lai iegūtu vairāk informācijas, nospied pogu \"Apraksts\"."; "onboardingTutorial.appUsageItem.3.message" = "Izvēlies no 90+ valodām"; "onboardingTutorial.appUsageItem.4.message" = "Palīdzi jaunajam kristietim augt ticībā"; "onboardingTutorial.showMoreButton.title" = "Vairāk"; + +"language_name_fil" = "filipīniešu (tagalu)"; diff --git a/godtools/lv.lproj/Localizable.strings b/godtools/lv.lproj/Localizable.strings index d02e298b11..c7d9c4873c 100644 --- a/godtools/lv.lproj/Localizable.strings +++ b/godtools/lv.lproj/Localizable.strings @@ -442,3 +442,5 @@ Lai iegūtu vairāk informācijas, nospied pogu \"Apraksts\"."; "onboardingTutorial.appUsageItem.3.message" = "Izvēlies no 90+ valodām"; "onboardingTutorial.appUsageItem.4.message" = "Palīdzi jaunajam kristietim augt ticībā"; "onboardingTutorial.showMoreButton.title" = "Vairāk"; + +"language_name_fil" = "filipīniešu (tagalu)"; diff --git a/godtools/pt.lproj/Localizable.strings b/godtools/pt.lproj/Localizable.strings index df46a655c3..00675ba254 100755 --- a/godtools/pt.lproj/Localizable.strings +++ b/godtools/pt.lproj/Localizable.strings @@ -443,3 +443,5 @@ Prima o botão de informações em qualquer ferramenta para obter mais informaç "onboardingTutorial.appUsageItem.3.message" = "Escolha entre mais de 90 idiomas"; "onboardingTutorial.appUsageItem.4.message" = "Ajude alguém a começar como cristão"; "onboardingTutorial.showMoreButton.title" = "Mostrar mais"; + +"language_name_fil" = "Filipino (Tagalog)"; diff --git a/godtools/ru.lproj/Localizable.strings b/godtools/ru.lproj/Localizable.strings index 50eaab3cbd..d6813a4861 100755 --- a/godtools/ru.lproj/Localizable.strings +++ b/godtools/ru.lproj/Localizable.strings @@ -442,3 +442,5 @@ "onboardingTutorial.appUsageItem.3.message" = "Выберите свой язык из 90+ представленных в приложении"; "onboardingTutorial.appUsageItem.4.message" = "Помогите другим в их духовном росте"; "onboardingTutorial.showMoreButton.title" = "Покажите еще"; + +"language_name_fil" = "Филиппинский (Тагальский)"; diff --git a/godtools/sw.lproj/Localizable.strings b/godtools/sw.lproj/Localizable.strings index 99d07063ec..b8febaf93a 100755 --- a/godtools/sw.lproj/Localizable.strings +++ b/godtools/sw.lproj/Localizable.strings @@ -235,4 +235,6 @@ Programu inaweza kupakuliwa kwenye https://godtoolsapp.com"; // Language Name Strings "language_name_fa" = "Kipersia (Kifarsi)"; - +"language_name_fil" = "Kifilipino (Kitagalog)"; +"language_name_fil-x-taglish" = "Kitaglish"; +"language_name_sid" = "Kisidama"; diff --git a/godtools/ur.lproj/Localizable.strings b/godtools/ur.lproj/Localizable.strings index 693e4df173..91af20fd0d 100755 --- a/godtools/ur.lproj/Localizable.strings +++ b/godtools/ur.lproj/Localizable.strings @@ -418,3 +418,5 @@ https://godtoolsapp.com"; "accountActivity.globalAnalytics.countries.title" = "ممالک"; "onboardingTutorial.showMoreButton.title" = "مزید دکھائیے "; + +"language_name_fil" = "فلپائینی(تاگالوگ)"; diff --git a/godtools/vi.lproj/Localizable.strings b/godtools/vi.lproj/Localizable.strings index 12ed1350b7..0d8dc579e0 100755 --- a/godtools/vi.lproj/Localizable.strings +++ b/godtools/vi.lproj/Localizable.strings @@ -441,3 +441,5 @@ Nhấn nút \"Giới thiệu\" để biết thêm về công cụ."; "onboardingTutorial.appUsageItem.3.message" = "Chọn từ hơn 90 ngôn ngữ"; "onboardingTutorial.appUsageItem.4.message" = "Trợ giúp ai đó bắt đầu với tư cách là Cơ đốc Nhân"; "onboardingTutorial.showMoreButton.title" = "Cho tôi xem nhiều hơn"; + +"language_name_fil" = "Tiếng Philippines (Tagalog)"; diff --git a/godtools/zh-Hans.lproj/Localizable.strings b/godtools/zh-Hans.lproj/Localizable.strings index 746ac3071b..b73e9f3984 100755 --- a/godtools/zh-Hans.lproj/Localizable.strings +++ b/godtools/zh-Hans.lproj/Localizable.strings @@ -440,3 +440,5 @@ "onboardingTutorial.appUsageItem.3.message" = "超过90种语言可供选择"; "onboardingTutorial.appUsageItem.4.message" = "帮助他人成为基督徒"; "onboardingTutorial.showMoreButton.title" = "显示更多"; + +"language_name_fil" = "菲律宾语(他加禄语)"; diff --git a/godtools/zh-Hant.lproj/Localizable.strings b/godtools/zh-Hant.lproj/Localizable.strings index edc6f1ee5d..d8b7fc8ec3 100755 --- a/godtools/zh-Hant.lproj/Localizable.strings +++ b/godtools/zh-Hant.lproj/Localizable.strings @@ -442,3 +442,5 @@ "onboardingTutorial.appUsageItem.3.message" = "共有超過 90 種語言可選"; "onboardingTutorial.appUsageItem.4.message" = "引導他人成為教徒"; "onboardingTutorial.showMoreButton.title" = "展示更多"; + +"language_name_fil" = "菲律賓文 (他加祿語)";