Skip to content

Pull in all files from /translations directory.#33

Open
ryandberger wants to merge 7 commits intomainfrom
import_translations
Open

Pull in all files from /translations directory.#33
ryandberger wants to merge 7 commits intomainfrom
import_translations

Conversation

@ryandberger
Copy link
Copy Markdown
Member

  • Mostly AI-generated code to solve a few issues:
    • Pull in all JSON files from /translations.
    • Allow async calls from root.
    • Provide an alternative path for unit tests to succeed.

@ryandberger ryandberger requested a review from a team as a code owner April 14, 2026 01:23
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 14, 2026

Jest Unit Test Results

288 tests  +2   288 ✅ +2   22s ⏱️ ±0s
 27 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit acaebbb. ± Comparison against base commit 65e36c0.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
loadTranslations should return empty object when locale and default locale have no translations ‑ loadTranslations should return empty object when locale and default locale have no translations
loadTranslations should handle empty locale string gracefully ‑ loadTranslations should handle empty locale string gracefully
loadTranslations should load translations for different locales ‑ loadTranslations should load translations for different locales
loadTranslations should return translations object even for unknown locale ‑ loadTranslations should return translations object even for unknown locale

♻️ This comment has been updated with latest results.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
40.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@ryandberger
Copy link
Copy Markdown
Member Author

Quality Gate Failed Quality Gate failed

Failed conditions 40.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Note that code coverage is lower since one of the files with the .vite extension cannot be mocked, so there's an alternative path for unit tests to take.

@JohnC-80
Copy link
Copy Markdown
Contributor

JohnC-80 commented Apr 27, 2026

@ryandberger Rather than having the test suite dictate the shape of the code, would it be feasible to avoid the top-level await and create a wrapper <App> component that could load translations when it mounts, then pass them into its IntlProvider child? That seems like the way this would ordinarily be accomplished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants