Stypox / dicio-numbers

Dicio's multilingual number parsing and formatting library, inspired by Mycroft's lingua-franca

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to contribute

palight opened this issue · comments

Hi, i saw folders for english and italian in src. Is it the only place to add new language ?

Thanks

I will update the README tomorrow with information about how to contribute. Thank you for opening the issue and reminding me this needs to be done ;-)

@palight I added part of the explanation (currently only focusing on resources). It's still not finished, since I need to give a better documentation to how Java classes are "translated", but at least it's a start. What do you think about it?

Hi, I started working on the spanish translation following the guide you wrote, but I'm not sure how to run the tests described by date_time_test.json.

I still need to explain how to write the Java code. The tests for date&time formatting are these for the English language, and that class inherits DateTimeTestBase which runs the tests in date_time_test.json

I started to work on German and did what is in the Readme file. However I don't know what Java files to touch and what do there exactly. I will take a look at the other languages, but some more info would be appreciated.

Especially how I can test to see if what I am doing is working would be good to know.

The language-dependent java files are those found in the org.dicio.numbers.lang.LANGUAGE_CODE modules. In order to test your changes you need to create test files (also, it is strongly advised to create those, otherwise it's almost impossible to make sure that such specific code does its job).

For example, this is the structure of the English java files. Green files are for tests. The only really required files are actually just EnglishParser and EnglishFormatter, which extend Parser and Formatter respectively, but I suggest you to roughly keep the structure of other files, too, in order to keep things separated.

image