dotnet / ResXResourceManager

Manage localization of all ResX-Based resources in one central place.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Execute command line validations

bdovaz opened this issue · comments

I see that there are a number of validations that are represented in the UI:

  • Missing translations
  • Inconsistent punctuation marks
  • ...

I would like to be able to run these validations by command line to be able to introduce it in the CI process (PR, nightlies, ...).

Is there any way?

@tom-englert but I see that the script that comes with it only works with Excel files? I want it to scan the resx files I have in the repository for errors based on the rules it has defined.

No, you can script anything

Can you give me an example or at least what classes do I need?

Thanks

It's just exposing the model, e.g.

# Get the list of all resource entries
$allEntries = $myhost.ResourceManager.TableEntries

will get you here:
/// <summary>
/// Gets the table entries of all entities.
/// </summary>
public IObservableCollection<ResourceTableEntry> TableEntries { get; }

so you can iterate over all items, checking the information you want

Thanks but I mean how can I import the resx files in order to get that table entries

In the sample ps1 there is only a importExcel reference

# Create the scripting host of ResXManager:
Add-Type -Path 'ResXManager.Scripting.dll'
$myhost = New-Object -TypeName 'ResXManager.Scripting.Host'
# Load a project by specifying the solution folder (like in the standalone version)
$myhost.Load($solutionFolder)