Skip to content

Define the CultureInfo of the format #31

Description

@ricardona

We are using crozone/FormatWith to fill mail templates. These email templates must be sent in Spanish. However when trying to format the dates they appear in English.

Is there a mechanism to define the CultureInfo of the format?

            var template = "{d:dddd, MMMM dd, yyyy}";

            var stringDictionary = new Dictionary<string, object>
            {
                { "d", new DateTime(2025, 12, 31, 5, 10, 20) },
            };
            var result = template.FormatWith(template, stringDictionary);

            Assert.AreEqual("Wednesday, December 31, 2025", result);

Thanks in advance.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions