mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-01 01:24:32 +03:00
Remove canned messafes from localization constants
This commit is contained in:
parent
f34ddb1060
commit
fa5bf90195
@ -309,10 +309,20 @@ function add_canned_messages($link){
|
|||||||
}
|
}
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach (get_available_locales() as $locale) {
|
foreach (get_available_locales() as $locale) {
|
||||||
if (! in_array($locale, $existlocales)) {
|
if (in_array($locale, $existlocales)) {
|
||||||
foreach (explode("\n", getlocal('chat.predefined_answers', null, $locale)) as $answer) {
|
// Do not export canned messages for existing locales
|
||||||
$result[] = array('locale' => $locale, 'vctitle' => cut_string($answer, 97, '...'), 'vcvalue' => $answer);
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$file_path = MIBEW_FS_ROOT . '/locales/' . $locale . '/canned_messages.yml';
|
||||||
|
if (!is_readable($file_path)) {
|
||||||
|
// Export canned messages only for locales which have canned messages
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$canned_messages = get_yml_file_content($file_path);
|
||||||
|
foreach ($canned_messages as $answer) {
|
||||||
|
$result[] = array('locale' => $locale, 'vctitle' => cut_string($answer, 97, '...'), 'vcvalue' => $answer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($result) > 0) {
|
if (count($result) > 0) {
|
||||||
|
2
src/mibew/locales/en/canned_messages.yml
Normal file
2
src/mibew/locales/en/canned_messages.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
- 'Hello. How may I help you?'
|
||||||
|
- 'Hello! Welcome to our support. How may I help you?'
|
@ -98,8 +98,6 @@ msgid "chat.mailthread.sent.content"
|
|||||||
msgstr "A history of your chat was sent to address {0}"
|
msgstr "A history of your chat was sent to address {0}"
|
||||||
msgid "chat.mailthread.sent.title"
|
msgid "chat.mailthread.sent.title"
|
||||||
msgstr "Sent"
|
msgstr "Sent"
|
||||||
msgid "chat.predefined_answers"
|
|
||||||
msgstr "Hello. How may I help you?\nHello! Welcome to our support. How may I help you?"
|
|
||||||
msgid "chat.redirect.back"
|
msgid "chat.redirect.back"
|
||||||
msgstr "Back..."
|
msgstr "Back..."
|
||||||
msgid "chat.redirect.cannot"
|
msgid "chat.redirect.cannot"
|
||||||
|
Loading…
Reference in New Issue
Block a user