[Home]

Summary:ASTERISK-04127: [patch] Swedish grammatics
Reporter:Daniel Nylander (yeager)Labels:
Date Opened:2005-05-10 04:25:18Date Closed:2008-01-15 15:39:17.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) patch-voicemail.c-swedish-20050510-4.diff
( 1) patch-voicemail.c-swedish-20050610-1.diff.txt
( 2) swedish.txt
( 3) vm-meddelandet.gsm
( 4) voicemail-swedish-sounds.zip
Description:Swedish is a strange language.

Problem:
-------

When listening to voicemail, the voice says "you have xx new message(s)".

In swedish that would be:
"du har ETT nytt meddelande" <- you have 1 new message
"du har TVĂ…  nya meddelanden" <- you have 2 new messages

Problem is that we have two different words for the digit "one" ("ETT" and "EN").
Another problem is that we say the word "new" in different ways when the following word is singular ("nytt") or pluralis ("nya").
Notice the difference?


Comments:By: Olle Johansson (oej) 2005-05-10 04:31:39

Ja, jag ser skillnaden... :-)

Let's look into how to implement this in app_voicemail. Are you working on a patch?

By: Daniel Nylander (yeager) 2005-05-10 05:42:26

Hej Olle :-)

I'm not a C-programmer but the issue would be "quite easy" to handle.

The issue with "nytt/nya" seems to similar with the Italian "nuovo/nuovi" in app_voicemail.c

The issue with "EN/ETT" seems to match the German (ein/eine).

Can anyone with skillz in C write a patch?

By: Daniel Nylander (yeager) 2005-05-10 06:12:27

Seems like I found some C skillz deep inside me..

This *untested* patch needs the following sounds:

digits/en
digits/ett
vm-nya
vm-nytt

I will record these later today.. busy at work at the moment
Other swedish soundfiles are located at http://www.danielnylander.se/asterisk-saker/

By: Daniel Nylander (yeager) 2005-05-10 06:48:44

Made some errors in the first try.

The new patch relies on two more soundfiles

vm-gamla   (old, pluralis)
vm-gammalt (old, singular)

By: Daniel Nylander (yeager) 2005-05-10 07:03:15

It seems to work :-)

  -- Executing VoiceMailMain("SIP/085000xxxx-071e", "2000") in new stack
   -- Playing 'vm-password' (language 'se')
   -- Playing 'vm-youhave' (language 'se')
   -- Playing 'digits/ett' (language 'se')
   -- Playing 'vm-nytt' (language 'se')
   -- Playing 'vm-message' (language 'se')
   -- Playing 'vm-and' (language 'se')
   -- Playing 'digits/20' (language 'se')
   -- Playing 'digits/8' (language 'se')
   -- Playing 'vm-gamla' (language 'se')
   -- Playing 'vm-messages' (language 'se')



By: Daniel Nylander (yeager) 2005-05-10 08:14:41

Third try.. this time I used the "diff -ru" and added support for Norwegian as well

By: Daniel Nylander (yeager) 2005-05-13 05:31:03

Made some more changes.

If you had zero messages, it would say "0 message".
Now it will say "You have 0 messages"

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-05-13 05:56:41

This is simply a question of gender. Isn't there gender support in asterisk?

By: Daniel Nylander (yeager) 2005-05-13 06:25:51

Well, it's both gender, nominus(?) and language specific differences.
I'm not a linguist nor a C-programmer.

A quick look in the app_voicemail.c and you can see that half the source is language specific stuff. There should be some sort of general language handling in the Asterisk core IMHO.

There are an interesting discussion here:
http://bugs.digium.com/view.php?id=3832

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-05-14 03:18:32

We need to ba able to handle singlular/pluro and gender. These can be generalized quite easily. Language inflection can be a little tougher, though...

roy

By: Kevin P. Fleming (kpfleming) 2005-05-14 23:48:28

If this patch is ready to go, we will need sound files from Allison to go into CVS along with the patch (well, on second thought... who recorded the existing Swedish files?)



By: Daniel Nylander (yeager) 2005-05-15 09:26:59

I did record the swedish sounds.
It would seem a bit strange if Allison should talk swedish :-)

My swedish soundfiles are located here:
http://www.danielnylander.se/asterisk/asterisk-prompt-se_1.0-orig.tar.gz

Daniel

By: Kevin P. Fleming (kpfleming) 2005-05-15 11:58:52

OK, so does that mean this patch is ready to apply?

By: Daniel Nylander (yeager) 2005-05-15 12:06:54

Yes, I think so.

oej, can you confirm that the patch works OK?

By: Kevin P. Fleming (kpfleming) 2005-05-15 12:59:15

The code in the patch was fine, it's been committed. However, the patch itself was malformed, had to be applied manually.

I also took the liberty of reorganizing the code in the functions you added... I know you were just copying existing ones, but the code was not pretty :-) Feel free to post a patch to convert the rest of the intro functions over to this more proper style :-)

Thanks!

By: Daniel Nylander (yeager) 2005-06-10 10:03:22

I have fixed another grammar issue.
Sorry for the bad C skillz I seem to have.

By: Michael Jerris (mikej) 2005-06-10 10:21:20

Can you please review these additional changes as well.  A second set of eyes is always good.

By: Kevin P. Fleming (kpfleming) 2005-06-10 11:39:49

What is the value of having 'vm-meddelandet.gsm', instead of just a Swedish 'vm-message.gsm'?

By: Daniel Nylander (yeager) 2005-06-10 11:55:43

vm-message.gsm is "meddelande" in swedish.
But in neutrum (same word in english?) "meddelande" would be "meddelandet".
Wierd or logical? :-)

By: Kevin P. Fleming (kpfleming) 2005-06-21 20:02:12

This latest patch still does not apply cleanly to CVS HEAD, the patch itself is malformed. Please ensure that whatever means you use to create/copy/upload them does not affect the whitespace in the patch, especially any trailing blank lines.

By: Daniel Nylander (yeager) 2005-06-23 11:41:43

Sorry about that.
I'm not a developer, just a user.
Try the new one.

By: Clod Patry (junky) 2005-06-23 11:48:54

Your patch is wrong, if you add swedish, we should se it as + what do you think?
To provide a good patch, do that:
# cd /usr/src/asterisk/
# cvs diff -u apps/app_voicemail.c > swedish.txt
and attach that file.

By: Daniel Nylander (yeager) 2005-06-23 12:02:33

Sorry. I was unaware of the syntax. Here you go.

By: Clod Patry (junky) 2005-06-23 12:14:16

You shouldnt have "vm-meddelandet" here, it should be vm-message in swedish too.
the only thing that needs to be made is change the language and it's gonna stream  /se/vm-message (probably), based on the chan->language.

By: petersv (petersv) 2005-06-23 12:56:11

The English words message/messages have more flavours in Swedish:

you have one "message" -> du har ett "meddelande"
the last "message" -> det sista "meddelandet"
five "messages" -> fem "meddelanden"
the last five "messages" -> de fem sista meddelandena

I think vm-message is used somewhere else in Swedish, so another name is needed.

By: Kevin P. Fleming (kpfleming) 2005-06-23 13:43:55

Committed to CVS HEAD, thanks!

By: Kevin P. Fleming (kpfleming) 2005-06-23 13:45:06

If you have more changes in this area, please don't reopen this bug and send more patches, but open a new bug for them. Thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:34:44.000-0600

Repository: asterisk
Revision: 5677

U   trunk/apps/app_voicemail.c

------------------------------------------------------------------------
r5677 | kpfleming | 2008-01-15 15:34:43 -0600 (Tue, 15 Jan 2008) | 2 lines

support Swedish and Norwegian mailbox intros (bug ASTERISK-4127)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5677

By: Digium Subversion (svnbot) 2008-01-15 15:39:17.000-0600

Repository: asterisk
Revision: 5985

U   trunk/apps/app_voicemail.c

------------------------------------------------------------------------
r5985 | kpfleming | 2008-01-15 15:39:16 -0600 (Tue, 15 Jan 2008) | 2 lines

support Swedish grammar for voicemail message counts (bug ASTERISK-4127)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5985