-
-
Notifications
You must be signed in to change notification settings - Fork 222
Set up Source for translation #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 3. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
@JohnONolan Do we still have any blockers to start translating Official Themes? |
WalkthroughThis PR adds localization by replacing hard-coded UI strings with the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@private.hbs`:
- Around line 51-55: The password input lacks an accessible label—update the
template around the gh-signin form to provide one by either adding a <label>
tied to the input's id or adding an aria-label to the input_password helper; for
example ensure the input_password call includes a stable id (e.g.,
id="password") and either render <label for="password">{{t "Password"}}</label>
before it or add aria-label=(t "Password") to the input_password invocation so
screen readers can identify the field.
🧹 Nitpick comments (3)
partials/email-subscription.hbs (1)
2-4: Consider whether the email placeholder needs translation.The ARIA label and button text localization is correct. However, localizing the placeholder email address (
jamie@example.com) is uncommon—example email addresses are typically left as universal patterns since email format is the same across locales. Unless there's a specific requirement for locale-specific example names, you might consider keeping this as a static placeholder.That said, this is a minor stylistic choice and the current approach works correctly.
private.hbs (1)
31-33: Allow user zoom in the viewport meta.Disabling zoom hurts accessibility on mobile. Consider removing
user-scalable=noandmaximum-scale=1.Proposed change
- <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"> + <meta name="viewport" content="width=device-width, initial-scale=1">partials/pagination.hbs (1)
1-8: Addaria-labelon the nav andrelon prev/next links.
Improves accessibility and SEO without changing behavior.Proposed diff
-<nav class="pagination"> +<nav class="pagination" aria-label="{{t "Pagination"}}"> {{`#if` prev}} - <a class="newer-posts" href="{{page_url prev}}"><span aria-hidden="true">←</span> {{t "Newer Posts"}}</a> + <a class="newer-posts" href="{{page_url prev}}" rel="prev"><span aria-hidden="true">←</span> {{t "Newer Posts"}}</a> {{/if}} <span class="page-number">{{t "Page {page} of {totalPages}" page=page totalPages=pages}}</span> {{`#if` next}} - <a class="older-posts" href="{{page_url next}}">{{t "Older Posts"}} <span aria-hidden="true">→</span></a> + <a class="older-posts" href="{{page_url next}}" rel="next">{{t "Older Posts"}} <span aria-hidden="true">→</span></a> {{/if}} </nav>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@locales/en.json`:
- Around line 1-42: The locales/en.json contains 42 keys but only five are
actually referenced in templates ("1 min read", "% min read", "Page %", "Read
more", "Search this site"); confirm intent for the other 37 keys and either (a)
remove the unused keys from locales/en.json to avoid dead translations, (b) move
them to a separate archive or documentation file (e.g., unused_locale_keys.json)
if you want to keep them for future features, or (c) add a clear comment/README
entry describing which keys are intentionally retained for planned features;
update the file so it only contains the five active keys (above) or clearly
marks retained keys and their purpose.
🧹 Nitpick comments (2)
locales/en.json (2)
17-18: Clarify the purpose of two different "Page" translation keys.There are two "Page" related keys with different placeholder patterns:
"Page {page} of {totalPages}"- uses named placeholders"Page %"- uses single unnamed placeholderIf both are needed for different contexts (e.g., full pagination vs. abbreviated), this is fine. However, if they serve the same purpose, consider consolidating to avoid translator confusion.
11-11: Example email as translation key is unconventional but acceptable.Using
jamie@example.comas a key works for placeholder text, but translators may find it confusing since it looks like actual content rather than a UI string pattern. Consider using a more descriptive key like"email placeholder"if Ghost's translation system supports it, or document its purpose for translators.
fix meta title pagination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR includes t wrapping of (I think) all text strings in Source.
Note
Low Risk
Mostly template-string changes to enable Ghost theme i18n; risk is limited to potential missing/incorrect translation keys causing odd labels or title formatting.
Overview
Sets up theme internationalization by adding
locales/en.jsonand wrapping previously hardcoded UI strings across templates/partials with the{{t}}helper (navigation, footer, featured/posts lists, search, lightbox, and subscription form).Updates a few dynamic strings to use translated variants/formatting, including
meta_titlepagination text,reading_timesingular/plural labels, and the footer “Powered by …” string via an interpolatedghostlink.Written by Cursor Bugbot for commit 14d533c. This will update automatically on new commits. Configure here.