Skip to content

Commit 1044625

Browse files
committed
fix: option to disable lowercase locale
1 parent 4b37bdf commit 1044625

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/entry-editable.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ interface AppliedVariants {
66
metaKey: string
77
}
88

9-
export function addTags(entry: EntryModel, contentTypeUid: string, tagsAsObject: boolean, locale: string = 'en-us'): void {
9+
export function addTags(entry: EntryModel, contentTypeUid: string, tagsAsObject: boolean, locale: string = 'en-us', options?: {
10+
useLowerCaseLocale?: boolean
11+
}): void {
12+
const { useLowerCaseLocale = true } = options || {};
1013
if (entry) {
1114
// handle case senstivity for contentTypeUid and locale
1215
contentTypeUid = contentTypeUid.toLowerCase();
13-
locale = locale.toLowerCase();
16+
locale = useLowerCaseLocale ? locale.toLowerCase() : locale;
1417

1518
const appliedVariants = entry._applied_variants || entry?.system?.applied_variants || null;
1619
entry.$ = getTag(entry, `${contentTypeUid}.${entry.uid}.${locale}`, tagsAsObject, locale, { _applied_variants: appliedVariants, shouldApplyVariant: !!appliedVariants, metaKey: '' })

0 commit comments

Comments
 (0)