Skip to content

Commit

Permalink
Merge pull request #3 from stevencohn/1-GTranslate
Browse files Browse the repository at this point in the history
1 g translate
  • Loading branch information
stevencohn authored Sep 28, 2022
2 parents 5528e6d + 1f75373 commit 7c475cb
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 2 deletions.
Binary file added Images/AnalyzeScreen.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 modified Images/LanguagesScreen.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 modified Images/TranslateResxScreen.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 modified Images/TranslateTextScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ private void AnalyzeButtonClick(object sender, EventArgs e)
Data = d,
Comment = d.Element("comment")?.Value
})
.Where(a => a.Comment == null ||
.Where(a => string.IsNullOrWhiteSpace(a.Comment) ||
!(a.Comment.Contains("SKIP") || a.Comment.Contains("NODUP")))
.Select(d => d.Data);

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,16 @@ string that may need manual tuning. Of course, the program itself has no way of
exact context of the translation so it simply compares the number of spaces in the input
string and the output string. Most of the time, the translation is accurate and shouldn't
need to be adjusted manually.

### Analyze

The Analyze tab analyzes a resx file looking for duplicate uses of words and phrase.

![Analyze Resources](Images/AnalyzeScreen.png)

#### Ignoring Known Duplicate

There will likely be legitimate cases where you want to use duplicates but in very
different contexts. In these case, you can tag those resources with the NODUP keyword;
the analyzer will ignore those resources and not report them as duplicates.

1 change: 1 addition & 0 deletions ResxTranslator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<Compile Include="Translator.cs" />
<EmbeddedResource Include="MainWindow.resx">
<DependentUpon>MainWindow.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down
6 changes: 5 additions & 1 deletion Translator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ internal enum Status

internal class Translator
{
//private const int PerEstimate = 1250;
private const int PerEstimate = 100;


public static readonly List<string> Codes = new List<string>
{
#region Code
Expand Down Expand Up @@ -231,7 +235,7 @@ public static string GetDisplayName(string code)
/// <returns></returns>
public static bool Estimate(string path, out int strings, out int seconds)
{
return Estimate(path, out strings, 1250, out seconds);
return Estimate(path, out strings, PerEstimate, out seconds);
}


Expand Down

0 comments on commit 7c475cb

Please sign in to comment.