I have trouble changing the date format


#1

Hi so I’m currently having problems with changing the date format in a skill very similar to mycroft-date-time skill that uses a .json file to format it’s date as well as a python program and so what I’m trying to do is make my skill say two thousand nineteen instead of twenty nineteen I’ll link a github repo with the concerned files (and yes I’m trying to make it work for french


#2

Hi JoJo,

This is one of the more challenging parts of our internationalisation efforts. For each language we need to create these parsing and formatting libraries and unfortunately the French version isn’t yet complete.

I hadn’t seen this before, but if you take a look at line 156 you’ll see a note that it currently doesn’t support pronouncing numbers greater than 100.

If you are open to helping us extend this that would be an incredible step forward to making Mycroft truly available for French.

Personally I find a Test Driven Development approach to be particularly helpful for this work. You can find the existing unit tests for other languages at mycroft-core/test/unittests/util/test_format_fr.py. Extending these and running them as you make changes allows you to see if you’re code is functioning as expected without having to manually test functions as you go. It’s also very easy to break existing functionality when you’re changing things which becomes very obvious with unit tests failing.

If you don’t have time and capacity to contribute to the library itself, I’d say the simplest method to move forward would be to create a few dialog files: 2019.dialog, 2020.dialog etc with the equivalent of “two thousand and nineteen”. You can then load that string by calling self.translate('2019') or presumably something more dynamic like: self.translate(str(year))