Skip to content

Commit

Permalink
Translated the whole Application to English closes #49 - thanks to @e…
Browse files Browse the repository at this point in the history
…p9869 closes #77
  • Loading branch information
JBou committed Sep 28, 2014
1 parent 808750e commit 50dd754
Show file tree
Hide file tree
Showing 31 changed files with 1,060 additions and 454 deletions.
5 changes: 3 additions & 2 deletions McMetroLauncher-Manager/MainWindow.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq

Module GlobalInfos
Public Webspace As String = "http://patzleiner.net"
Public Website As String = "http://patzleiner.net/"
Public Versionsurl As String = "http://s3.amazonaws.com/Minecraft.Download/versions/versions.json"
Public mcpfad As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft"
Public modsfile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\modlist.json"
Public outputjsonversions As String = mcpfad & "\cache\versions.json"
Public modsfolder As String = mcpfad & "\mods"
Public cachefolder As String = mcpfad & "\cache"
Public modfileurl As String = Website & "download/modlist.json"
Public downloadfilepath As String
Public Versions As Versionslist
Public Moditem As Modifications.Mod
Expand Down Expand Up @@ -55,7 +56,7 @@ Public Class Manager
Await wc.DownloadFileTaskAsync(New Uri(Versionsurl), outputjsonversions)
If IO.File.Exists(modsfile) = False Then
wc = New WebClient()
Await wc.DownloadFileTaskAsync(New Uri(Webspace & "\minecraft\launcher\modlist.json"), modsfile)
Await wc.DownloadFileTaskAsync(New Uri(modfileurl), modsfile)
End If
Await Start()
End Sub
Expand Down
13 changes: 9 additions & 4 deletions McMetroLauncher-Manager/McMetroLauncher-Manager.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="MahApps.Metro">
<HintPath>..\..\MahApps.Metro\MahApps.Metro\bin\Debug\NET45\MahApps.Metro.dll</HintPath>
<Reference Include="MahApps.Metro, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\libraries\MahApps.Metro.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\libraries\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\libraries\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion MinecraftLauncher/Application.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ControlTemplate TargetType="TabItem">
<StackPanel>
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
Padding="12,2,24,2"
Padding="10,2,10,2"
BorderThickness="0,0,0,4"
Margin="2,2,2,0"
SnapsToDevicePixels="True">
Expand Down
2 changes: 1 addition & 1 deletion MinecraftLauncher/Extensions/Converters/Converters.vb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Public Class Playerlist_Namesstring_Converter
Dim s As IList(Of ServerStatus.PlayerList.Player) = TryCast(value, IList(Of ServerStatus.PlayerList.Player))
If s Is Nothing Then Return Nothing
Dim playernames As IList(Of String) = s.Select(Function(p) p.Name).ToList
Dim returnstring As String = "Players:" & Environment.NewLine & String.Join(Environment.NewLine, playernames)
Dim returnstring As String = Application.Current.FindResource("Players").ToString & ":" & Environment.NewLine & String.Join(Environment.NewLine, playernames)
Return returnstring
End Function

Expand Down
17 changes: 17 additions & 0 deletions MinecraftLauncher/Extensions/Converters/NullToBooleanConverter.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.Globalization
Imports System.Windows.Data

Class NullToBooleanConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
Return value IsNot Nothing
End Function

Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Return Binding.DoNothing
End Function
End Class
8 changes: 6 additions & 2 deletions MinecraftLauncher/McMetroLauncher.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
Expand Down Expand Up @@ -191,7 +191,8 @@
<Compile Include="Controls\FluidWrapPanel\FluidMouseDragBehavior.vb" />
<Compile Include="Controls\FluidWrapPanel\FluidWrapPanel.vb" />
<Compile Include="Extensions\ButtonHelper.vb" />
<Compile Include="Extensions\Converters\JSonConverters.vb" />
<Compile Include="Extensions\Converters\JsonConverters.vb" />
<Compile Include="Extensions\Converters\NullToBooleanConverter.vb" />
<Compile Include="Extensions\Converters\ValueConverterGroup.vb" />
<Compile Include="Helpers\ExtensionMethods.vb" />
<Compile Include="Models\Accent-ThemeMenuData.vb" />
Expand All @@ -201,6 +202,9 @@
<Compile Include="Models\Forge.vb" />
<Compile Include="Models\GlobalInfos.vb" />
<Compile Include="Models\Language.vb" />
<Compile Include="ViewModels\UpdaterViewModel.vb" />
<Compile Include="ViewModels\LiteLoaderInstallerViewModel.vb" />
<Compile Include="ViewModels\ForgeInstallerViewModel.vb" />
<Compile Include="ViewModels\MainViewModel.vb" />
<Compile Include="Models\Session.vb" />
<Compile Include="Models\SimpleCommand.vb" />
Expand Down
3 changes: 2 additions & 1 deletion MinecraftLauncher/Models/Language.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Public Class Language
Private _Name As String
<JsonIgnore> _
<JsonIgnore>
Public Property Name() As String
Get
Return _Name
Expand All @@ -13,6 +13,7 @@ Public Class Language
End Property

Private _path As String
<JsonIgnore>
Public Property Path() As String
Get
Return _path
Expand Down
4 changes: 3 additions & 1 deletion MinecraftLauncher/Models/Settings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ Public Class Settings

Private Shared Async Function ReadSettings() As Task(Of Settings)
Dim text As String = File.ReadAllText(SettingsFile.FullName)
Return Await JsonConvert.DeserializeObjectAsync(Of Settings)(text, New JsonSerializerSettings() With {.DefaultValueHandling = DefaultValueHandling.Ignore, .NullValueHandling = NullValueHandling.Ignore})
Dim settings As Settings = Await JsonConvert.DeserializeObjectAsync(Of Settings)(text, New JsonSerializerSettings() With {.DefaultValueHandling = DefaultValueHandling.Ignore, .NullValueHandling = NullValueHandling.Ignore})
settings.ActivLanguage = settings.lstLanguages.Where(Function(p) p.Code = settings.ActivLanguage.Code).First
Return settings
End Function
Public Function Save() As Boolean
If mcpfad = GlobalInfos.mcpfad.FullName Then
Expand Down
30 changes: 30 additions & 0 deletions MinecraftLauncher/ViewModels/ForgeInstallerViewModel.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Public Class ForgeInstallerViewModel
Inherits PropertyChangedBase

#Region "Singleton & Constructor"
Private Shared _Instance As ForgeInstallerViewModel
Public Shared ReadOnly Property Instance As ForgeInstallerViewModel
Get
If _Instance Is Nothing Then _Instance = New ForgeInstallerViewModel
Return _Instance
End Get
End Property

Public Sub New()
End Sub

#End Region

#Region "Properties"
Private _installerdownloading As Boolean
Public Property installerdownloading As Boolean
Get
Return _installerdownloading
End Get
Set(value As Boolean)
SetProperty(value, _installerdownloading)
End Set
End Property
#End Region

End Class
30 changes: 30 additions & 0 deletions MinecraftLauncher/ViewModels/LiteLoaderInstallerViewModel.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Public Class LiteLoaderInstallerViewModel
Inherits PropertyChangedBase

#Region "Singleton & Constructor"
Private Shared _Instance As LiteLoaderInstallerViewModel
Public Shared ReadOnly Property Instance As LiteLoaderInstallerViewModel
Get
If _Instance Is Nothing Then _Instance = New LiteLoaderInstallerViewModel
Return _Instance
End Get
End Property

Public Sub New()
End Sub

#End Region

#Region "Properties"
Private _installerdownloading As Boolean
Public Property installerdownloading As Boolean
Get
Return _installerdownloading
End Get
Set(value As Boolean)
SetProperty(value, _installerdownloading)
End Set
End Property
#End Region

End Class
8 changes: 4 additions & 4 deletions MinecraftLauncher/ViewModels/MainViewModel.vb
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ Public Class MainViewModel
Get
If columnName = "Username" Then
If String.IsNullOrWhiteSpace(Username) Then
Return "Gib einen Benutzernamen ein"
Return Application.Current.FindResource("UsernameMissing").ToString
ElseIf Not OnlineMode Then
'Username Validation
If Username.Length < 3 OrElse Username.Length > 16 Then
Return "3 - 16 Zeichen"
Return "3 - 16 " & Application.Current.FindResource("Characters").ToString
Else
Dim regex As New Regex("^[A-Za-z0-9_-]{2,16}$")
Dim match As Match = regex.Match(Username)

If Not match.Success Then
Return "Nur Buchstaben, Zahlen, Binde- und Unterstriche"
Return Application.Current.FindResource("NoSpecialChars").ToString
End If
End If
End If
Expand Down Expand Up @@ -219,7 +219,7 @@ Public Class MainViewModel
ls.Add(service)
Next
Catch ex As WebException
ls.Add(New AccentColorMenuData() With {.Name = "Fehler beim laden", .ColorBrush = CType(ThemeManager.Accents.Where(Function(p) p.Name = "Red").First.Resources("AccentColorBrush"), System.Windows.Media.Brush)})
ls.Add(New AccentColorMenuData() With {.Name = Application.Current.FindResource("ErrorLoading").ToString, .ColorBrush = CType(ThemeManager.Accents.Where(Function(p) p.Name = "Red").First.Resources("AccentColorBrush"), System.Windows.Media.Brush)})
'TODO: Failed to get Service Statuses
End Try
ServiceStatuses = New ObservableCollection(Of AccentColorMenuData)(ls)
Expand Down
30 changes: 30 additions & 0 deletions MinecraftLauncher/ViewModels/UpdaterViewModel.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Public Class UpdaterViewModel
Inherits PropertyChangedBase

#Region "Singleton & Constructor"
Private Shared _Instance As UpdaterViewModel
Public Shared ReadOnly Property Instance As UpdaterViewModel
Get
If _Instance Is Nothing Then _Instance = New UpdaterViewModel
Return _Instance
End Get
End Property

Public Sub New()
End Sub

#End Region

#Region "Properties"
Private _installerdownloading As Boolean
Public Property installerdownloading As Boolean
Get
Return _installerdownloading
End Get
Set(value As Boolean)
SetProperty(value, _installerdownloading)
End Set
End Property
#End Region

End Class
10 changes: 5 additions & 5 deletions MinecraftLauncher/Windows/Forge_ProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="Version zu Profil hinzufügen"
Title="{DynamicResource AddVersionToProfile}"
Height="222"
Width="429"
ResizeMode="CanMinimize"
WindowStartupLocation="CenterScreen"
DataContext="{x:Static local:MainViewModel.Instance}">
<Grid>
<Button x:Name="btn_save" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="100" Margin="0,0,10,10" Content="Speichern" />
<Button x:Name="btn_skip" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="100" Margin="0,0,115,10" Content="Überspringen" />
<Button x:Name="btn_save" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="100" Margin="0,0,10,10" Content="{DynamicResource Save}" />
<Button x:Name="btn_skip" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="100" Margin="0,0,115,10" Content="{DynamicResource Skip}" />
<ComboBox ItemsSource="{Binding Path=Profiles}" SelectedItem="{Binding selectedProfile, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" x:Name="cb_profiles" VerticalAlignment="Top" Margin="34,73,10,0" />
<RadioButton x:Name="rb_existingprofile" VerticalAlignment="Top" Margin="10,50,0,0" Content="Zu bestehendem Profil hinzufügen:" IsChecked="True" />
<RadioButton x:Name="rb_newprofiles" VerticalAlignment="Top" Margin="10,104,0,0" Content="Neues Profil erstellen:" />
<RadioButton x:Name="rb_existingprofile" VerticalAlignment="Top" Margin="10,50,0,0" Content="{DynamicResource AddToExistingProfile}" IsChecked="True" />
<RadioButton x:Name="rb_newprofiles" VerticalAlignment="Top" Margin="10,104,0,0" Content="{DynamicResource CreateNewProfile}" />
<TextBox x:Name="tb_newprofilename" VerticalAlignment="Top" Margin="34,127,10,0" />
<Label x:Name="lbl_header" VerticalAlignment="Top" Margin="10,10,0,0" Height="35" Padding="5,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="16" />
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion MinecraftLauncher/Windows/Forge_ProfileEditor.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Public Class Forge_ProfileEditor
Me.Close()
Else
If Profiles.List.Contains(tb_newprofilename.Text) Then
Await Me.ShowMessageAsync("Fehler", "Profil existiert bereits: " & tb_newprofilename.Text)
Await Me.ShowMessageAsync(Application.Current.FindResource("Error").ToString, Application.Current.FindResource("ProfileExists").ToString & ": " & tb_newprofilename.Text)
Else
Await Profiles.Add(New Profiles.Profile With {.name = tb_newprofilename.Text, .lastVersionId = Versionname})
Profiles.Get_Profiles()
Expand Down
Loading

0 comments on commit 50dd754

Please sign in to comment.