From aee35ff4bce876bc3969b7e5a68a49574e8a41ea Mon Sep 17 00:00:00 2001 From: Sibiraj <20282546+sibiraj-s@users.noreply.github.com> Date: Sun, 12 May 2024 16:29:00 +0530 Subject: [PATCH] feat: add locale for invalid url text --- docs/src/content/docs/configuration.md | 1 + docs/src/content/docs/examples/full-featured-editor.mdx | 1 + projects/ngx-editor/src/lib/Locals.ts | 1 + .../ngx-editor/src/lib/modules/menu/image/image.component.html | 2 +- .../ngx-editor/src/lib/modules/menu/link/link.component.html | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/content/docs/configuration.md b/docs/src/content/docs/configuration.md index fe1dac26..ca80f8c4 100644 --- a/docs/src/content/docs/configuration.md +++ b/docs/src/content/docs/configuration.md @@ -61,6 +61,7 @@ NgxEditorModule.forRoot({ altText: 'Alt Text', title: 'Title', remove: 'Remove', + enterValidUrl: 'Please enter a valid URL', }, }); ``` diff --git a/docs/src/content/docs/examples/full-featured-editor.mdx b/docs/src/content/docs/examples/full-featured-editor.mdx index e89ae3a3..ff615533 100644 --- a/docs/src/content/docs/examples/full-featured-editor.mdx +++ b/docs/src/content/docs/examples/full-featured-editor.mdx @@ -51,6 +51,7 @@ import { schema } from 'ngx-editor/schema'; altText: 'Alt Text', title: 'Title', remove: 'Remove', + enterValidUrl: 'Please enter a valid URL', }, }), ], diff --git a/projects/ngx-editor/src/lib/Locals.ts b/projects/ngx-editor/src/lib/Locals.ts index e0841c3b..8247a801 100644 --- a/projects/ngx-editor/src/lib/Locals.ts +++ b/projects/ngx-editor/src/lib/Locals.ts @@ -37,6 +37,7 @@ export const defaults: Record> = { altText: 'Alt Text', title: 'Title', remove: 'Remove', + enterValidUrl: 'Please enter a valid URL', }; export type LocalsKeys = keyof typeof defaults; diff --git a/projects/ngx-editor/src/lib/modules/menu/image/image.component.html b/projects/ngx-editor/src/lib/modules/menu/image/image.component.html index ed3707f0..72e0ba48 100644 --- a/projects/ngx-editor/src/lib/modules/menu/image/image.component.html +++ b/projects/ngx-editor/src/lib/modules/menu/image/image.component.html @@ -16,7 +16,7 @@ }}
- {{ src.errors?.['pattern'] && 'Please enter valid url.' }} + {{ src.errors?.['pattern'] && getLabel('enterValidUrl') | async }}
diff --git a/projects/ngx-editor/src/lib/modules/menu/link/link.component.html b/projects/ngx-editor/src/lib/modules/menu/link/link.component.html index ff0b153f..d667baaa 100644 --- a/projects/ngx-editor/src/lib/modules/menu/link/link.component.html +++ b/projects/ngx-editor/src/lib/modules/menu/link/link.component.html @@ -15,7 +15,7 @@
- {{ href.errors?.['pattern'] && 'Please enter valid url.' }} + {{ href.errors?.['pattern'] && getLabel('enterValidUrl') | async }}