Skip to content

"title" and "body" get priority over "titleLocKey" and "bodyLocKey" #3938

Open
@GP4cK

Description

@GP4cK

Initially created the issue in the flutterfire repo.

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

When sending a notification with both title and titleLocKey, the app would prioritise title over titleLocKey when displaying the notification. I would expect that if a translation is found, then it should be used. Otherwise (maybe the user hasn't updated the app), then it should default to the title.

Relevant Code:

I think the relevant code is here. We should be swapping getString and getLocalizedString like so:

public String getPossiblyLocalizedString(Resources resources, String packageName, String key) {
    String localized = getLocalizedString(resources, packageName, key);
    if (!TextUtils.isEmpty(localized)) {
      return localized;
    }

    return getString(key);
}

Or is it the expected behaviour?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions