Skip to content

Translations of custom attributes #1

@marton-balazs-kovacs

Description

@marton-balazs-kovacs

Great package Colin!

In my use case, I wanted to translate custom attributes as well such as titles for divs and placeholders for text inputs. i18n has a nice solution that is quite easy to implement <div data-i18n="[title]key" /> . I already updated the function in my code by adding a third argument to the with_i18n function called attribute. If you find this useful I could send a PR.

Example:

div(
  with_i18n(h1(), "main_title")
  ) |> with_i18n("main_title", attribute = "title")

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