Guide to add a new language

configs are loaded by this order, each override the previous

DEFAULT_CONFIG = 'mycroft-core/mycroft/configuration/mycroft.conf’
SYSTEM_CONFIG = '/etc/mycroft/mycroft.conf’
USER_CONFIG = ‘~/.mycroft/mycroft.conf’)
REMOTE_CONFIG = “mycroft.ai”

No way, if I put something else more than the “lang” parametert, then mark1 stops working (the damn spinning eyes… :cry:
I guess I’m doing something wrong, but I cannot see what is…

Could you please provide a working example (in pt-pt if just fine) for me to try to adapt it to spanish? Perhaps starting from a non-english working settings I can accomplish and see what I’m doing wrong faster than this… :bowing_man:

@malevolent

Hello

I’m working on the french translation for mycroft-core and mycroft-skill.

Before working in mark1, the more easy is to working on Linux on your computer by compiling mycroft-core source code because adding a new language for mycroft is not easy.
I will update the wiki page GitHub - MycroftAI/mycroft-core: Mycroft Core, the Mycroft Artificial Intelligence platform. with steps by steps tasks when I will find a STT (Speech to text) software that works in local with french.
My goal is to have my mycroft mark 1 in french for christmas 2017.
And it will be not easy …

i have no idea what is happening with the rollign eyes (dont have mark1)

you must either share logs for us to hunt the error or your config so we can help, there’s not much else i can show you… you probably are using invalid syntax in the config i assume, some missing , or using single quotes ’ instead of "

Well, I finally got it working. :smile:

I did a search on the entire filesystem and found the default config in /usr/local/lib/python2.7/site-packages/mycroft_core-0.9.7-py2.7.egg/mycroft/configuration/mycroft.conf. As it din’t applied the modifications (lang and so) I copied all modifications to /etc/mycroft/mycroft.conf, rebooted and voilà, know Mycroft understand my translated skill-date-time in spanish and also answers in spanish, after the installation of the espeak packge (mimic dind’t worked in spanish)

Several years ago I played with espeak and I did found mbrola voices more “human” than the defaults on espeak. Can we use mbrola voices? If affirmative, how can be configured? Firtsly I must get mbrola and mbrola-es2 installed, apt refuses to install mbrola-es because depends on mbrola and mbrola has no candidate. :confused:

Oh, by the way… how can I change the default’s “Sorry I didn’t catch that, please rephrase your request” sentence… hearing it in “spanglish” is quite hilarious but I would like Mycroft to speak entirely in spanish :stuck_out_tongue:

EDITED: I did found it on/usr/local/lib/python2.7/site-packages/mycroft_core-0.9.7-py2.7.egg/mycroft/client/speech/main.py

but translating there doesn’t seems to work.

This will soon be handled by the new fallback-unknown. To activate it right now (since we haven’t added it as a default skill), you can say install fallback unknown.

Let me know it this helps,
Matthew

So, I should roll back all language settings and revert back to english, shouldn’t I ? Because Mycroft doesn’t understand this “install fallback unknown”

Hello malevolent

OK, then for TTS (Text To Spech) , you use espeak.
But which software to do you as STT (Speech To Text) for spanish ?

Yes, in french, it’s the same problem, espeak have a very robotic voice. And the espeak voice for woman is not very “woman”

For mbrola, I think that it will not be available by Mycroft A.I. because of the license:
https://tcts.fpms.ac.be/synthesis/mbrola/mbrlicen.html (Permission is granted to use this Program for non-commercial, non-military purposes,)
Then I think that if the Mycroft AI user want to use mbrola files then he will need to install them manually.

Hi there,

The STT engine is the default “mycroft”.

As for the mbrola usage, its a pity for all of us who don’t like the robotic voices. I’ve installed manually the mbrola voices, but I didn’t get mycroft to use them.
From the command line I can do
espeak -v mb-es1 -s 75 -a 100 "hola me llamo mycroft y voy a ser tu nuevo asistente robótico"
And Mycroft says in a more human voice the phrase I put into quotes. Then, I’ve tried to modify (without success) the file /usr/local/lib/python2.7/site-packages/mycroft_core-0.9.7-py2.7.egg/mycroft/tts/espeak_tts.py to add those parameters, but then mycroft doesn’t recognice anythong and the screen doesn’t work either. I think it wouldn’t be so difficult to use mbrola voices, regarding the license, but perhaps it must be done differently.

Hello

OK.
The default STT engine “mycroft” supports only english.
So when you speak, is it in spanish or in english ?

I’m speaking at it in spanish. Well, I’m translating skills into spanish, as @Jarbas_Ai explained some posts before. I’ve translated only skill-date-time, skill-hello-world, and now I’ve translated the default Myscroft answer when it doesn’t understands something (by translating the hardcoded response as I post here.

Perhaps should I use another STT engine while mycroft STT?

I find mycroft locallitaion documentation very disperse, some pieces at github, some here on the forum and some in community members’ websites, while https://docs.mycroft.ai/ is completely empty (again, speaking about translation).

So, so far I can only ask mycroft for the hour or how is he doing in spanish, but I think its a begining…

mycroft STT currently uses google STT, which supports most languages

That’s why when I see the logs I see mycroft hears me 99,99% perfect… another story is it doesn’t know what to do with those words (intent parser is the naming?), and once translated the skills seems to work as expected.

By the way, guys, now I have a pretty stable version I would like to upload somewhere the translations I’m doing, all before upgrade to 0.9.7 (in the fearing of break anything). I was thinking to fork the official skills repos and make PRs for the translations… it would be the correct way to do it or perhaps would be better to create a “pure” es_ES only skill repository and let users/devs to merge with theirs? As far as I can see the skill repository doesn’t seems to have any other language than english, and I do not know the plans to internationalice Mycroft (I saw the auto-translate skill (from you, @Jarbas_Ai?) and several pages from Mycroft devs with some plans to make Mycroft polyglot, but with some time now).

Anyway, I’m on the subject of translate as many skill as I can, I only hope this can be of use for someone else.

fork each skills own repo and submit a PR, this is the best way as it ensures everyone gets the updated skill

i plan on doing the same for pt-pt, that said, i can share the auto-translated skills for anyone wanting to fix those

Hello,

If mycroft STT currently uses google STT, how can I change or add parameters in mycroft.conf to choose an other laguage than English by default ?

Hello @yleny, its a bit confusing at the beginning. I guess you’re confortable with the linux command line, so first you will need to find the proper mycroft.conf. I did found the correct one was the placed on /etc/mycroft/mycroft.conf (that will persists the core upgrades as fas as I can see, but that file is almost empty, so you should take a look into /usr/local/lib/python2.7/site-packages/mycroft_core-0.9.8-py2.7.egg/mycroft/configuration/mycroft.conf (perhaps your mycroft core version may be different, it seems I’m on the latest version, I don’t know why.

On that last mycroft.conf you will find a complete and more comprehensive configuration that can be copy-pasted to /etc/mycroft/mycroft.conf and modified at will. I will post mine here (I have mycroft configured to “hear” in spanish)

{
       "enclosure": {
           "platform": "mycroft_mark_1",
           "platform_build": 10,
           "port": "/dev/ttyAMA0",
           "rate": 9600,
           "timeout": 5.0,
           "update": true,
           "test": false
       },
       "VolumeSkill": {
       "default_level": 6,
       "min_volume": 0,
       "max_volume": 83
       },
       "ipc_path": "/ramdisk/mycroft/ipc/",
       "lang": "es-es",
       "tts": {
        // Engine.  Options: "mimic", "google", "marytts", "fatts", "espeak", "spdsay"
        "module": "espeak",
        "mimic": {
          "voice": "ap"
        },
        "espeak": {
          "lang": "es-es",
          "voice": "m1"
        }
      }
    }

After rebooting the Mark1 (or restarting the daemons) Mycroft understands spanish. Now you have to translate the skills into your language. The way I’m doing it is as explained in this thread, go where skills are placed and duplicate the directory en-us into your language code (mine is es-es) for example:
dialog/en-us/speak.dialog
vocab/en-us/sentence.intent
vocab/en-us/keyword.voc
regex/en-us/regex.rx
Then open an editor and translate all the sentences, verbs and everything you will find into you language.
After rebooting (or restarting the daemons) mycroft should understand to you and answer in your own language.

Last step is to translate the default phrase Mycroft says when it doesn’t understands you, but it’s not yet ready. It’s hardcoded in the core, on /usr/local/lib/python2.7/site-packages/mycroft_core-0.9.8-py2.7.egg/mycroft/client/speech/main.py (your core version may differ) and search for the sencence “Sorry, I didn’t catch that. Please rephrase your request.”

def handle_complete_intent_failure(event):
    LOG.info("Failed to find intent.")
    # TODO: Localize
    data = {'utterance':
            "Sorry, I didn't catch that. Please rephrase your request."}
    ws.emit(Message('speak', data))

As you can see, there is a TODO:Localize, so let’s hope Mycroft devs shows some love to non-english users and let us translate this and others into our languages :slight_smile:
If you translate this default phrase, you will lost it when will be an update of the core.

I do not have STT configured on my modified configuration, but taking a look to mycroft.conf at core directory, it’s already configured for mycroft

  "stt": {
    // Engine.  Options: "mycroft", "google", "wit", "ibm", "kaldi"
    "module": "mycroft"
    // "kaldi": {
    //   "uri": "http://localhost:8080/client/dynamic/recognize"
    // }
  }

Hope it helps.

Hehhe, installing this is quite difficult for non english speakers like me… I even tried with google translate, but mycroft understands “install food” “install for work unknown” “install for buckhannon” “install for like a noun” and so… as hilarious as desperating xDDD

Isn’t there any manual method to install it?

EDITED: nevermind… I got it by saying install unknown x’D

installing skills vocally in another language will be hard to impossible, the english names just don’t exist in the language vocabulary :slight_smile: to install skills you probably should use the mycroft cli or msm directly, STT will never catch the names

MSM doesn’t seem to work for me…

$ msm install https://github.com/kfezer/daily_meditation.git
parse error: Invalid numeric literal at line 19, column 11
parse error: Invalid numeric literal at line 19, column 11
ERROR: Unable to find/access !

mycroft-cli is a complete mystery for me… how can I install anything with it?