fix(plugin-seo): add localized property to MetaTitleComponent (#12751)

### What?
I noticed the plugin-seo exported field component MetaTitleComponent was
missing a localized field property in the UI. Localization is working,
it just wasnt represented in the UI

### Why?
This improves the localization UI for plugin-seo

### How?
The localized prop wasn't being passed along to the Label component

This implementation is a direct copy of the implementation in the
MetaDescription

https://github.com/payloadcms/payload/blob/main/packages/plugin-seo/src/fields/MetaDescription/MetaDescriptionComponent.tsx

Screenshot of issue:

![image](https://github.com/user-attachments/assets/fd3fcd2e-169a-4ca0-915d-0ed8d85e6abf)

Co-authored-by: Patrick Roelofs <patrick.roelofs@iquality.nl>
This commit is contained in:
Patrick Roelofs
2025-07-13 14:39:30 +02:00
committed by GitHub
parent a57faebfd7
commit d213c9150d

View File

@@ -32,7 +32,13 @@ type MetaTitleProps = {
export const MetaTitleComponent: React.FC<MetaTitleProps> = (props) => {
const {
field: { label, maxLength: maxLengthFromProps, minLength: minLengthFromProps, required },
field: {
label,
localized,
maxLength: maxLengthFromProps,
minLength: minLengthFromProps,
required,
},
hasGenerateTitleFn,
readOnly,
} = props
@@ -128,7 +134,9 @@ export const MetaTitleComponent: React.FC<MetaTitleProps> = (props) => {
}}
>
<div className="plugin-seo__field">
{Label ?? <FieldLabel label={label} path={path} required={required} />}
{Label ?? (
<FieldLabel label={label} localized={localized} path={path} required={required} />
)}
{hasGenerateTitleFn && (
<React.Fragment>
&nbsp; &mdash; &nbsp;