feat: Add Turkish (tr) translations#7645
Conversation
WalkthroughThis pull request adds Turkish locale support (tr-TR) across the application. Changes include: extending the locale targets in i18n configuration files, adding Turkish to the AVAILABLE_LOCALES constant and ZUserLocale type definition, registering Turkish language metadata in the application languages list, adding Turkish locale support for date formatting, and creating a new Turkish locale resource file with localized UI strings and error messages for the surveys package. The Turkish language code is mapped to the tr-TR locale in language-to-locale conversion logic. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/modules/survey/link/lib/utils.ts`:
- Line 82: The locale map in utils.ts is missing an explicit "tr-TR" entry for
consistency; update the locale mapping object (e.g., localeMap or LOCALES
constant used in utils.ts) to include the key/value pair "tr-TR": "tr-TR"
alongside the existing "tr": "tr-TR", ensuring you don’t introduce a duplicate
key and keeping the same formatting/style as other entries like "pt-BR" and
"pt-PT".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1598101e-76f7-41fd-b6b4-75dd6f3f2951
⛔ Files ignored due to path filters (1)
apps/web/locales/tr-TR.jsonis excluded by!apps/web/locales/**
📒 Files selected for processing (10)
apps/web/i18n.jsonapps/web/lib/constants.tsapps/web/lib/i18n/utils.tsapps/web/lib/time.tsapps/web/modules/survey/link/lib/utils.tsapps/web/vitestSetup.tspackages/surveys/i18n.jsonpackages/surveys/locales/tr.jsonpackages/surveys/src/lib/i18n.config.tspackages/types/user.ts
|
im happy to add it, @Dhruwang wanna get it over the finish line? |
…add-tr-translations
- Added new Turkish translations for various UI elements and error messages in the i18n files. - Updated the language support in the iso639Languages utility to include Turkish (tr-TR). - Removed outdated or unnecessary keys from the Turkish locale files to streamline translations.
Dhruwang
left a comment
There was a problem hiding this comment.
Thanks for the PR. Looks good.
What does this PR do?
Adds Turkish (tr-TR) language support to Formbricks. Translated 3,186 keys across the web app and survey components.
Files added
apps/web/locales/tr-TR.json- Web app Turkish translationspackages/surveys/locales/tr.json- Survey component Turkish translations (100%)Files modified
packages/types/user.ts- Addedtr-TRtoZUserLocaleapps/web/lib/constants.ts- Addedtr-TRtoAVAILABLE_LOCALESapps/web/lib/time.ts- Added Turkish date-fns localeapps/web/lib/i18n/utils.ts- Added Turkish toappLanguagesapps/web/i18n.json- Addedtr-TRto targetsapps/web/modules/survey/link/lib/utils.ts- Addedtr: "tr-TR"mappingapps/web/vitestSetup.ts- Addedtr-TRto mockpackages/surveys/i18n.json- Addedtrto targetspackages/surveys/src/lib/i18n.config.ts- AddedtrsupportHow should this be tested?
Checklist
Required
pnpm build(9/10 packages pass; web app requires ENCRYPTION_KEY and REDIS_URL env vars not related to translations)console.logsgit pull origin mainAppreciated