mirror of
https://github.com/nicolabs/nicobot.git
synced 2025-09-07 05:14:01 +02:00
Default configuration does not translate any message : nicobo or @nicobo must appear
Also, patterns are doc'ed as (localized) commands OR simple string to localize
This commit is contained in:
parent
e45092e4da
commit
b4fdf8bc1b
|
@ -2,20 +2,32 @@ en:
|
||||||
# If present, this is a template to use for all messages
|
# If present, this is a template to use for all messages
|
||||||
all_messages: 🤖 %{message}
|
all_messages: 🤖 %{message}
|
||||||
|
|
||||||
# If a message matches this pattern, bot will try to translate <message> into the configured locale
|
|
||||||
# See https://docs.python.org/3/howto/regex.html#regex-howto for details on the format
|
|
||||||
translate_default_locale: ^(?P<message>.+)$
|
|
||||||
|
|
||||||
# If a message matches this pattern, bot will try to translate <message> into <language>
|
|
||||||
# See https://docs.python.org/3/howto/regex.html#regex-howto for details on the format
|
|
||||||
translate: ^(?P<message>.+)\s+in\s+(?P<language>.+)$
|
|
||||||
|
|
||||||
# Sent when the bot cannot translate a given message
|
# Sent when the bot cannot translate a given message
|
||||||
IDontKnow: I don't know
|
IDontKnow: I don't know
|
||||||
|
|
||||||
# Key sentence that shuts the bot down
|
|
||||||
Shutdown: bye nicobot
|
|
||||||
|
|
||||||
# Set the following banners explicitely to the empty string "" to disable them
|
# Set the following banners explicitely to the empty string "" to disable them
|
||||||
Hello: nicobot ready 🤟
|
Hello: nicobot ready 🤟
|
||||||
Goodbye: See you later 👋
|
Goodbye: See you later 👋
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# COMMANDS
|
||||||
|
#
|
||||||
|
# The following patterns are used to detect commands in the received messages
|
||||||
|
#####################
|
||||||
|
|
||||||
|
# If a message matches this pattern, bot will try to translate <message> into the configured locale
|
||||||
|
# See https://docs.python.org/3/howto/regex.html#regex-howto for details on the format
|
||||||
|
# Matching is made with case ignored
|
||||||
|
# TODO rename to pattern_translate_default_locale or command_... to make it clear it's not a text to localize
|
||||||
|
translate_default_locale: '@?nicobot\s+(?P<message>.+)$'
|
||||||
|
|
||||||
|
# If a message matches this pattern, bot will try to translate <message> into <language>
|
||||||
|
# See https://docs.python.org/3/howto/regex.html#regex-howto for details on the format
|
||||||
|
# Matching is made with case ignored
|
||||||
|
# TODO rename to pattern_translate or command_... to make it clear it's not a text to localize
|
||||||
|
translate: '@?nicobot\s+(?P<message>.+)\s+in\s+(?P<language>.+)$'
|
||||||
|
|
||||||
|
# Key sentence that shuts the bot down
|
||||||
|
# Matching is made with case ignored
|
||||||
|
# TODO rename to pattern_Shutdown or command_shutdown to make it clear it's not a text to localize
|
||||||
|
Shutdown: bye nicobot
|
||||||
|
|
|
@ -2,20 +2,31 @@ fr:
|
||||||
# Si présent, ce motif sera utilisé pour formater tous les messages envoyés
|
# Si présent, ce motif sera utilisé pour formater tous les messages envoyés
|
||||||
all_messages: 🤖 %{message}
|
all_messages: 🤖 %{message}
|
||||||
|
|
||||||
# Si un message correspond à ce motif, le bot tentera de le traduire dans la langue locale configurée
|
|
||||||
# Voir https://docs.python.org/3/howto/regex.html#regex-howto pour le format
|
|
||||||
translate_default_locale: ^(?P<message>.+)$
|
|
||||||
|
|
||||||
# Si un message correspond à ce motif, le bot tentera de traduire <message> dans la langue <language>
|
|
||||||
# Voir https://docs.python.org/3/howto/regex.html#regex-howto pour le format
|
|
||||||
translate: ^(?P<message>.+)\s+en\s+(?P<language>.+)$
|
|
||||||
|
|
||||||
# Ce message est envoyé lorsque le bot ne sait pas traduire le message demandé
|
# Ce message est envoyé lorsque le bot ne sait pas traduire le message demandé
|
||||||
IDontKnow: Je ne sais pas
|
IDontKnow: Je ne sais pas
|
||||||
|
|
||||||
# Phrase clé pour éteindre le bot
|
|
||||||
Shutdown: couché nicobot
|
|
||||||
|
|
||||||
# Remplacez ces messages par une chaîne vide "" afin de les désactiver
|
# Remplacez ces messages par une chaîne vide "" afin de les désactiver
|
||||||
Hello: nicobot paré 🤟
|
Hello: nicobot paré 🤟
|
||||||
Goodbye: A+ 👋
|
Goodbye: A+ 👋
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# COMMANDS
|
||||||
|
#
|
||||||
|
# The following patterns are used to detect commands in the received messages
|
||||||
|
#####################
|
||||||
|
|
||||||
|
# Si un message correspond à ce motif, le bot tentera de le traduire dans la langue locale configurée
|
||||||
|
# Voir https://docs.python.org/3/howto/regex.html#regex-howto pour le format
|
||||||
|
# Matching is made with case ignored
|
||||||
|
# TODO rename to pattern_translate_default_locale to make it clear it's not a text to localize
|
||||||
|
translate_default_locale: '@?nicobot\s+(?P<message>.+)$'
|
||||||
|
|
||||||
|
# Si un message correspond à ce motif, le bot tentera de traduire <message> dans la langue <language>
|
||||||
|
# Voir https://docs.python.org/3/howto/regex.html#regex-howto pour le format
|
||||||
|
# Matching is made with case ignored
|
||||||
|
# TODO rename to pattern_translate to make it clear it's not a text to localize
|
||||||
|
translate: '@?nicobot\s+(?P<message>.+)\s+en\s+(?P<language>.+)$'
|
||||||
|
|
||||||
|
# Phrase clé pour éteindre le bot
|
||||||
|
# Matching is made with case ignored
|
||||||
|
Shutdown: couché nicobot
|
||||||
|
|
Loading…
Reference in a new issue