[PR #898] [CLOSED] [WIP] Language support #1220

Closed
opened 2026-01-29 16:26:08 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/SabreTools/MPF/pull/898
Author: @Deterous
Created: 10/13/2025
Status: Closed

Base: masterHead: master


📝 Commits (10+)

📊 Changes

7 files changed (+202 additions, -39 deletions)

View changed files

📝 MPF.UI/App.xaml.cs (+16 -0)
MPF.UI/Resources/Strings.ko.xaml (+40 -0)
MPF.UI/Resources/Strings.xaml (+40 -0)
📝 MPF.UI/UserControls/LogOutput.xaml (+2 -2)
📝 MPF.UI/Windows/MainWindow.xaml (+50 -31)
📝 MPF.UI/Windows/MainWindow.xaml.cs (+52 -4)
📝 publish-nix.sh (+2 -2)

📄 Description

Can't seem to figure out what's wrong, @mnadareski hope you can see in the changes tab what my idea is for adding language support. Maybe you're able to figure out how to implement this idea (no need to dev on my test branch).

I also have an idea for adding a little drop down in the UI menu bar. It's not wired in, but the idea is that UI language option shouldn't be hidden away in Options window because that requires navigating to it (in English).

More info:
https://learn.microsoft.com/en-us/windows/apps/develop/platform/xaml/xaml-resource-dictionary

Implementation for changing UI languages (when wired into the ComboBox):

public void ChangeLanguage(string languageCode)
{
    var dictionary = new ResourceDictionary();
    switch (languageCode)
    {
        case "EN":
            dictionary.Source = new Uri("../Resources/Strings.xaml", UriKind.Relative);
            break;
        case "한글":
            dictionary.Source = new Uri("../Resources/Strings.ko.xaml", UriKind.Relative);
            break;
        default:
            dictionary.Source = new Uri("../Resources/Strings.xaml", UriKind.Relative);
            break;
    }
    Application.Current.Resources.MergedDictionaries.Add(dictionary);
}


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/SabreTools/MPF/pull/898 **Author:** [@Deterous](https://github.com/Deterous) **Created:** 10/13/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`79f809a`](https://github.com/SabreTools/MPF/commit/79f809a50c5bcd9fc359f368375e5c84da5e4bbd) Test using resources - [`b01af2e`](https://github.com/SabreTools/MPF/commit/b01af2efad9f43e7d23f7aec458617ae4b401596) Include system namespace in resource xaml - [`cdf115a`](https://github.com/SabreTools/MPF/commit/cdf115a172dd92903c2f423ea41518a5fd10552b) system namespace name - [`ae442e5`](https://github.com/SabreTools/MPF/commit/ae442e570eb0e0296fd52a597f0b3a8b45080ed1) rename strings - [`20c6a0e`](https://github.com/SabreTools/MPF/commit/20c6a0e5ac6b9943a42cacd0bdb9cadafde6a1ca) Default strings - [`6f24f5d`](https://github.com/SabreTools/MPF/commit/6f24f5de1dae529491d43d78f4ad92cd9f744776) Window resources - [`86470ac`](https://github.com/SabreTools/MPF/commit/86470acbb42c68ce7748bbc636da8ef5194e6d6a) add keys - [`ffabc5a`](https://github.com/SabreTools/MPF/commit/ffabc5a6e63b84220212e9d901a7b4d94b670dcc) just one key - [`938ed43`](https://github.com/SabreTools/MPF/commit/938ed4338f88beab753606f136001bbb45a031f1) Combo box example - [`dcb9471`](https://github.com/SabreTools/MPF/commit/dcb947181296cd93afa99410c84c95df1fc72771) window resources ### 📊 Changes **7 files changed** (+202 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `MPF.UI/App.xaml.cs` (+16 -0) ➕ `MPF.UI/Resources/Strings.ko.xaml` (+40 -0) ➕ `MPF.UI/Resources/Strings.xaml` (+40 -0) 📝 `MPF.UI/UserControls/LogOutput.xaml` (+2 -2) 📝 `MPF.UI/Windows/MainWindow.xaml` (+50 -31) 📝 `MPF.UI/Windows/MainWindow.xaml.cs` (+52 -4) 📝 `publish-nix.sh` (+2 -2) </details> ### 📄 Description Can't seem to figure out what's wrong, @mnadareski hope you can see in the changes tab what my idea is for adding language support. Maybe you're able to figure out how to implement this idea (no need to dev on my test branch). I also have an idea for adding a little drop down in the UI menu bar. It's not wired in, but the idea is that UI language option shouldn't be hidden away in Options window because that requires navigating to it (in English). More info: https://learn.microsoft.com/en-us/windows/apps/develop/platform/xaml/xaml-resource-dictionary Implementation for changing UI languages (when wired into the ComboBox): ``` public void ChangeLanguage(string languageCode) { var dictionary = new ResourceDictionary(); switch (languageCode) { case "EN": dictionary.Source = new Uri("../Resources/Strings.xaml", UriKind.Relative); break; case "한글": dictionary.Source = new Uri("../Resources/Strings.ko.xaml", UriKind.Relative); break; default: dictionary.Source = new Uri("../Resources/Strings.xaml", UriKind.Relative); break; } Application.Current.Resources.MergedDictionaries.Add(dictionary); } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:26:08 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SabreTools/MPF#1220