Skip to content

Localize validation messages with user lang files#15820

Merged
kjac merged 2 commits intorelease/13.2from
v13/fix/localize-validation-messages
Mar 4, 2024
Merged

Localize validation messages with user lang files#15820
kjac merged 2 commits intorelease/13.2from
v13/fix/localize-validation-messages

Conversation

@kjac
Copy link
Contributor

@kjac kjac commented Mar 3, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

Although currently undocumented, it is possible to use user lang files to localize the backoffice (instead of using dictionary items). However, that kind of localization does not extend to property validation messages.

This PR fixes it.

Testing this PR

Create a user language file like this in [site root]\config\lang:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language>
    <area alias="validation">
        <key alias="mandatory-field">It's mandatory</key>
        <key alias="numeric-field">It's got to be a number</key>
    </area>
</language>

Use these language keys to configure property validation messages:

image

Now verify that the validation messages are indeed utilized by the backoffice:

image

image

...also in block based editors:

image

Copy link
Member

@Zeegaan Zeegaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@kjac kjac merged commit 21126b7 into release/13.2 Mar 4, 2024
@kjac kjac deleted the v13/fix/localize-validation-messages branch March 4, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants