Languages
Learn about foreign language support in Mycroft, and how to approach configuring Mycroft to support other languages.
Last updated
Was this helpful?
Learn about foreign language support in Mycroft, and how to approach configuring Mycroft to support other languages.
Last updated
Was this helpful?
In order to support other languages, several components have to be in place in the end to end . Adding language support for Mycroft means that each of those components has to support the new language. This page walks you what has to be done for each of the elements.
At present English is the only officially supported language. Using a language other than English will require at least some editing via the commandline, and likely general troubleshooting. If you are not familiar with Mycroft's configuration files, please see our .
Adding support for a new language is a significant undertaking. It is complex and will require some development and Linux system administration knowledge.
For Mycroft to be usable in a language we need to look at six components.
: To inform each of the following components which language we are using, we must set our overall language setting.
: When you Speak 'Hey Mycroft, do something', you are invoking a Wake Word. To change your Wake Word to another language, you need to change the Wake Word phrase that is used.
: Mycroft is designed to be modular, so you can choose which Speech to Text engine you use. You need to find and configure a Speech to Text engine for your language.
: Again, Mycroft is designed to be modular, so you can choose which Text to Speech engine you use. You need to find and configure a Text to Speech engine for your language.
: To support a language, a Skill must have vocab
and dialog
entries for that language.
: To support a new language, mycroft-core
needs to have supporting files added to the .
Your primary language is set within your mycroft.conf
file. Using the we can set the language by running:
Changing your wake word is not necessary, however may be desirable in order to wake the device with a phrase that is more appropriate or relevant in your language. By default, Mycroft will continue to be awoken by the phrase "Hey Mycroft".
Speech to text (STT) is the part of Mycroft that translates spoken words into text. That text is then used by intent parsers, and then by Skills.
In order to support a new language, a Speech to Text engine (STT engine) must be available.
STT engines are made available by different vendors, and they each have different licenses and usage restrictions.
See the full range of supported STT engines and how to configure Mycroft to use them:
Unfortunately, STT engines aren't available for every language in the world.
In order to support a new language, a Text to Speech (TTS) engine must be available.
TTS engines are made available by different vendors, and they each have different licenses and usage restrictions.
Unfortunately, TTS engines aren't available for every language in the world.
We can then add our TTS configuration values.
The TTS options you can select from are;
"mimic"
"mimic2"
"google"
"marytts"
"fatts"
"espeak"
"spdsay"
"watson"
"bing"
"responsive_voice"
In order to support a new language, individual Skills must support that language too. Mycroft Skills are already structured to cater for new languages. Within the Skill's directory, you will see subdirectories called dialog
, vocab
or locale
. Within these directories is a directory for each of the languages the Skill supports, named after the BCP-47 language code for the language - such as en-us
for American English and pt-br
for Brazilian Portuguese.
You can modify the individual dialog
and vocab
files for a Skill on your own device if you need to. Each Skill is in it's own directory on your device at /opt/mycroft/skills/
.
In addition to the above, mycroft-core
also requires localization, in particular to extract dates and numbers.
Some common files for each language are:
parse_LANG.py
- this file parses large numbers, extracts dates and times in formats specific to the language, and handles definite articles such as 'a, an' etc.
format_LANG.py
- this file formats cardinal and ordinal numbers, and helps to handle pronunciation of complex phrases involving decimals and fractions. Depending on the language, this file will also help format days of the week and other complex date and time phrasing.
As of mid-2019, the languages supported by mycroft-core
are:
French (fr
)
Hungarian (hu
)
Italian (it
)
Portuguese (pt
)
Swedish (sv
)
There is also active progress being made on:
Danish (da
)
Dutch (nl
)
Spanish (es
)
Contributions to this utility are warmly welcomed.
Putting these six components together allows us to use Mycroft in another language. A simple mycroft.conf
file for Italian users might look like:
This configuration will set the:
overall system language
Speech to Text (STT) engine
Text to Speech (TTS) engine
This configuration has not changed the Wake Word, so the device will continue responding to "Hey Mycroft".
. Alternatively you can create a custom wake word:
We recommend that you request your language at .
Once you've found an TTS engine for your language, you will need to configure Mycroft to use it. This is done through the file.
If you would like to build a TTS for your language, then we recommend you check out . Mimic Recording Studio facilitates the recording of phrases based on a corpus, and the recordings can be used to train a voice with the mimic2
TTS software.
Using the we can edit the User-level mycroft.conf
file by running:
To have a Skill support another language, the easiest way is to contribute to translating dialog
and vocab
files on the platform. When significant progress has been made on a language in Mycroft Translate, the translations are automatically added to Skills.
For more information, see the .
(de
)
You're welcome to post questions and queries to the or join our to connect with others from around the world.
We also have a number of .