mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-11 12:39:16 +08:00
localized file type descriptors.
This commit is contained in:
parent
0249ecf40e
commit
8e0f1a36ff
@ -20,6 +20,7 @@
|
||||
<BitmapImage x:Key="Icon32x32Help" UriSource="Images/32x32/help.png"/>
|
||||
<CollectionViewSource x:Key="ListViewSource" Source="{Binding}"/>
|
||||
<local:BooleanToCollapsedVisibilityConverter x:Key="booleanToCollapsedVisibilityConverter" />
|
||||
<local:EntryTypeConverter x:Key="entryTypeConverter"/>
|
||||
<Style x:Key="HeaderLeftAlign" TargetType="{x:Type GridViewColumnHeader}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
|
||||
</Style>
|
||||
@ -217,7 +218,7 @@
|
||||
<DataTemplate><TextBlock x:Name="item_Name" Text="{Binding Path=Name}"/></DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</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>
|
||||
<GridViewColumnHeader Tag="Type" Content="{x:Static s:guiStrings.HeaderType}"/>
|
||||
</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>
|
||||
/// Looks up a localized string similar to Text encoding.
|
||||
/// </summary>
|
||||
@ -692,5 +683,14 @@ namespace GARbro.GUI.Strings {
|
||||
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">
|
||||
<value>Archive creation error</value>
|
||||
</data>
|
||||
<data name="TextDirType" xml:space="preserve">
|
||||
<data name="Type_directory" xml:space="preserve">
|
||||
<value><DIR></value>
|
||||
</data>
|
||||
<data name="TextEncoding" xml:space="preserve">
|
||||
|
@ -333,4 +333,13 @@
|
||||
<data name="MsgCreatingArchive" xml:space="preserve">
|
||||
<value>Создание архива {0}</value>
|
||||
</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>
|
23
ViewModel.cs
23
ViewModel.cs
@ -33,6 +33,7 @@ using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using GameRes;
|
||||
using GARbro.GUI.Strings;
|
||||
|
||||
@ -40,7 +41,7 @@ namespace GARbro.GUI
|
||||
{
|
||||
public class SubDirEntry : GameRes.Entry
|
||||
{
|
||||
public override string Type { get { return guiStrings.TextDirType; } }
|
||||
public override string Type { get { return "directory"; } }
|
||||
|
||||
public SubDirEntry (string name)
|
||||
{
|
||||
@ -320,4 +321,24 @@ namespace GARbro.GUI
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user