Repository navigation
feat(WL-572): introduces new locale format - #34
Merged
Merged
Conversation
DanielAraldi
marked this pull request as draft
October 13, 2026 13:59
DanielAraldi
marked this pull request as ready for review
October 13, 2026 18:10
Contributor
|
🎉 This PR is included in version 3.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
This PR introduces a new locale format. Translations now live in JavaScript as typed
Localeobjects, not in native resource files.Before this change,
setLocaletook a language code ('pt-BR','es', ...). Native code then loaded the matchingfacetec-strings.xml(Android) orFaceTec-<lang>.strings(iOS) file.setDynamicStringsandresetDynamicStringschanged the strings separately. Two APIs controlled the same UI text, and both platforms carried 13 copies of the translation files.Now
setLocalereceives aLocaleobject. The library exports a complete object for each supported language:af,ar,de,el,en,es,fr,ja,kk,nb,ptBR,ru,viandzh. To customize strings, spread one of these objects and override the strings you want to change. CallingsetLocale()without arguments resets the strings toen. Internally,setLocaleforwards the object to the nativesetDynamicStringsmethod.💥 What was changed?
setLocale('pt-BR')setLocale(ptBR)setLocale('default')setLocale()orsetLocale(en)setDynamicStrings(strings)setLocale({ ...en, ...strings })resetDynamicStrings()setLocale()type Locale(union of language codes)interface Locale(strings object)DynamicStrings*interfacesLocale*(e.g.LocaleAction)✅ Checklist
Public API change:
setLocalesignature changed, andsetDynamicStrings,resetDynamicStringsand theDynamicStringstypes were removed. Consumers must migrate (see table above).📱 React Native
src/locales/with one typedRequired<Locale>object per language, exported from the package root.Localecode union with theLocalestrings interface; renamed allDynamicStrings*interfaces toLocale*.setLocale(locale?: Locale)now sends the object to nativesetDynamicStrings, withenas fallback.setDynamicStringsandresetDynamicStringsfrom the public API andsetLocale/resetDynamicStringsfrom the TurboModule spec (NativeAzifaceMobile.ts).exampleandexamples/expoappto the new API (newLocaleTypetype,LOCALESmap of locale objects).examples/expoappnow depends on@azify/aziface-mobile@*.examplesfromtsconfig.build.json.README.mdanddocs/DYNAMIC_STRINGS.md.🤖 Android
setLocale,resetDynamicStringsandsetupI18nfromAzifaceMobileModule.java.i18n/Localization.java.values-<lang>/facetec-strings.xmlresource files.🍎 iOS
setLocale,resetDynamicStringsandsetupI18nfromAziface.swiftandAzifaceMobile.mm.I18n/Localization.swift.FaceTec-<lang>.stringsfiles.example/ios/Podfile.lock.🧪 Testing Notes
exampleorexamples/expoappapp and initialize the SDK.liveness). Check that the UI text matches the selected language.🔗 Related Issues / Tickets
📸 Evidence (Optional)
setDynamicStringsmethod is unchanged; it is now the only path for setting UI text..strings) and the newsrc/locales/*.tsfiles.exampleandexamples/expoappapps keep a localLocaleTypeunion for their language picker. The library no longer exports a language-code type.