Skip to content
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

Allow configuring logos for multiple languages #1292

Open
wants to merge 10 commits into
base: next
Choose a base branch
from

Conversation

owi92
Copy link
Member

@owi92 owi92 commented Dec 9, 2024

This will make it possible to configure logos for any number of languages (though for now, Tobira only knows what to do with english, german and non-language-specific logos).

This is a breaking change, as it changes the way logo files are configured. Previous configurations won't work anymore.
Specifics and examples for the new configuration will be available in our docs.

Closes #1271

@owi92 owi92 added changelog:breaking Breaking changes changelog:admin Changes primarily for admins labels Dec 9, 2024

This comment has been minimized.

@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 9, 2024 11:54 Destroyed
@owi92 owi92 force-pushed the logo-language-switch branch from 187ca44 to 8f5530d Compare December 9, 2024 12:41

This comment has been minimized.

@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 9, 2024 12:43 Destroyed
@owi92 owi92 force-pushed the logo-language-switch branch from 8f5530d to 827701c Compare December 10, 2024 10:11
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 10, 2024 10:16 Destroyed
@owi92 owi92 force-pushed the logo-language-switch branch from 827701c to 4284ab7 Compare December 10, 2024 11:16
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 10, 2024 11:18 Destroyed
@owi92 owi92 force-pushed the logo-language-switch branch from 4284ab7 to c2a568c Compare December 11, 2024 14:00
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 11, 2024 14:03 Destroyed
@owi92 owi92 force-pushed the logo-language-switch branch from c2a568c to 9804557 Compare December 11, 2024 14:57
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 11, 2024 14:59 Destroyed
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some things I would change about the backend implementation, I believe this can be implemented in less code. And I also would add a different check. I have not fully reviewed the frontend yet, as it might be useful to wait for the backend changes to properly assess how to best implement the frontend.

docs/docs/setup/config.toml Outdated Show resolved Hide resolved
backend/src/config/theme.rs Outdated Show resolved Hide resolved
backend/src/http/assets.rs Outdated Show resolved Hide resolved
backend/src/http/assets.rs Outdated Show resolved Hide resolved
backend/src/http/assets.rs Outdated Show resolved Hide resolved
backend/src/config/theme.rs Outdated Show resolved Hide resolved
.deployment/templates/config.toml Outdated Show resolved Hide resolved
util/dev-config/config.toml Outdated Show resolved Hide resolved
util/dev-config/config.toml Outdated Show resolved Hide resolved
docs/docs/setup/theme.md Show resolved Hide resolved
@owi92 owi92 force-pushed the logo-language-switch branch from 9804557 to 600137d Compare December 18, 2024 14:50
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 18, 2024 14:53 Destroyed
@owi92 owi92 force-pushed the logo-language-switch branch from 600137d to 27de244 Compare December 18, 2024 23:18
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 18, 2024 23:21 Destroyed
@owi92
Copy link
Member Author

owi92 commented Dec 18, 2024

I did most of the things you commented on. I still need to do what you suggested in #1292 (comment), and contrary to what I said earlier, I would really appreciate if you could tackle the validation logic as laid out in #1292 (comment).

Edit: Another thing I still need to address after the latest changes: The code as is right now doesn't know what to do when a wildcard ("*") is present in the logo config.

backend/src/http/assets.rs Outdated Show resolved Hide resolved
backend/src/http/assets.rs Outdated Show resolved Hide resolved
frontend/src/config.ts Outdated Show resolved Hide resolved
@owi92 owi92 force-pushed the logo-language-switch branch from 27de244 to e60b7bc Compare December 19, 2024 12:37
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 19, 2024 12:42 Destroyed
backend/src/config/translated_string.rs Outdated Show resolved Hide resolved
backend/src/config/translated_string.rs Outdated Show resolved Hide resolved
This will allow admins to configure logos in any number of
languages, each with the optional properties of size (wide/narrow)
and mode (light/dark). The language prop can also be omitted, in
which case the respective logo will be used for all languages.
They now use the new configuration "syntax" for
our logos.
This will now change the logo based on current language,
if applicable logos exist.
@owi92 owi92 force-pushed the logo-language-switch branch from e60b7bc to 1fb48ca Compare December 19, 2024 13:21
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 19, 2024 13:24 Destroyed
LukasKalbertodt and others added 3 commits December 19, 2024 15:10
This is a bit more explicit and flexible than the previous solution
where `en` was always the default. Sadly, this is a breaking change for
the configuration. In most cases, migrating is just replacing `en` with
`default`.
This makes sure for every case/situation there is exactly one logo
defined.
@github-actions github-actions bot temporarily deployed to test-deployment-pr1292 December 19, 2024 15:31 Destroyed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:admin Changes primarily for admins changelog:breaking Breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants