Skip to content

ICU messages don't work on attributes #21615

Open

Description

@Goodwine

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When I try to use ICU syntax in a translated attribute (like placeholder) I get an error:
Template parse errors: Unexpected translation for attribute "placeholder" (id="...

Expected behavior

Either a) nothing fails, everything works! or b) Fail more gracefully telling me this is not supported and make a note of this in the documentation.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-xafhzk?file=app/autocomplete-overview-example.html
https://angular-xafhzk.stackblitz.io

<input placeholder="{foo, select, bar{a} baz{b} other{c}}" i18n-placeholder>

What is the motivation / use case for changing the behavior?

i'm forced to do this in different ways, like goog.getMsg. I'd like not to do this and have a consistent way of doing stuff.

Environment


Angular version: 5.2.1

Activity

  1. added
    area: i18nIssues related to localization and internationalization
    featureLabel used to distinguish feature request from other issues
    on Jan 18, 2018
  2. vicb commented on Jan 18, 2018

    @vicb
    Contributor

    @Goodwine This feature is not supported in the current i18n implementation. Leaving this open so that we:

    • improve the doc,
    • improve the error message.
  3. added this to the Backlog milestone on Jan 23, 2018
  4. JalmariO commented on Jul 3, 2019

    @JalmariO

    I'm using dynamic components for form and placeholders vary.
    Is this feature coming in a near future. I mean ICU for properties?
    Or is there alternative way of localizing properties?
    @ocombe

  5. ocombe commented on Jul 3, 2019

    @ocombe
    Contributor

    We have a ticket tracking this, but it hasn't been prioritized, so no it's not coming in the near future...
    You can localize properties, but you can't use ICU expressions

  6. 1 remaining item

  7. added this to the i18n-ideas milestone on Feb 12, 2020
  8. added
    P4A relatively minor issue that is not relevant to core functions
    and removed on Oct 1, 2020
  9. angular-robot commented on Jun 4, 2021

    @angular-robot
    Contributor

    Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

    Find more details about Angular's feature request process in our documentation.

  10. added
    feature: under considerationFeature request for which voting has completed and the request is now under consideration
    on Jun 5, 2021
  11. added
    area: docsRelated to the documentation
    and removed on Apr 9, 2024
  12. wartab commented on Sep 16, 2025

    @wartab
    Contributor

    Would PRs addressing this (ICU not working, not addressing the parse error) be welcome or would you rather want to fix this yourselves? :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: docsRelated to the documentationarea: i18nIssues related to localization and internationalizationfeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationfreq2: mediumhotlist: error messages

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions