moin
moin copied to clipboard
New theme 'focus'
As mentioned on the mailing list I would like to contribute a new theme to Moin2.
This commit shows the changes to layout.html.
Screenshot 1: Sidebar and top bar
Screenshot 2: Footer
I have a question: How can I create a util.html that uses the util.html from templates but redefines some macros? I wasn't able to import my own file so I wrote the changed macros right into the layout.html.
With the last commit I changed the appearance of the modify window for the new theme:
cintek, please make your moin repo public. It is easier to clone your repo and test all your changes than it is to review and download each diff separately.
cintek, please make your moin repo public. It is easier to clone your repo and test all your changes than it is to review and download each diff separately.
The repo is at https://github.com/cintek/moin/tree/new-theme
I marked this PR as ready for preview since now the most important work is done and it would be great to read what you think about this theme. Does is fulfill your expectations for a theme?
Thanks for providing the new theme. I found some minor issues
- on the +index page the buttons are too small for the labels:
- the name of the theme should be extended to 'Focus Theme'. Then it fits to the other themes in the user settings dialog under Appearance.
- Can you change the PR to only contain one commit?
Please add your theme to: http://moinmo.in/ThemeMarket
Also check the moin2 docs to verify there is a pointer to the above theme market, and the moin2 docs have working instructions for installing a contributed theme.
Please add your theme to: http://moinmo.in/ThemeMarket
Do you mean by that that the theme mustn't be part of the moin repository, but in a separate repository?
Yes, for now. We should concentrate on fixing/improving existing code rather than adding to the code base.
Moin1.x has many contributed themes, moin 2.x should support contributed themes as well.
On Sun, Dec 17, 2023 at 2:12 PM Sebastian Wagner @.***> wrote:
Please add your theme to: http://moinmo.in/ThemeMarket
Do you mean by that that the theme mustn't be part of the moin repository, but in a separate repository?
— Reply to this email directly, view it on GitHub https://github.com/moinwiki/moin/pull/1528#issuecomment-1859285864, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGODHSK3CNFJWV4ZJUX6G3YJ5N45AVCNFSM6AAAAAA5H5Y2ZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGI4DKOBWGQ . You are receiving this because you commented.Message ID: @.***>
Thank you for the answer.
Can themes add new translations?
Not sure how a theme can add a "new translation". A theme's UI should use _('xxx') to display words and phrases, so if a new language is added all themes should support the new language without any code changes.
On Mon, Dec 18, 2023 at 7:47 AM Sebastian Wagner @.***> wrote:
Thank you for the answer.
Can themes add new translations?
— Reply to this email directly, view it on GitHub https://github.com/moinwiki/moin/pull/1528#issuecomment-1860694567, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGODHUWEKP6DYYRWTA7YTDYKBJRHAVCNFSM6AAAAAA5H5Y2ZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRQGY4TINJWG4 . You are receiving this because you commented.Message ID: @.***>
@cintek Do you think it is enough to instead of the current proposal just display a small triangle indicating a small triangle (First is the current version of the theme, the latter is without the new translation)? I don't think it is user-friendly enough and I think we need some good idea to solve that.
It should be a rare case that additional translations are required for a new theme. Maybe we can add a dummy function somewhere and include the string 'More'. For javascript there is a similar workaround with src/moin/templates/dictionary.js.
I agree that a triangle without a label is not user-friendly.
I finally understand issue. Focus theme invents a new word or phrase that needs translation, but contributed themes may not be present when python setup.py extract_messages is run so translation is not possible.
Maybe add a dummy procedure to end of /themes/__init__.py
def contributed_themes():
"""Contributed themes may add translation strings here"""
Focus_theme = _("More")
We have at least four options (I add one):
- Use only the triangle: I agree that this is not very user-friendly (especially because its such a small icon)
- Use only one icon but a different (bigger) one
- Pro: Better than 1. because easier to see and to hit with the cursor
- Con: Still no text
- Do the translation via JavaScript
- Pro: Everything belonging to the theme is in one place
- Con: Needs JavaScript enabled
- Use the function @RogerHaase mentioned: What I don't like about this solution is that the code for a contributed theme is distributed to different places - The theme with a separate repository (because it should be offered via the Theme Market) and the function which will part of the moin repository
I tend towards option 3 although it would be better if developers could just add a JSON file or something similar for translations.
A fifth option is to just use _("More") in the theme code and ignore that a tiny part of the theme is English only for now. If the theme is added to the main repo at some future date, the problem is self-correcting.
I do not understand the Javascript solution - how would that work?
Here is an example of how it could work. This way you would just need to add the attribute data-i18n to an HTML element and add a translation to the translations.js file. Of course this is a bit over-powered for just one static string so in our case I would write a shorter variant :)
Two remarks:
- We (with @cintek and @wagner-intevation ) aim to have a theme which can replace the standard default theme (because we found it lacking, so in a sense it is not about style but a usability fix to the standard interface).
- For the translation the function seems the best solution (from what I've read).