Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.2
0.6.3
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@respondkit/api",
"version": "0.6.2",
"version": "0.6.3",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion apps/native-example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@respondkit/native-example",
"version": "0.6.2",
"version": "0.6.3",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@respondkit/web",
"version": "0.6.2",
"version": "0.6.3",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion apps/widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@respondkit/widget-playground",
"version": "0.6.2",
"version": "0.6.3",
"private": true,
"type": "module",
"scripts": {
Expand Down
23 changes: 23 additions & 0 deletions docs/releases/0.6.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# RespondKit 0.6.3

Status: prepared, not published. A merged PR does not publish SDK artifacts.

## Release notes

The shared client catalog is translated. The strings 0.6.2 moved into `localization/messages` now show in the user's language on iOS, Android, web and React Native: the empty state, the "Ask us anything" subtitle and the attach menu.

- **51 locales.** ar, bg, bn, ca, cs, da, de, el, es, et, fi, fil, fr, fr-CA, gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, ms, nb, nl, or, pa, pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, ur, vi, zh-Hans and zh-Hant. This is ReceiptGenie's shipped set, which also covers Captioner and SubPorter. Every key in the catalog is translated, not only the three surfaces that read it today. Other views still use English literals.
- **Locale fallbacks.** Web and React Native map legacy codes (`iw`, `in`, `tl`, `no`), choose Traditional Chinese for `zh-TW`, `zh-HK` and `zh-MO`, send Portuguese outside Brazil to `pt-PT`, reduce regional variants to the base language, and fall back to English. iOS uses Foundation's matching. On Android, Hebrew and Indonesian ship as `values-iw` and `values-in`, the codes Android still reports, and Bokmål also ships as `values-no`.
- **Web without a host locale.** When `context.locale` is unset, the web widget now reads the catalog and formats transcript dates using the browser language. Before, it used English.

## Upgrade and compatibility

Use `0.6.3` for the npm packages, `v0.6.3` for SwiftPM and `0.6.3` for Maven. No API or protocol change.

- iOS: the host app must declare a language for RespondKit's strings to show in it (ReceiptGenie declares all 51).
- Android hosts that override RespondKit strings for Hebrew or Indonesian must place the overrides in `values-iw` or `values-in`.

## Operator checklist

1. Publish GitHub release `v0.6.3`, which runs the npm publish workflow. Publish Maven Central per `docs/native/releases.md`.
2. Point ReceiptGenie at 0.6.3.
31 changes: 31 additions & 0 deletions docs/worklog/RK-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# RK-3 — SDK 0.6.3: translate the client catalog

2026-10-16 · developer

Added `localization/messages/{locale}.json` for ReceiptGenie's 51 shipped locales. Every one of the 64 keys is translated, with plural branches per CLDR category. The generator now writes them for SwiftPM, Compose, web and React Native. Release 0.6.3 is prepared, not published.

## Locale selection

- Web and React Native share the generated `messages(locale)`. It now parses the subtags itself, because Hermes has no `Intl.Locale`. It maps `iw`, `in`, `tl` and `no`, infers the Chinese script from the region, sends Portuguese outside Brazil to `pt-PT`, ignores `-u-` extensions and falls back to English. The web widget uses the browser language when the host sends no `context.locale`.
- iOS keeps Foundation's matching. A table test runs `Bundle.preferredLocalizations` against the compiled catalog.
- Android: the emulator test showed that `values-he` and a bare `no` resolve to English. The Android compiler now writes `values-iw` and `values-in` (the legacy codes `java.util.Locale` reports) and a `values-no` copy of Bokmål. It also keeps a Hebrew `many` quantity, which older Android ICU and lint still expect.

## Tests

- iOS: the example app's XCUITest runs the app in ja and zh-Hans. It checks the subtitle and empty state, then opens the attach Menu. The example declares the catalog's languages in `Info.plist`.
- Swift `LocalizationTests` (macOS only, because `Process` is unavailable on iOS): 23 device-language fallbacks through `Bundle.preferredLocalizations`. `swift build` copies `.xcstrings` uncompiled, so the test compiles it with `xcstringstool`.
- Compose `LocalizedScreenTest`: a test activity applies the locale to its base context, the same way per-app locales do. It renders the screen in ja and zh-Hans and opens the real attach dropdown. `RespondKitScreenTest` keeps the fallback table.
- Web: widget renders in ja and zh-Hans, plus the browser-language fallback and a 28-case resolver table. A `renderToString` + `hydrateRoot` test guards against a hydration mismatch. The browser language is read through `useSyncExternalStore` with no server snapshot.
- React Native: `RespondKitScreen` rendered with `react-dom/server` and shimmed primitives in ja and zh-Hans. The test also opens the attach `Alert`.

## Verification

- `pnpm ready`: passed (vp check, release tests, localization:check, 445 package tests, builds).
- `swift test`: 26 tests passed. `xcodebuild -scheme RespondKit-Package` on the iOS simulator: test build succeeded, 24 tests passed.
- `xcodebuild test` of the example app's XCUITest on an iPhone 17 simulator, with `native/examples/demo_server.py` running: passed.
- `native/android/gradlew -p native/android :core:test :compose:assembleDebug :compose:lintRelease :example:assembleDebug`: passed, lint 0 errors.
- `:compose:connectedDebugAndroidTest` on emulator-5554 (API 36): 9/9 passed.

Review RK-4 (changes requested at b352504) is addressed in the follow-up commits: web hydration, the iOS test build, and native screen and menu coverage.

Translations were drafted by parallel agents from a shared key-context guide. Each file was validated for keys, placeholders and plural categories. No native-speaker review has been done yet.
8 changes: 7 additions & 1 deletion localization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ pnpm localization:check

The generator writes `native/swift/Sources/RespondKitUI/Resources/RespondKit.xcstrings` (the SwiftPM resource of `RespondKitUI`) `generated/android/res/values*/strings.xml` (a resource directory of the Compose module), and one TypeScript module copied to `packages/react/src/widget/messages.ts` and `packages/react-native/src/messages.ts`. Commit the outputs with the JSON changes. `pnpm ready` fails if an output is missing, modified, or left behind after removing a locale. Generated files belong to this pipeline; edits in Xcode or Android Studio must be made in JSON instead. No translation services run during compilation.

Every client reads the empty state, the "Ask us anything" subtitle and the attach menu from the generated output, and Compose also reads its closed-conversation strings from it. Other views still use English literals. The web widget picks its catalog from the host's `context.locale`, React Native from the device locale; both fall back to the closest shipped locale, then English. The catalog is English only, so adding a language means adding it to `settings.json` with a complete `messages/{locale}.json`.
Every client reads the empty state, the "Ask us anything" subtitle and the attach menu from the generated output, and Compose also reads its closed-conversation strings from it. Other views still use English literals. The catalog ships ReceiptGenie's 51 app locales plus English. Adding a language means adding it to `settings.json` with a complete `messages/{locale}.json`.

Locale selection per client:

- iOS uses the app's language through the SwiftPM bundle, so the host app must list the language among its own localizations. Foundation matches regional and legacy tags (`zh-TW` to `zh-Hant`, `iw` to `he`, `no` to `nb`, `pt-AO` to `pt-PT`).
- Android uses the activity's resource configuration. Android still reports Hebrew and Indonesian as `iw` and `in`, so those catalogs are generated as `values-iw` and `values-in`. Bokmål is also written to `values-no`.
- The web widget uses the host's `context.locale`, else the browser language. React Native uses the device locale. Both use the generated `messages(locale)`, which maps legacy codes (`iw`, `in`, `tl`, `no`), infers the Chinese script from the region (`TW`, `HK` and `MO` read Traditional), sends Portuguese outside Brazil to `pt-PT`, strips regions down to the base language, and falls back to English.

## Portable message contract

Expand Down
89 changes: 89 additions & 0 deletions localization/generated/android/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated from Paraglide JSON. Edit the source catalogs. -->
<resources>
<string name="respondkit_another_message" formatted="false">"إرسال رسالة أخرى"</string>
<string name="respondkit_ask_anything" formatted="false">"اسألنا عن أي شيء"</string>
<string name="respondkit_attach_files" formatted="false">"إرفاق ملفات"</string>
<string name="respondkit_attached_files" formatted="false">"الملفات المرفقة"</string>
<string name="respondkit_cancel" formatted="false">"إلغاء"</string>
<string name="respondkit_close" formatted="false">"إغلاق"</string>
<string name="respondkit_close_chat" formatted="false">"إغلاق دردشة الدعم"</string>
<string name="respondkit_closed" formatted="false">"مغلقة"</string>
<string name="respondkit_closed_help" formatted="false">"تم إغلاق هذه المحادثة."</string>
<string name="respondkit_confirming" formatted="false">"جارٍ التأكيد…"</string>
<string name="respondkit_connecting" formatted="false">"لا يزال الدعم قيد الاتصال."</string>
<string name="respondkit_conversation">"محادثة %1$s"</string>
<string name="respondkit_conversations" formatted="false">"المحادثات"</string>
<plurals name="respondkit_conversations_unread">
<item quantity="zero">"المحادثات · %1$d غير مقروءة"</item>
<item quantity="one">"المحادثات · %1$d غير مقروءة"</item>
<item quantity="two">"المحادثات · %1$d غير مقروءتين"</item>
<item quantity="few">"المحادثات · %1$d غير مقروءة"</item>
<item quantity="many">"المحادثات · %1$d غير مقروءة"</item>
<item quantity="other">"المحادثات · %1$d غير مقروءة"</item>
</plurals>
<string name="respondkit_email_address" formatted="false">"عنوان البريد الإلكتروني"</string>
<string name="respondkit_email_failed" formatted="false">"تعذّر حفظ بريدك الإلكتروني. يُرجى التحقق منه والمحاولة مرة أخرى."</string>
<string name="respondkit_email_prompt" formatted="false">"على أي بريد إلكتروني نرسل إليك الرد؟"</string>
<string name="respondkit_failed" formatted="false">"فشل"</string>
<string name="respondkit_file_open_failed" formatted="false">"تعذّر فتح الملف المحدد."</string>
<string name="respondkit_files" formatted="false">"الملفات"</string>
<string name="respondkit_help" formatted="false">"كيف يمكننا مساعدتك؟"</string>
<string name="respondkit_history_failed" formatted="false">"تعذّر تحميل سجل المحادثة. اضغط على «المزيد» للمحاولة مرة أخرى."</string>
<string name="respondkit_identity_changed" formatted="false">"تغيّرت هوية الدعم في علامة تبويب أخرى. أعد الاتصال لإعادة تحميل حسابك."</string>
<string name="respondkit_intro" formatted="false">"أرسل رسالة وأبقِ هذه الصفحة مفتوحة لتلقي رد سريع."</string>
<string name="respondkit_intro_short" formatted="false">"أرسل رسالة لبدء محادثة."</string>
<string name="respondkit_latest" formatted="false">"أحدث الرسائل"</string>
<string name="respondkit_loading" formatted="false">"جارٍ التحميل…"</string>
<string name="respondkit_loading_messages" formatted="false">"جارٍ تحميل الرسائل"</string>
<string name="respondkit_message" formatted="false">"الرسالة"</string>
<string name="respondkit_messages_failed" formatted="false">"تعذّر تحميل الرسائل الجديدة."</string>
<string name="respondkit_more" formatted="false">"المزيد"</string>
<string name="respondkit_new_conversation" formatted="false">"محادثة جديدة"</string>
<plurals name="respondkit_new_count">
<item quantity="zero">"%1$d جديدة"</item>
<item quantity="one">"%1$d جديدة"</item>
<item quantity="two">"%1$d جديدتان"</item>
<item quantity="few">"%1$d جديدة"</item>
<item quantity="many">"%1$d جديدة"</item>
<item quantity="other">"%1$d جديدة"</item>
</plurals>
<string name="respondkit_open" formatted="false">"مفتوحة"</string>
<string name="respondkit_open_chat" formatted="false">"فتح دردشة الدعم"</string>
<string name="respondkit_photo_library" formatted="false">"مكتبة الصور"</string>
<string name="respondkit_picker_failed" formatted="false">"تعذّر فتح منتقي الملفات"</string>
<string name="respondkit_ready" formatted="false">"جاهز"</string>
<string name="respondkit_reconnect" formatted="false">"إعادة الاتصال"</string>
<string name="respondkit_reconnect_upload" formatted="false">"أعد الاتصال قبل الرفع."</string>
<string name="respondkit_remove" formatted="false">"إزالة"</string>
<string name="respondkit_remove_file">"إزالة %1$s"</string>
<string name="respondkit_request_failed" formatted="false">"فشل طلب الدعم."</string>
<string name="respondkit_retry" formatted="false">"إعادة المحاولة"</string>
<string name="respondkit_retry_message" formatted="false">"إعادة إرسال الرسالة"</string>
<string name="respondkit_return" formatted="false">"ستظهر الردود هنا عند عودتك إلى التطبيق."</string>
<string name="respondkit_save_email" formatted="false">"حفظ البريد الإلكتروني"</string>
<string name="respondkit_saving" formatted="false">"جارٍ الحفظ…"</string>
<string name="respondkit_selected_file" formatted="false">"الملف المحدد"</string>
<string name="respondkit_send" formatted="false">"إرسال"</string>
<string name="respondkit_send_message" formatted="false">"إرسال الرسالة"</string>
<string name="respondkit_sending" formatted="false">"جارٍ الإرسال…"</string>
<string name="respondkit_sent" formatted="false">"تم الإرسال"</string>
<string name="respondkit_session_expired" formatted="false">"انتهت جلسة الدعم. أعد الاتصال للمتابعة."</string>
<plurals name="respondkit_show_new">
<item quantity="zero">"عرض %1$d رسالة جديدة"</item>
<item quantity="one">"عرض %1$d رسالة جديدة"</item>
<item quantity="two">"عرض %1$d رسالتين جديدتين"</item>
<item quantity="few">"عرض %1$d رسائل جديدة"</item>
<item quantity="many">"عرض %1$d رسالة جديدة"</item>
<item quantity="other">"عرض %1$d رسالة جديدة"</item>
</plurals>
<string name="respondkit_sign_in_again" formatted="false">"سجّل الدخول مرة أخرى لاستعادة سجل الدعم."</string>
<string name="respondkit_start_failed" formatted="false">"تعذّر بدء دردشة الدعم."</string>
<string name="respondkit_support" formatted="false">"الدعم"</string>
<string name="respondkit_support_messages" formatted="false">"رسائل الدعم"</string>
<string name="respondkit_try_again" formatted="false">"حاول مرة أخرى"</string>
<string name="respondkit_unknown" formatted="false">"لم يتم التأكيد — يمكنك إعادة المحاولة بأمان"</string>
<string name="respondkit_unread" formatted="false">"رد غير مقروء من الدعم"</string>
<string name="respondkit_upload_failed" formatted="false">"فشل الرفع"</string>
<string name="respondkit_write_message" formatted="false">"اكتب رسالة…"</string>
</resources>
Loading
Loading