Ticket #3605 (reopened Feature Requests)

Opened 4 years ago

Last modified 1 year ago

'please-enter-your&extension' does not really work out in some languages

Reported by: pwalker Assigned to:
Priority: minor Milestone: 2.11
Component: Call Forward Version:
Keywords: Cc:
Confirmation: Need Feedback Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

Playback(please-enter-your&extension)

in Call Forward does not really work in some languages, at least in german.

German syntax is something like "Bitte geben Sie ihre Nebenstelle ein".

"please enter your" "extension" (when using two separate voice prompts, one for "please-enter-your" and one for "extension") leads to something like "Bitte geben Sie ein" "ihre Nebenstelle" which sounds quite silly.

Using a new voice prompt "please-enter-your-extension" would solve the "problem". Or could we do something with gettex / i18n ?

Maybe every occurance of

$ext->add($id, $c, '', new ext_playback('please-enter-your&extension'));

could be changed to

$ext->add($id, $c, '', new ext_playback(_('please-enter-your&extension')));

(but what do I have to do to activate gettext in callforward/functions.inc.php ?)

Change History

03/29/09 20:46:58 changed by p_lindheimer

  • confirmation changed from Unreviewed to Need Feedback.

problem with making a custom prompt is that then the custom prompt needs to be made in each language that is localized. Your point is well taken, it's a bit of a dilema though - how many languages does the current chaining sound bad vs. breaking it for everyone except english if we make a prompt to replace it with...

03/29/09 21:22:54 changed by pwalker

Philippe, you're right... that's why I was suggesting a gettex / i18n solution. Is it possible to do that in callforward/functions.inc.php ? (I tried, but terribly failed...) btw: "please-enter-your" is in asterisk-extra-sounds which is not available in all langs.

03/29/09 23:23:57 changed by p_lindheimer

you can't do it with i18n, there is no concept of language at the time the dialplan is generated (from retrieve_conf). It also does not make sense to use i18n because the language you are using in the gui is not necessarily always going to be the language you would want to generate.

03/30/09 19:19:56 changed by pwalker

Philippe: You're right again, at least with the gui language / "generate language"

But I got it working ;-)

Quick & dirty code snipplets:

Add a new setting to amportal.conf, e.g. 'AMPLANG':

AMPLANG=de_DE

(There's possibly a better place for this, e.g. in "General Settings", under "International Settings")

Add this to callforward/i18n/de_DE/LC_MESSAGES/callforward.po :

msgid "please-enter-your&extension"
msgstr "please-enter-your-extension"

Add this to the very beginning of callforward/functions.inc.php (just after "<?php"):

global $amp_conf;

if ($amp_conf['AMPLANG']) {
        $locale = $amp_conf['AMPLANG'];
} else {
        $locale = "en_US";
}

$mod = 'callforward';
setlocale(LC_MESSAGES, $locale);
bindtextdomain($mod, "./modules/$mod/i18n");
textdomain($mod);

Change all ext_playback calls to use gettext.

Re-generate dialplan...

Works like a charm!

P.S.: Don't forget to add a voice prompt "please-enter-your-extension" into your language folder under /var/lib/asterisk/sounds/ , e.g. in "de"

08/22/09 21:23:40 changed by p_lindheimer

  • version deleted.
  • milestone changed from 2.6 to 2.7.

02/28/10 12:00:23 changed by p_lindheimer

  • milestone changed from Cut Line to 2.8.

05/21/10 12:54:13 changed by p_lindheimer

  • milestone changed from 2.8 to Cut Line.

05/21/10 13:08:10 changed by p_lindheimer

r9659 closed wrong ticket:

use Read() with concatanated files on Asterisk 1.6+ where it is finally supported, requires 1.6 to take advantage

02/26/11 13:52:58 changed by p_lindheimer

  • milestone changed from Cut Line to 2.10.

09/17/11 20:52:25 changed by mbrevda

  • status changed from new to closed.
  • resolution set to fixed.

seems form the checkin this should be closed?

09/18/11 05:32:30 changed by mickecarlsson

  • status changed from closed to reopened.
  • resolution deleted.

Actually not. This is not resolved. I guess that we need to discuss this further as I the request is valid.

We need to identify all prompts using concatenated sound files and have those in a settings module to help other languages to get the prompting proper is those languages.

pwalker, do you have a list of prompts that sounds bad when using German sound files?

09/18/11 06:07:00 changed by mbrevda

oops, my bad

02/16/12 22:25:21 changed by p_lindheimer

  • milestone changed from 2.10 to 2.11.