Repository navigation
add i18n support - #6796
add i18n support#6796benedikt-bartscher wants to merge 150 commits into
Conversation
Merging this PR will degrade performance by 4%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
[High impact] The latest change appears safe to merge. SummaryAdds optional internationalization through
Reviews (91) · Last reviewed commit: "chore(i18n): drop the TODO about dev flo..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b9a5f5342
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@masenf could you please take a brief look at this from an architectural design and DX perspective? it's totally okay if you have smth completly different in mind |
masenf
left a comment
There was a problem hiding this comment.
@benedikt-bartscher thanks for adding this and sorry for the review back-up. i did an initial look and i think the added extension points make sense and the API feels nice.
one potential issue i see affects SEO performance of the SSG static versions of the site -- since the translation depends on state, other languages might not be indexable by crawlers.
e68fb65 to
3e540c0
Compare
…Ls of prerendered nested pages
… content into its locale
…ranslated with the read-only flag
… without wrapping or line numbers
There was a problem hiding this comment.
2 issues found across 14 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/reflex-i18n/src/reflex_i18n/plugin.py">
<violation number="1" location="packages/reflex-i18n/src/reflex_i18n/plugin.py:202">
P2: Plain page metadata strings are translated here without registering their msgids, so the catalog compiler does not include them in the generated catalogs. Register these metadata messages during evaluation (or otherwise include them in catalog extraction) so newly added titles, descriptions, and meta content receive translations through the normal i18n workflow.</violation>
</file>
<file name="packages/reflex-i18n/src/reflex_i18n/cli.py">
<violation number="1" location="packages/reflex-i18n/src/reflex_i18n/cli.py:399">
P2: `_CREATION_DATE_RE` is applied to the entire PO file, not just its header. A multiline message with a continuation line matching `POT-Creation-Date: ...` can therefore make `_write_catalog` return without writing a changed catalog; restrict the date normalization to the header block before comparing.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…al_page_scope hook
There was a problem hiding this comment.
1 issue found across 16 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/reflex-i18n/src/reflex_i18n/catalog.py">
<violation number="1" location="packages/reflex-i18n/src/reflex_i18n/catalog.py:297">
P2: This parameter promises to accept arbitrary `Mapping` implementations, but `json.dumps` only handles concrete dictionaries here. Convert the outer and nested mappings to dictionaries before serialization, or narrow the annotation to `dict`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…es out by directory, not by message
…p marks them with
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
… paths case-insensitively and never redirect another page's URL
There was a problem hiding this comment.
All reported issues were addressed across 14 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…canning them per call
…h unless it is None
… its own page instead of one shared by all
…se workflow lifts
closes #2339