GitHub - while-loop/XML-Comp: Compare ANY markup documents. · GitHub
Skip to content

while-loop/XML-Comp

 
 

Folders and files

Repository files navigation

LICENSE Go Report Card codebeat badge GoDoc Top Level Coverage Travis Build Status DOI

Menu

XML-Comparer

This package is a command line tool that provides the capability of comparing two directories adding to files the differences between them, creating the possible files or folders that are missing and adding the missing tags on each file. It was made to help RimWorld's community translators(1) to know what was modified on the last XML updates and to let them keep in track of what they need to add/remove from what has been done.

(1) and maybe other indie games that uses XML

Installing

$ go get github.com/XML-Comp/XML-Comp

Running

$ XML-Comp -original /path/to/language/english -translation /path/to/language/translation

How this works?

You need two paths that we call "original" & "translation", which are described bellow:

  • "original": Full path directory of your RimWorld English folder
  • "translation": Full path directory of your RimWorld Language folder cloned from GitHub

My "original" path: /Users/arthur/Library/Application Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods/Core/Languages/English

My "translation" path: /Users/arthur/Github/RimWorld-PortugueseBrazilian

With these paths in hand, running them with xml-comp program will let you know in every file of your project what is missing by adding lines to it with what is needed to translate! That simple!

Comparing any kind of document:

To compare any kind of files, all you need is to use the flag -doc <type name>, eg -doc html. This will use the paths that you gave only to compare the specified type of document. Another example:

$ XML-Comp -doc html -original path/to/It -translation path/to/It

OBS: This is not required, by default It's comparing all .xml files that are encountered.

XML-Comp CLI Usage (needed Go 1.7+)

$ git clone github.com/XML-Comp/xml-comp
$ cd xml-comp
$ go install
$ xml-comp help

To Do - Check our Issues & Milestones

Using only the comparer package

1- Import the package

import "github.com/XML-Comp/XML-Comp/comparer"

2- Set document type variable to the desired document

// without the "." | eg: "xml" or "html"
comparer.DocType = "desired docType"

3- Start the main function with the full paths to compare

// the firstPath is always what will be used as model
comparer.Compare(firstPath, comparingPath)

About

Compare ANY markup documents.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

Contributors

Languages

  • Go 100.0%