From 6d57d5678a51f7ab3dbc3ebd2bcfd54d0499bc60 Mon Sep 17 00:00:00 2001 From: Miquel Angel Coca Piza Date: Tue, 17 Mar 2026 16:17:09 +0100 Subject: [PATCH 1/4] feat: enhance language definition merging in Provider --- src/render/Provider.tsx | 12 +++++++++--- tsconfig.json | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/render/Provider.tsx b/src/render/Provider.tsx index a69c26b..0db09db 100644 --- a/src/render/Provider.tsx +++ b/src/render/Provider.tsx @@ -3,6 +3,8 @@ import { useState, useEffect } from 'preact/hooks'; import { UIProvider } from '@adobe-commerce/elsie/components'; import { Lang } from '@adobe-commerce/elsie/i18n'; import { events } from '@adobe-commerce/event-bus'; +import { deepmerge } from '@adobe-commerce/elsie/lib'; +import { config } from '@/dropin-name/api'; import en_US from '../i18n/en_US.json'; @@ -11,11 +13,11 @@ const langDefinitions = { default: en_US, }; -interface CartProviderProps { +interface ProviderProps { children?: any; } -export const Provider: FunctionComponent = ({ +export const Provider: FunctionComponent = ({ children, }) => { const [lang, setLang] = useState('en_US'); @@ -34,8 +36,12 @@ export const Provider: FunctionComponent = ({ }; }, []); + const userLangDefinitions = config.getConfig()?.langDefinitions; + + const definitions = deepmerge(langDefinitions, userLangDefinitions ?? {}); + return ( - + {children} ); diff --git a/tsconfig.json b/tsconfig.json index b311de0..6995d6b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,8 @@ "outDir": "dist", "baseUrl": ".", "paths": { - "@adobe-commerce/elsie/*": ["./node_modules/@adobe-commerce/elsie/src/*"] + "@adobe-commerce/elsie/*": ["./node_modules/@adobe-commerce/elsie/src/*"], + "@/dropin-name/*": ["./src/*"] } }, "include": ["src"], From 356b61c8575db9807ae92cd4dab3d22b0164adf2 Mon Sep 17 00:00:00 2001 From: Jaume Capdevila Date: Wed, 18 Mar 2026 10:00:36 +0100 Subject: [PATCH 2/4] fix(release): separate commit and push steps in workflow --- .github/workflows/release.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a1a9e95..95449b4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,15 +43,18 @@ jobs: echo "has_changes=true" >> "$GITHUB_OUTPUT" fi - - name: Commit and push + - name: Commit if: steps.check.outputs.has_changes == 'true' run: | git add -A git commit -m "chore: bump version" - git push origin HEAD - name: Run changeset tag + if: steps.check.outputs.has_changes == 'true' run: npx changeset tag - - name: Push tags - run: git push --tags + - name: Push commit and tags + if: steps.check.outputs.has_changes == 'true' + run: | + git push origin HEAD + git push --tags From 5a636b179025e50314582058cb3cec686bfb181d Mon Sep 17 00:00:00 2001 From: Jaume Capdevila Date: Wed, 18 Mar 2026 10:01:31 +0100 Subject: [PATCH 3/4] docs: add changeset --- .changeset/free-eggs-fold.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/free-eggs-fold.md diff --git a/.changeset/free-eggs-fold.md b/.changeset/free-eggs-fold.md new file mode 100644 index 0000000..d05dbb6 --- /dev/null +++ b/.changeset/free-eggs-fold.md @@ -0,0 +1,5 @@ +--- +'dropin-template': patch +--- + +Fixes the Provider to merge user-provided langDefinitions with the drop-in's default definitions, enabling label/placeholder overrides via the initializer API. From 3104c98ea78c0c77613c6314d55b3144caf1e833 Mon Sep 17 00:00:00 2001 From: Jaume Capdevila Date: Wed, 18 Mar 2026 10:03:42 +0100 Subject: [PATCH 4/4] chore(workflows): remove job names from workflow files --- .github/workflows/pr-check-changeset.yaml | 1 - .github/workflows/release.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/pr-check-changeset.yaml b/.github/workflows/pr-check-changeset.yaml index 19ddf30..5fdf6f4 100644 --- a/.github/workflows/pr-check-changeset.yaml +++ b/.github/workflows/pr-check-changeset.yaml @@ -6,7 +6,6 @@ on: jobs: check-changeset: - name: Check Changeset runs-on: ubuntu-latest if: | !github.event.pull_request.draft && diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 95449b4..6c8d2a9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,6 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: release: - name: Release runs-on: ubuntu-latest permissions: contents: write