Skip to content

Commit

Permalink
Support for 44 new languages added
Browse files Browse the repository at this point in the history
  • Loading branch information
enviGit committed Feb 22, 2023
1 parent 460da3c commit 114529f
Show file tree
Hide file tree
Showing 48 changed files with 591 additions and 19 deletions.
Binary file added WeatherProphet/Icons/Afrikaans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Albanian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Arabic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Azerbaijani.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Basque.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Bulgarian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Catalan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Chinese.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Croatian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Czech.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Danish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Dutch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/English.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Finnish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/French.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Galician.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/German.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Greek.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Hebrew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Hindi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Hungarian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Indonesian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Italian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Japanese.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Korean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WeatherProphet/Icons/Latvian.png
Binary file added WeatherProphet/Icons/Lithuanian.png
Binary file added WeatherProphet/Icons/Macedonian.png
Binary file added WeatherProphet/Icons/Norwegian.png
Binary file added WeatherProphet/Icons/Persian.png
Binary file added WeatherProphet/Icons/Polish.png
Binary file added WeatherProphet/Icons/PortuguesBr.png
Binary file added WeatherProphet/Icons/Portuguese.png
Binary file added WeatherProphet/Icons/Romanian.png
Binary file added WeatherProphet/Icons/Russian.png
Binary file added WeatherProphet/Icons/Serbian.png
Binary file added WeatherProphet/Icons/Slovak.png
Binary file added WeatherProphet/Icons/Slovenian.png
Binary file added WeatherProphet/Icons/Spanish.png
Binary file added WeatherProphet/Icons/Swedish.png
Binary file added WeatherProphet/Icons/Thai.png
Binary file added WeatherProphet/Icons/Turkish.png
Binary file added WeatherProphet/Icons/Ukrainian.png
Binary file added WeatherProphet/Icons/Vietnamese.png
28 changes: 28 additions & 0 deletions WeatherProphet/Language.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Collections.Generic;

namespace WeatherProphet
{
public class Language
{
public string DisplayName { get; set; }
public string FlagIcon { get; set; }

public Language(string displayName, string flagIcon)
{
DisplayName = displayName;
FlagIcon = flagIcon;
}
private static List<Language> GetAvailableLanguages()
{
var languages = new List<Language>();

foreach (var country in new List<string> { "Afrikaans", "Albanian", "Arabic", "Azerbaijani", "Bulgarian", "Catalan", "Czech", "Danish", "German", "Greek", "English",
"Basque", "Persian (Farsi)", "Finnish", "French", "Galician", "Hebrew", "Hindi", "Croatian", "Hungarian", "Indonesian", "Italian", "Japanese", "Korean", "Latvian",
"Lithuanian", "Macedonian", "Norwegian", "Dutch", "Polish", "Portuguese", "Português Brasil", "Romanian", "Russian", "Swedish", "Slovak", "Slovenian", "Spanish",
"Serbian", "Thai", "Turkish", "Ukrainian", "Vietnamese", "Chinese Simplified", "Chinese Traditional", "Zulu" })
languages.Add(new Language(country, $"/Icons/{country}.png"));

return languages;
}
}
}
30 changes: 23 additions & 7 deletions WeatherProphet/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,39 @@
</ResourceDictionary>
</Window.Resources>
<Grid>
<Label Content="Weather Prophet" FontWeight="Bold" FontSize="24" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Top"/>
<Button Name="ToggleTheme" Click="Button_ToggleTheme" VerticalAlignment="Top" Margin="0,9,10,0" Style="{StaticResource ThemeButton}" Height="28" Width="67" HorizontalAlignment="Right">
<Label x:Name="labelWeatherProphet" Content="Weather Prophet" FontWeight="Bold" FontSize="24" VerticalAlignment="Top" HorizontalContentAlignment="Center"
VerticalContentAlignment="Top"/>
<ComboBox Name="comboBoxLanguageToDisplay" VerticalAlignment="Top" ItemsSource="{Binding AvailableLanguages}" SelectedItem="{Binding SelectedLanguage}"
Margin="10,62,618,0" Height="28" SelectionChanged="ComboBoxLanguageToDisplay_SelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Width="16" Height="16" Margin="0,0,5,0" Source="{Binding FlagIcon}" />
<TextBlock Text="{Binding DisplayName}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button Name="ToggleTheme" Click="Button_ToggleTheme" VerticalAlignment="Top" Margin="0,13,10,0" Style="{StaticResource ThemeButton}" HorizontalAlignment="Right" Width="40">
<Button.Background>
<ImageBrush x:Name="ThemeImage" ImageSource="pack://application:,,,/Icons/dark.png"/>
</Button.Background>
</Button>
<TextBox Name="textBoxCity" HorizontalAlignment="Left" Margin="147,115,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="120"/>
<ComboBox Name="comboBoxDaysToShow" HorizontalAlignment="Left" Margin="293,115,0,0" VerticalAlignment="Top" Width="80" SelectedIndex="3" Height="28">
<Label x:Name="labelCity" Content="City" HorizontalAlignment="Left" Margin="147,97,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Center" Width="120"
Height="27" BorderThickness="0"/>
<TextBox Name="textBoxCity" HorizontalAlignment="Left" Margin="147,124,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="120"/>
<Label x:Name="labelForecastsNumber" Content="Number of forecasts" HorizontalAlignment="Left" Margin="274,97,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Center" Width="118" Height="27"
BorderThickness="0"/>
<ComboBox Name="comboBoxDaysToShow" HorizontalAlignment="Left" Margin="293,124,0,0" VerticalAlignment="Top" Width="80" SelectedIndex="3" Height="28">
<ComboBoxItem Content="1"/>
<ComboBoxItem Content="2"/>
<ComboBoxItem Content="3"/>
<ComboBoxItem Content="4"/>
</ComboBox>
<Button Content="Get Weather" HorizontalAlignment="Left" Margin="562,114,0,0" VerticalAlignment="Top" Width="76" Click="Button_Click"/>
<TextBlock Name="textBlockWeather" TextWrapping="Wrap" Text="" Margin="10,179,10,217"/>
<Button Name="buttonGetWeather" Content="Get Weather" HorizontalAlignment="Left" Margin="562,123,0,0" VerticalAlignment="Top" Width="76" Click="Button_Click"/>
<TextBlock Name="textBlockWeather" TextWrapping="Wrap" Text="" Margin="10,179,10,212"/>
<TextBlock Name="textBlockForecast" TextWrapping="Wrap" Text="" Margin="10,222,10,174"/>
<ListBox Name="listBoxForecast" Visibility="Visible" Margin="10,222,10,10">
<ListBox Name="listBoxForecast" Visibility="Collapsed" Margin="10,222,10,10">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
Expand Down
Loading

0 comments on commit 114529f

Please sign in to comment.