The MMM-TranslatedMessages
module translates a given list of messages that the user inputs to the desired language that is configured.
Access your Magic Mirror/modules folder
cd ~/MagicMirror/modules/
Clone this repository in the modules folder
git clone https://github.com/ahmedwab/MMM-TranslatedMessages
1. Go to the following website https://cloud.google.com/translate
2. You will want to create a new project
3. With the new project, visit API & Services
4. Enable Google Translate API
5. Create a new API key
6. Store/Copy your API key for the next part
You will need to make adjustments in your config/config.js
file:
modules: [
{
module: 'MMM-TranslatedMessages',
position: 'top_right',
config: {
intervalTime: 5, //Time interval between messages
fade: 3, //Time in Seconds it takes to fade away each message
Messages:[ //Messages you want to input to be translated
"Hello World","How is it going"],
API_KEY:"GOOGLE_TRANSLATE_API_KEY", //Google translation API Key
targetLanguages:["fr","en"], //Target Languages Example: French:fr English:en
fontSize: "1.1em" //Font Size of the text
}
},
]
The random_quotes
module allows you to pick quotes randomly from all the provided categories, or you can
set it to only use one category. Specifying multiple categories is curently not supported.
Options | Description | Default |
---|---|---|
intervalTime |
Time interval between messages Integer Value is in seconds. | 5 seconds |
fade |
Time in Seconds it takes to fade away each message Integer Value is in seconds. | 3 seconds |
Messages |
Messages to be translated (Array type) | Messages:[
"Hello World","How is it going"] |
targetLanguages |
Languages the messages should be translated to Example: French = fr | targetLanguages:["fr","en"] |
fontSize |
Font Size of the displayed messages | "1.1em" |
Stylesheet could be found under MMM-TranslatedMessages.css
Any style changes can be produced there
Contributing is greatly encouraged.
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.