Skip to content

Conversation

aarondemelo
Copy link
Contributor

@aarondemelo aarondemelo commented Aug 1, 2025

Added localization support to swift sdk targeting Text Images and Data Binding.
Users will have to specify localization for the pages/sections or leaving blank set it as "Default".
Every change to locale will trigger the content API call with the new values of locale thus refreshing the page.

*Added a fix to enable rendering of HTML lists OL LI in the text field. An issue with iOS 18 update needed it to be defined.

Example for images and text. Change is between french and english

Simulator.Screen.Recording.-.iPhone.16.-.2025-08-06.at.16.52.51.mov

Example of data binding Again french video list has different video links.

Simulator.Screen.Recording.-.iPhone.16.-.2025-08-06.at.16.51.55.mov

HTML List view Rendering in Text

Simulator Screenshot - iPhone 16 - 2025-08-06 at 16 45 55

@aarondemelo aarondemelo requested a review from a team as a code owner August 1, 2025 15:12
Copy link

@kylefowler kylefowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for localization, id expect us to have to send the locale to the backend, which then makes decisions about what to return. its a user attributes / targeting feature. I think its done differently in the other sdks?

apiKey: apiKey,
url: resolvedUrl,
locale: "",
locale: nil, //Always send to nil so as to get all options to allow for local changes without requiring an API call

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its ok to make another API call. User properties are part of targeting and the content api may not return the correct content if locale is not passed and the targeting attributes are not accurate. locale also really shouldnt change at any point after the app is launched (it may, but if the screen isnt immediately reactive to it thats fine)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post discussions with @sanyamkamat aligned implementations with React.

Skipping locale in the Request was an additional step from me to reduce network calls in the sdk.
I will revert the change and pass locale if set by the user or Default. locale: locale ?? "Default"

Every subsequent change in locale will trigger a request.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locale is now passed in the content api as well as if required in the data binding http requests.

@sanyamkamat sanyamkamat merged commit 25b4acb into BuilderIO:main Aug 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants