-
Notifications
You must be signed in to change notification settings - Fork 730
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
Make site title configurable via the theme hook. #11433
Make site title configurable via the theme hook. #11433
Conversation
Build Artifacts
|
Return the text of the site title, if provided by the theme. If not, the | ||
default will be returned. | ||
""" | ||
return ThemeHook.get_theme().get("siteTitle", _("Kolibri")) |
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.
My translation knowledge is shaky at best, but does this support translation of the title in the theme?
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.
As far as I understand things, yes, the theme should support translation. The theme is just a Django plugin with a hook which returns a dict of values. It should be able to call _()
on the value it returns for siteTitle
.
(That would mean we need to set up gettext support for kolibri-endless-key-theme, but that’s fairly straightforward.)
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.
This approach LGTM, thanks very much for putting it together @rtibbles 🥳
Return the text of the site title, if provided by the theme. If not, the | ||
default will be returned. | ||
""" | ||
return ThemeHook.get_theme().get("siteTitle", _("Kolibri")) |
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.
As far as I understand things, yes, the theme should support translation. The theme is just a Django plugin with a hook which returns a dict of values. It should be able to call _()
on the value it returns for siteTitle
.
(That would mean we need to set up gettext support for kolibri-endless-key-theme, but that’s fairly straightforward.)
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.
@rtibbles and I discussed the pros and cons of various approaches, and this seems like the option to go with (at least for now!)
Co-authored-by: Philip Withnall <[email protected]>
Summary
siteTitle
to allow it be configured_("Kolibri")
Kolibri
in the base.html, unsupported_browser.html and pwa manifest.json to use this template tagReferences
Fixes #10958
Reviewer guidance
This only affects the backend usages of the site title, and only standalone usages of
Kolibri
- a follow up issue will be filed to complete this work, but it would require string changes in order to accommodate fully.To test this, probably the easiest thing is to go to http://127.0.0.1:8000/ar/unsupported/ and ensure that the page title still displays as
كوليبري
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)