Hellotext.js currently imports both English and Spanish dictionaries from src/locales into Business. These strings cover branding, form validation errors, and form submission confirmations, so they are shipped in the browser bundle and generated ESM/CommonJS files regardless of the language being used.
Move these translations to the Hellotext server and include them in the existing public business response. The SDK should read the returned translations instead of bundling its own dictionaries. This reduces bundled code and allows translation updates without publishing a new SDK version.
- Store the SDK translations on the server and expose them through
API::V1::Public::BusinessSerializer, alongside the locale identifier. Limit the response to the SDK's translation keys.
- Update
Business.hydrate(), Business.setLocale(), and the Business.locale accessor to consume the response while preserving the translation access used by forms and branding.
- Preserve configured/detected locale selection and define server-side fallback behavior for unsupported locales and missing keys. Keep locale detection and date formatting in the SDK.
- Include translations wherever business metadata is embedded in form responses, since
FormCollection.add() can initialize the business from that response.
- Delete
src/locales, remove its imports, and rebuild so the generated lib/locales files and bundled dictionaries are removed.
- Update the response documentation and types. Deploy the additive server response before releasing the SDK that depends on it.
English and Spanish branding, validation errors, and submission confirmations must continue to work through both initialization paths. Record the browser bundle size before and after the change.
Hellotext.js currently imports both English and Spanish dictionaries from
src/localesintoBusiness. These strings cover branding, form validation errors, and form submission confirmations, so they are shipped in the browser bundle and generated ESM/CommonJS files regardless of the language being used.Move these translations to the Hellotext server and include them in the existing public business response. The SDK should read the returned translations instead of bundling its own dictionaries. This reduces bundled code and allows translation updates without publishing a new SDK version.
API::V1::Public::BusinessSerializer, alongside the locale identifier. Limit the response to the SDK's translation keys.Business.hydrate(),Business.setLocale(), and theBusiness.localeaccessor to consume the response while preserving the translation access used by forms and branding.FormCollection.add()can initialize the business from that response.src/locales, remove its imports, and rebuild so the generatedlib/localesfiles and bundled dictionaries are removed.English and Spanish branding, validation errors, and submission confirmations must continue to work through both initialization paths. Record the browser bundle size before and after the change.