Skip to content

Commit

Permalink
Added machine translations
Browse files Browse the repository at this point in the history
Raised version number
Fixed a small issue that prevented to load other languages
  • Loading branch information
Inzaniity committed Apr 8, 2023
1 parent fcce5a0 commit 921043f
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 21 deletions.
10 changes: 8 additions & 2 deletions Songify Slim/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ private App()
ConfigHandler.LoadConfig(Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) + "/config.xml");
else
ConfigHandler.ReadConfig();
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Language);
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
try
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Language);
}
catch (Exception e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
}
// Adding the RegKey for Songify in startup(autostart with windows)

RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(
Expand Down
4 changes: 2 additions & 2 deletions Songify Slim/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.9.21")]
[assembly: AssemblyFileVersion("1.3.9.21")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: Guid("442379e3-32d8-42d1-ab09-cba229672453")]
18 changes: 18 additions & 0 deletions Songify Slim/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Songify Slim/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,10 @@
<data name="brw_cmd_playpause" xml:space="preserve">
<value>Setzt die aktuelle Wiedergabe fort oder hält sie an.</value>
</data>
<data name="sw_SpotifySR_Userlevel_command" xml:space="preserve">
<value>Userlevel für SR-Befehl</value>
</data>
<data name="sw_SpotifySR_Userlevel_reward" xml:space="preserve">
<value>Userlevel für SR-Kanalbelohnung</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Songify Slim/Properties/Resources.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,10 @@
<data name="brw_cmd_playpause" xml:space="preserve">
<value>Resumes or pauses the current playback.</value>
</data>
<data name="sw_SpotifySR_Userlevel_reward" xml:space="preserve">
<value>Allowed user levels for SR reward</value>
</data>
<data name="sw_SpotifySR_Userlevel_command" xml:space="preserve">
<value>Allowed user levels for SR command</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Songify Slim/Properties/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,10 @@
<data name="brw_cmd_playpause" xml:space="preserve">
<value>Reanuda o pausa la reproducción actual.</value>
</data>
<data name="sw_SpotifySR_Userlevel_command" xml:space="preserve">
<value>Niveles de usuario permitidos para el comando SR</value>
</data>
<data name="sw_SpotifySR_Userlevel_reward" xml:space="preserve">
<value>Niveles de usuario permitidos para la recompensa SR</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Songify Slim/Properties/Resources.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,10 @@
<data name="brw_cmd_playpause" xml:space="preserve">
<value>Reprend ou met en pause la lecture en cours.</value>
</data>
<data name="sw_SpotifySR_Userlevel_command" xml:space="preserve">
<value>Niveaux d'utilisateurs autorisés pour la commande SR</value>
</data>
<data name="sw_SpotifySR_Userlevel_reward" xml:space="preserve">
<value>Niveaux d'utilisateurs autorisés pour la récompense SR</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Songify Slim/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -813,4 +813,10 @@
<data name="brw_cmd_playpause" xml:space="preserve">
<value>Resumes or pauses the current playback.</value>
</data>
<data name="sw_SpotifySR_Userlevel_command" xml:space="preserve">
<value>Allowed user levels for SR command</value>
</data>
<data name="sw_SpotifySR_Userlevel_reward" xml:space="preserve">
<value>Allowed user levels for SR reward</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Songify Slim/Properties/Resources.ru-RU.resx
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,10 @@
<data name="brw_cmd_playpause" xml:space="preserve">
<value>Возобновляет или приостанавливает текущее воспроизведение.</value>
</data>
<data name="sw_SpotifySR_Userlevel_command" xml:space="preserve">
<value>Разрешенные уровни пользователей для команды SR</value>
</data>
<data name="sw_SpotifySR_Userlevel_reward" xml:space="preserve">
<value>Разрешенные уровни пользователей для вознаграждения SR</value>
</data>
</root>
2 changes: 1 addition & 1 deletion Songify Slim/Util/General/GlobalObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class GlobalObjects
public static FlowDocument ConsoleDocument = new FlowDocument();
public static TrackInfo CurrentSong;
public static bool DetachConsole = false;
public static bool IsBeta = true;
public static bool IsBeta = false;
public static bool IsInPlaylist;
public static ObservableCollection<RequestObject> ReqList = new ObservableCollection<RequestObject>();
public static string Requester = "";
Expand Down
29 changes: 17 additions & 12 deletions Songify Slim/Util/Songify/TwitchOAuth/ImplicitOAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace Songify_Slim.Util.Songify.TwitchOAuth
{
public class ImplicitOAuth
{


#region Variables
// Privates
private const string TwitchAuthUrl = "https://id.twitch.tv/oauth2/authorize";
Expand Down Expand Up @@ -64,14 +62,21 @@ public string RequestClientAuthorization()
InitializeLocalWebServers();

// Open the browser and send the user to the implicit autentication page on Twitch.
//Process.Start($"{twitchAuthUrl}?{queryParams}");
var process = new Process();
process.StartInfo = new ProcessStartInfo
try
{
var process = new Process();
process.StartInfo = new ProcessStartInfo
{
FileName = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge1.exe",
Arguments = $"--inprivate {TwitchAuthUrl}?{queryParams}"
};
process.Start();
}
catch (Exception e)
{
FileName = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",
Arguments = $"--inprivate {TwitchAuthUrl}?{queryParams}"
};
process.Start();
Process.Start($"{TwitchAuthUrl}?{queryParams}");
}

return authStateVerify;
}
#endregion
Expand Down Expand Up @@ -186,12 +191,12 @@ void IncommingTwitchRequest(IAsyncResult result)
<img src=""https://songify.overcode.tv/img/ms-icon-310x310.png"" style="" height: 50px;""/> + <img src=""https://songify.overcode.tv/img/TwitchGlitchPurple.png"" style="" height: 50px;""/>
</div>
</div>
<h1>Success</h1>
<h1>Success</h1>
<p>Twitch and Songify are now connected!<br/>This page closes itself in 5 seconds.</p>
</div>
<script>
let values =
let values =
{
access_token:""TOKEN"",
state: ""STATE""
Expand All @@ -208,7 +213,7 @@ void IncommingTwitchRequest(IAsyncResult result)
setTimeout(function () {
window.close();
}, 5000);
</script>
</body>
</html>
Expand Down
4 changes: 2 additions & 2 deletions Songify Slim/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,14 +626,14 @@ private async void MetroWindowLoaded(object sender, RoutedEventArgs e)
await SendTelemetry();
await TwitchHandler.CheckStreamIsUp();

if (!Settings.UpdateRequired) return;
ApiHandler.DoAuthAsync();

if (!Settings.UpdateRequired) return;
List<int> userLevels = new List<int>();
for (int i = 0; i <= Settings.TwSrUserLevel; i++)
{
userLevels.Add(i);
}

if (Settings.UserLevelsCommand.Count == 0) Settings.UserLevelsCommand = userLevels;
if (Settings.UserLevelsReward.Count == 0) Settings.UserLevelsReward = userLevels;

Expand Down
4 changes: 2 additions & 2 deletions Songify Slim/Views/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@
</StackPanel>
<StackPanel Orientation="Vertical" VerticalAlignment="Top">
<DockPanel LastChildFill="True">
<Label Content="Allowed user levels for SR command" Padding="0,5,5,5" VerticalAlignment="Center"/>
<Label Content="{x:Static local:Resources.sw_SpotifySR_Userlevel_command}" Padding="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="CbxAllowedUserLevelsCommand" SelectionChanged="Selector_OnSelectionChanged" IsReadOnly="True" SelectedIndex="0" HorizontalAlignment="Right" Width="185">
<ComboBox.Items>
<ComboBoxItem Content="User Levels (Command)">
Expand Down Expand Up @@ -654,7 +654,7 @@
</ComboBox>
</DockPanel>
<DockPanel LastChildFill="True" Margin="0,6,0,0">
<Label Content="Allowed user levels for SR reward" Padding="0,5,5,5" VerticalAlignment="Center"/>
<Label Content="{x:Static local:Resources.sw_SpotifySR_Userlevel_reward}" Padding="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="CbxAllowedUserLevelsReward" SelectionChanged="Selector_OnSelectionChanged" IsReadOnly="True" SelectedIndex="0" HorizontalAlignment="Right" Width="185">
<ComboBox.Items>
<ComboBoxItem Content="User Levels (Reward)">
Expand Down

0 comments on commit 921043f

Please sign in to comment.