@magicfeedback/popup-sdk 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -137,7 +137,40 @@ Config fields:
137
137
  segmentation (`segments.lang`) and for the analytics context. If omitted it is
138
138
  auto-detected from `navigator.language`, falling back to the `Intl` locale (which is
139
139
  what makes it work in React Native, where `navigator.language` does not exist). If no
140
- source resolves a language, popups with `segments.lang` cannot be filtered and are shown.
140
+ source resolves a language, popups with `segments.lang` cannot be filtered and are shown. It
141
+ is also the starting language for the popup's own texts (see below).
142
+
143
+ ### Popup texts and language
144
+
145
+ The survey content (questions, placeholders, Yes/No labels) is localized by
146
+ `@magicfeedback/native` using the language configured for the integration. The texts the SDK
147
+ itself renders around it — the footer buttons, the progress counter, the follow-up badge, the
148
+ aria-labels and the error hints — are resolved in this order:
149
+
150
+ 1. `actions.*.label` from the popup definition, whenever the platform configures it.
151
+ 2. The survey's own language (`formData.lang[0]`), applied as soon as the survey loads. A
152
+ Danish survey therefore gets a Danish footer with no extra configuration.
153
+ 3. The `language` passed to `init()` (or auto-detected), used until the survey loads.
154
+ 4. English.
155
+
156
+ Built-in languages — the 11 a survey can be authored in, plus `zh-CN`:
157
+
158
+ | | | |
159
+ |---|---|---|
160
+ | `en` English | `da` Danish | `fi` Finnish |
161
+ | `no` Norwegian (incl. `nb`/`nn`) | `es` Spanish | `sv` Swedish |
162
+ | `ar` Arabic | `bn` Bengali | `de` German |
163
+ | `pt` Portuguese | `fr` French | `zh-CN` Chinese (incl. plain `zh`) |
164
+
165
+ Region and case are ignored, so `da`, `da-DK` and `da_DK` all resolve to Danish, and `pt-BR`
166
+ and `pt-PT` share one set; any other language falls back to English. `SUPPORTED_LANGUAGES` and
167
+ `getLabels()` are exported if you need to inspect them.
168
+
169
+ Right-to-left: for Arabic the SDK stamps `dir="rtl"` on the popup container, so the header,
170
+ footer and progress bar mirror along with the survey content (which `@magicfeedback/native`
171
+ flips on its own since 2.2.22). The direction follows the same resolution chain as the texts,
172
+ and is always set explicitly — `ltr` included — so the popup never inherits the direction of
173
+ the host page.
141
174
 
142
175
  ### `autoLaunch()`
143
176