2010/11/29 Peter Landgren <peter.talken@telia.com>
OK,

I have made a ticket of it and will assign it to me.
Both branch and trunk?

If minor, then yes.

Benny

/Peter


> 2010/11/28 Doug Blank <doug.blank@gmail.com>
>
> > On Sat, Nov 27, 2010 at 3:24 PM, Peter Landgren <peter.talken@telia.com>
> >
> > wrote:
> > > Hi,
> > >
> > > By chance I ran into a strange translation. I had entered death year
> > > 1954
> >
> > (I thought).
> >
> > > It showed up in Relationship View as dö. 1954 (in Swedish).
> > > However there is no such string in the sv.po. So I ran Gramps in
> > > English
> >
> > locale and then I found:
> > > c.o.d 1954. (cause of death). But this c.o.d is not in the translation
> >
> > file.
> >
> > > The complete sentence "cause of death" is in the translation file.
> > >
> > > I have found that Gramps tries to abbreviate "cause of death", but this
> >
> > does not work in some
> >
> > > languages. "cause of death" in Swedish will be "dödsorsak" and Gramps
> >
> > tries to abbreviate this to
> >
> > > "dö." which is more or less meaningful. (It could mean "go and die!")
> > >
> > >  I also see that in this case the abbreviation is only 2 char. but in
> >
> > code it says it should be 3
> >
> > > char in the abbreviation, due to the fact that the variable "abbrev" is
> >
> > of type str and not unicode.
> >
> > > If I fix so that  the variable "abbrev" is in unicode, the abbreviation
> >
> > will be "död.", which means
> >
> > > "dead" and is not an abbreviation for "dödsorsak". It is hard to
> >
> > abbreviate it, so it will mean
> >
> > > anything useful.
> > >
> > > I could translate "cause of death" with "orsak till döden", but this is
> >
> > not good Swedish.
> >
> > > This time I was lucky and didn't get any error, but if the third letter
> >
> > had been as non-latin
> >
> > > character, I will get:
> > >  UnicodeDecodeError: 'utf8' codec can't decode bytes in position 2-3:
> > invalid data
> >
> > > So, as a first step to fix this, convert to unicode to avoid any decode
> >
> > errors.
> >
> > > But how to fix a working abbreviation algorithm is not that easy, I
> > > think
> >
> > as it is language
> >
> > > dependent.
> >
> > Yes, it sounds like your diagnosis is correct. One way to fix this is
> > to have a specific abbreviation listed in src/gen/eventtype.py in the
> > _ABBREVIATIONS dictionary. There are only three listed, so it seems
> > the algorithm in get_abbreviation works most of the time, but here you
> > found one that should perhaps be hard coded.
>
> Yes, hard code, and use context to translate:
> _(Cause of death|c.o.d.)
>
> Benny
>
> > -Doug
> >
> > > /Peter
> >
> > -------------------------------------------------------------------------
> > -----
> >
> > > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> > > Tap into the largest installed PC base & get more eyes on your game by
> > > optimizing for Intel(R) Graphics Technology. Get started today with the
> > > Intel(R) Software Partner Program. Five $500 cash prizes are up for
> >
> > grabs.
> >
> > > http://p.sf.net/sfu/intelisp-dev2dev
> > > _______________________________________________
> > > Gramps-devel mailing list
> > > Gramps-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gramps-devel
> >
> > -------------------------------------------------------------------------
> > ----- Increase Visibility of Your 3D Game App & Earn a Chance To Win
> > $500! Tap into the largest installed PC base & get more eyes on your
> > game by optimizing for Intel(R) Graphics Technology. Get started today
> > with the Intel(R) Software Partner Program. Five $500 cash prizes are up
> > for grabs. http://p.sf.net/sfu/intelisp-dev2dev
> > _______________________________________________
> > Gramps-devel mailing list
> > Gramps-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gramps-devel

--
Peter Landgren
Talken Hagen
671 94  BRUNSKOG
0570-530 21
070-345 0964
peter.talken@telia.com
Skype: pgl4820.2