Skip to content

feat: Add translation support for motd#154

Draft
theMimolet wants to merge 11 commits intoprojectbluefin:mainfrom
theMimolet:translatable-motd
Draft

feat: Add translation support for motd#154
theMimolet wants to merge 11 commits intoprojectbluefin:mainfrom
theMimolet:translatable-motd

Conversation

@theMimolet
Copy link
Contributor

Hi !

I was wondering to myself if it was possible to add translations to the motd.
So I tested a bit, and here you go ! 👍

It's still a draft PR because I still need to fully translate it in french (ofc) and I'm not sure about my changes in env.sh.

Any feedback is welcome ! 😄
(Of course, if it works out here, it will also be added to Bazzite and Aurora)

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces translation support for the MOTD, starting with French. The implementation involves determining the system language and loading the appropriate template and tips files. The changes look good overall, but I found a critical issue in env.sh where a relative path is used to find the list of available languages. This will cause the language detection to always fall back to English. I've left a specific comment with a suggested fix to address this.

@theMimolet
Copy link
Contributor Author

Here's what the updated version contains :

  • a new /lang folder for translations, it uses .json files (like the website)
  • the /tips folder now also contains the tips in different languages
  • ublue-motd has seen big additions to support the string based translations

Basically it will get the user's language code, check if a file for it already exist, retrieve the strings, retrieve one random tip (from the user's language code) and then finally renders the motd.

@theMimolet theMimolet changed the title feat: Add translation support for motd (WIP) feat: Add translation support for motd Mar 4, 2026
@theMimolet theMimolet marked this pull request as ready for review March 4, 2026 11:05
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. area/bling Anything to do with motd, terminal bling, charm and gum things kind/enhancement New feature, don't implement without a spec and consensus labels Mar 4, 2026
Copy link

@ledif ledif left a comment

Choose a reason for hiding this comment

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

At a quick glance, this looks good. I haven't tested it, but it seems like it should work. I'd be more comfortable approving if someone could test it.

@theMimolet
Copy link
Contributor Author

I tested it in as it's own thing in its own folder and it worked perfectly
But I agree it would be better to have it tested on the real thing :/

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you accidentally stripped the executable bit somewhere down the line

Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@renner0e
Copy link
Contributor

renner0e commented Mar 4, 2026

So what happens if the original is changed, shouldn't it override the outdated translation then in the markdown files?

I fear this thing as a whole could become difficult to maintain in the future, which was our overall goal by moving here in the first place.

EDIT: Don't get me wrong, I like the overall goal of this but perhaps this should just be using standard tooling like gnu gettext where this problem is solved

@theMimolet theMimolet marked this pull request as draft March 4, 2026 19:30
@theMimolet
Copy link
Contributor Author

Well those are really just plain old json files..
I'll do some more research on gettext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/bling Anything to do with motd, terminal bling, charm and gum things kind/enhancement New feature, don't implement without a spec and consensus size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants