Repository navigation
feat: add arabic to the shared contact page - #40
Merged
Merged
Conversation
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
WitnessWork is adding Arabic as its first right-to-left language (app PR: leviFrosty/witness-work, the
rtl-arabicbranch). This is the backend part: the shared-contact page (/cand legacy/c/<payload>) now has Arabic text.contactLinkLocales.ts: adds anarentry. Like the app, there is one Arabic for every country, so the key has no region.matchLocalenow also matches a key that is just the language, soar,ar-SAandar-EG(from?lang=orAccept-Language) resolve toar.contactLink.ts: right-to-left locales render<html lang="ar" dir="rtl">. Other locales are unchanged.og:localefor Arabic isar_AR, the code Open Graph uses for Arabic.dir="rtl", plus Accept-Language negotiation forar,ar-EGandxx, AR-sa;q=0.6.The app never sends
langon contact links, so the recipient's browser language decides. Without this change, Arabic browsers get the English page. That works, but it's a gap for an Arabic launch.Verification
pnpm vitest run: 56 files, 725 tests passed.pnpm typecheckis clean.verify-ww-api:node scripts/verify/dev.mjs up --persist-to /tmp/ww-verify-arabic, thendoctorwas all ok. Over HTTP:GET /cwithAccept-Language: ar-SA,ar;q=0.9returned200withContent-Language: ar,<html lang="ar" dir="rtl">,<title>افتح جهة الاتصال هذه في WitnessWork</title>andog:localear_AR.GET /cwithAccept-Language: en-USstill returned<html lang="en-us">(nodir).Land this on
mainbefore the app's Arabic PR ships, per the app's release order (scripts/release-api.sh).