Skip to content

SwiftUI: Allow customizing individual strings (e.g. the "Sign in with Firebase" picker title) without replacing the whole strings bundle #1441

Done

Description

@visskiss

Body:

Environment: FirebaseUI-iOS 16.2.0 (FirebaseAuthSwiftUI), iOS 18

Problem

The auth picker title is hard-coded in StringUtils.authPickerTitle as the key "Sign in with Firebase". An app that wants its own branding, such as "Sign in to My App", has no supported way to change it.

The only hook is AuthConfiguration.customStringsBundle. It replaces the library's entire bundle, and StringUtils looks up every string in that bundle. So a bundle containing only the title shows raw keys everywhere else. To override one string, the app has to copy the library's resource bundle (about 70 localizations) and patch one entry at runtime, which depends on the internal bundle name FirebaseUI_FirebaseAuthSwiftUI.

Workaround we use

At launch we copy FirebaseUI_FirebaseAuthSwiftUI.bundle into Caches, rewrite the "Sign in with Firebase" entry in each *.lproj/Localizable.strings, and pass the copy as customStringsBundle. This works, but it is fragile and wasteful.

Proposal (either would help)

  1. Add per-string overrides to AuthConfiguration, for example stringOverrides: [String: String]. StringUtils.localizedString(for:) would check it first and fall back to the library bundle.
  2. Make customStringsBundle fall back to the library bundle for missing keys, so a partial bundle works.
  3. Optionally, add a dedicated title option on AuthConfiguration, since the Firebase-branded title is the most common thing to change.

Related

Activity

  1. self-assigned this
    on Nov 27, 2026
  2. demolaf commented on Nov 27, 2026

    @demolaf
    Member

    Thanks for the detailed write-up! Your second proposal already works: since 16.2.0, customStringsBundle falls back to the library's strings for any key it doesn't contain, so there's no need to copy the library bundle. Put only the strings you want to change in your own Localizable.strings:

    "Sign in with Firebase" = "Sign in to My App";
    
    let configuration = AuthConfiguration(customStringsBundle: .main)

    Every other string resolves to the library default. This is documented under Customizing UI Strings, and the SwiftUI sample app does exactly this with a one-line Localizable.strings.

    If you still see raw keys with a partial bundle on 16.2.0, could you share a screenshot and how the bundle is set up? We'll take a look.

  3. visskiss commented on Nov 27, 2026

    @visskiss
    Author

    Thanks, that works. customStringsBundle: .main with a single override in my app's Localizable.strings gives me exactly what I wanted, and I've dropped my bundle-copy workaround. Closing this.

  4. github-actions commented on Nov 27, 2026

    @github-actions

    This item is closed, so it may not receive regular attention.

    If it is still relevant, please open a new issue with an up-to-date reproduction, or open a new pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions