Skip to content
This repository was archived by the owner on Nov 9, 2021. It is now read-only.

Commit fbad1e5

Browse files
committed
Upgrade to Commons.Core.1.2.0-Alpha
Use Translatable attribute
1 parent 5125509 commit fbad1e5

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

Assembly/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
[assembly: AssemblyTitle("Commons.GetOptions")]
3434
[assembly: AssemblyTrademark("")]
3535

36-
[assembly: AssemblyVersion("2.2.1")]
37-
[assembly: AssemblyFileVersion("2.2.1")]
38-
[assembly: AssemblyInformationalVersion("2.2.1-Alpha")]
36+
[assembly: AssemblyVersion("2.3.0")]
37+
[assembly: AssemblyFileVersion("2.3.0")]
38+
[assembly: AssemblyInformationalVersion("2.3.0-Alpha")]
3939

4040
[assembly: CLSCompliant(false)]
4141

Commons.GetOptions.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<Prefer32Bit>false</Prefer32Bit>
3636
</PropertyGroup>
3737
<ItemGroup>
38-
<Reference Include="Commons.Core, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
39-
<HintPath>packages\Commons.Core.1.1.0-Alpha\lib\net45\Commons.Core.dll</HintPath>
38+
<Reference Include="Commons.Core, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
39+
<HintPath>packages\Commons.Core.1.2.0-Alpha\lib\net45\Commons.Core.dll</HintPath>
4040
<Private>True</Private>
4141
</Reference>
4242
<Reference Include="System" />
@@ -61,7 +61,9 @@
6161
<None Include="build.sh" />
6262
<None Include="Commons.GetOptions.nuspec" />
6363
<None Include="LICENSE" />
64-
<None Include="packages.config" />
64+
<None Include="packages.config">
65+
<SubType>Designer</SubType>
66+
</None>
6567
<None Include="README.md" />
6668
<None Include="Commons.GetOptions-license.md">
6769
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

Commons.GetOptions/OptionAttribute.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121
// SOFTWARE.
2222

2323
using System;
24+
using Commons.Translation;
25+
using static Commons.Translation.TranslationService;
2426

2527
namespace Commons.GetOptions
2628
{
2729
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)]
2830
public class OptionAttribute : Attribute
2931
{
30-
public OptionAttribute(string shortDescription)
32+
public OptionAttribute([Translatable] string shortDescription)
3133
{
3234
Description = shortDescription;
3335
ShortForm = default(char);
@@ -38,6 +40,8 @@ public OptionAttribute(string shortDescription)
3840

3941
public string Description { get; set; }
4042

43+
public string TranslatedDescription { get { return _(Description); } }
44+
4145
// negative means there is no limit
4246
public int MaxOccurs { get; set; }
4347

Commons.GetOptions/OptionDetails.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ bool dontSplitOnCommas
8787
else
8888
LongForm = option.Name;
8989
AlternateForm = option.AlternateForm;
90-
ShortDescription = ExtractParamName(_(option.Description));
90+
ShortDescription = ExtractParamName(option.TranslatedDescription);
9191
Occurs = 0;
9292
OptionBundle = optionBundle;
9393
BooleanOption = false;

packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Commons.Core" version="1.1.0-Alpha" targetFramework="net45" userInstalled="true" />
3+
<package id="Commons.Core" version="1.2.0-Alpha" targetFramework="net45" userInstalled="true" />
44
</packages>

0 commit comments

Comments
 (0)