Skip to content

Allow consumers to override the login page title (currently hardcoded to 'Open CRM') #2

@herbie-bot

Description

@herbie-bot

Problem

createLoginPage() renders the heading from appLayerTranslations.<lang>.login.title, which is hardcoded to "Open CRM" for both en and de. Consumer apps (e.g. open-tasks, future open-elements apps) end up showing "Open CRM" as the login dialog title.

Source: src/translations/en.ts line 3, src/translations/de.ts line 3 in v0.2.0.

The README already lists this under deferred follow-up work ("Per-string translation overrides") — this issue is the concrete request for the login title specifically, which is the user-visible string that breaks branding for every consumer that isn't Open CRM.

Proposed API

Add an appName prop to createLoginPage:

export default createLoginPage({
  homeRoute: "/tasks",
  appName: "Open Tasks",   // overrides t.login.title when set
});

LoginClient then renders appName ?? t.login.title. No breaking change — existing callers (open-crm) keep working unchanged because appName is optional.

Alternative: drop the brand string from appLayerTranslations

Remove login.title from appLayerTranslations entirely. Make appName a required prop on createLoginPage. Cleaner long-term (no misleading default), at the cost of one breaking change in 0.3.0.

A wider, also-acceptable alternative is to accept an appLayerTranslationsOverride prop on OERootLayout that deep-merges into the bundled appLayerTranslations. That would also solve the same problem for any other strings consumers want to override (HTML <title> derivative, "Developed by" line, etc.). More work, more flexibility.

Workaround

pnpm patch @open-elements/nextjs-app-layer@0.2.0 to rewrite dist/translations/{en,de}.js locally. Committed in open-tasks as a temporary bridge — happy to remove the patch as soon as a release with this fix is published.

Context

Filed from open-tasks during the spec 009 migration (Open Tasks #13) which adopts @open-elements/nextjs-app-layer 0.2.0 1:1 from open-crm's setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions