mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
localized file type descriptors.
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
<BitmapImage x:Key="Icon32x32Help" UriSource="Images/32x32/help.png"/>
|
<BitmapImage x:Key="Icon32x32Help" UriSource="Images/32x32/help.png"/>
|
||||||
<CollectionViewSource x:Key="ListViewSource" Source="{Binding}"/>
|
<CollectionViewSource x:Key="ListViewSource" Source="{Binding}"/>
|
||||||
<local:BooleanToCollapsedVisibilityConverter x:Key="booleanToCollapsedVisibilityConverter" />
|
<local:BooleanToCollapsedVisibilityConverter x:Key="booleanToCollapsedVisibilityConverter" />
|
||||||
|
<local:EntryTypeConverter x:Key="entryTypeConverter"/>
|
||||||
<Style x:Key="HeaderLeftAlign" TargetType="{x:Type GridViewColumnHeader}">
|
<Style x:Key="HeaderLeftAlign" TargetType="{x:Type GridViewColumnHeader}">
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
|
<Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -217,7 +218,7 @@
|
|||||||
<DataTemplate><TextBlock x:Name="item_Name" Text="{Binding Path=Name}"/></DataTemplate>
|
<DataTemplate><TextBlock x:Name="item_Name" Text="{Binding Path=Name}"/></DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>
|
</GridViewColumn>
|
||||||
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvTypeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}" DisplayMemberBinding="{Binding Path=Type}">
|
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvTypeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}" DisplayMemberBinding="{Binding Path=Type, Mode=OneWay, Converter={StaticResource entryTypeConverter}}">
|
||||||
<GridViewColumn.Header>
|
<GridViewColumn.Header>
|
||||||
<GridViewColumnHeader Tag="Type" Content="{x:Static s:guiStrings.HeaderType}"/>
|
<GridViewColumnHeader Tag="Type" Content="{x:Static s:guiStrings.HeaderType}"/>
|
||||||
</GridViewColumn.Header>
|
</GridViewColumn.Header>
|
||||||
|
|||||||
18
Strings/guiStrings.Designer.cs
generated
18
Strings/guiStrings.Designer.cs
generated
@@ -594,15 +594,6 @@ namespace GARbro.GUI.Strings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to <DIR>.
|
|
||||||
/// </summary>
|
|
||||||
public static string TextDirType {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TextDirType", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Text encoding.
|
/// Looks up a localized string similar to Text encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -692,5 +683,14 @@ namespace GARbro.GUI.Strings {
|
|||||||
return ResourceManager.GetString("TooltipForward", resourceCulture);
|
return ResourceManager.GetString("TooltipForward", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to <DIR>.
|
||||||
|
/// </summary>
|
||||||
|
public static string Type_directory {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Type_directory", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -285,7 +285,7 @@
|
|||||||
<data name="TextCreateArchiveError" xml:space="preserve">
|
<data name="TextCreateArchiveError" xml:space="preserve">
|
||||||
<value>Archive creation error</value>
|
<value>Archive creation error</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TextDirType" xml:space="preserve">
|
<data name="Type_directory" xml:space="preserve">
|
||||||
<value><DIR></value>
|
<value><DIR></value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TextEncoding" xml:space="preserve">
|
<data name="TextEncoding" xml:space="preserve">
|
||||||
|
|||||||
@@ -333,4 +333,13 @@
|
|||||||
<data name="MsgCreatingArchive" xml:space="preserve">
|
<data name="MsgCreatingArchive" xml:space="preserve">
|
||||||
<value>Создание архива {0}</value>
|
<value>Создание архива {0}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Type_archive" xml:space="preserve">
|
||||||
|
<value>архив</value>
|
||||||
|
</data>
|
||||||
|
<data name="Type_image" xml:space="preserve">
|
||||||
|
<value>изображение</value>
|
||||||
|
</data>
|
||||||
|
<data name="Type_script" xml:space="preserve">
|
||||||
|
<value>сценарий</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
23
ViewModel.cs
23
ViewModel.cs
@@ -33,6 +33,7 @@ using System.Collections.Specialized;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
using GameRes;
|
using GameRes;
|
||||||
using GARbro.GUI.Strings;
|
using GARbro.GUI.Strings;
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ namespace GARbro.GUI
|
|||||||
{
|
{
|
||||||
public class SubDirEntry : GameRes.Entry
|
public class SubDirEntry : GameRes.Entry
|
||||||
{
|
{
|
||||||
public override string Type { get { return guiStrings.TextDirType; } }
|
public override string Type { get { return "directory"; } }
|
||||||
|
|
||||||
public SubDirEntry (string name)
|
public SubDirEntry (string name)
|
||||||
{
|
{
|
||||||
@@ -320,4 +321,24 @@ namespace GARbro.GUI
|
|||||||
Item = System.IO.Path.GetFileName (filename);
|
Item = System.IO.Path.GetFileName (filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EntryTypeConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
var type = value as string;
|
||||||
|
if (!string.IsNullOrEmpty (type))
|
||||||
|
{
|
||||||
|
var translation = guiStrings.ResourceManager.GetString ("Type_"+type, guiStrings.Culture);
|
||||||
|
if (!string.IsNullOrEmpty (translation))
|
||||||
|
return translation;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user