Skip to content

Commit

Permalink
2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
na1307 committed May 23, 2024
1 parent e91eedf commit 72a64ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<UseWPF>true</UseWPF>
<VssdkCompatibleExtension>true</VssdkCompatibleExtension>
<DeployExtension>true</DeployExtension>
<AssemblyName>EncodingConverter</AssemblyName>
<AssemblyTitle>Encoding Converter</AssemblyTitle>
<Description>Encoding Converter</Description>
<Product>Encoding Converter</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.910.0</FileVersion>
<Version>1.910</Version>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
<Version>2.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Extensibility.Sdk" />
Expand Down
8 changes: 3 additions & 5 deletions EncodingConverter.VisualStudio/WpfLocalizer.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
using EncodingConverter.VisualStudio.Properties;
using System.Resources;

namespace EncodingConverter.VisualStudio;

public sealed class WpfLocalizer {
private static readonly ResourceManager _resourceManager = Resources.ResourceManager;

public string? this[string id] {
get {
if (string.IsNullOrWhiteSpace(id)) {
return null;
}

//1. 리소스에서 값 조회
var str = _resourceManager.GetString(id, Resources.Culture);
// 1. 리소스에서 값 조회
var str = Resources.ResourceManager.GetString(id, Resources.Culture);

//2. 없으면 키 반환
// 2. 없으면 키 반환
if (string.IsNullOrWhiteSpace(str)) {
str = id;
}
Expand Down

0 comments on commit 72a64ea

Please sign in to comment.