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

Something like this. But someone native English speaker should correct my attempts and fill in where
I have no suggestion!

   _ABBREVIATIONS = {
       BIRTH: _("birth abbreviation|b"),
       DEATH: _("death abbreviation|d"),
       MARRIAGE: _("marriage abbreviation|m"),
       UNKNOWN: _("Unknown abbreviation|"),
       CUSTOM: _("Custom abbreviation|cust"),
       ADOPT: _("Adopted abbreviation|adop"),
       ADULT_CHRISTEN : _("Adult Christening abbreviation|"),
       BAPTISM: _("Baptism abbreviation|bap"),
       BAR_MITZVAH : _("Bar Mitzvah abbreviation|bar"),
       BAS_MITZVAH : _("Bas Mitzvah abbreviation|bas"),
       BLESS: _("Blessing abbreviation|bles"),
       BURIAL: _("Burial abbreviation|bur"),
       CAUSE_DEATH : _("Cause Of Death abbreviation|c.o.d."),
       CENSUS: _("Census abbreviation|cens"),
       CHRISTEN: _("Christening abbreviation|chr"),
       CONFIRMATION: _("Confirmation abbreviation|conf"),
       CREMATION: _("Cremation abbreviation|crem"),
       DEGREE: _("Degree abbreviation|degr"),
       EDUCATION: _("Education abbreviation|edu"),
       ELECTED: _("Elected abbreviation|elec"),
       EMIGRATION: _("Emigration abbreviation|emi"),
       FIRST_COMMUN: _("First Communion abbreviation|"),
       IMMIGRATION: _("Immigration abbreviation|immi"),
       GRADUATION: _("Graduation abbreviation|gradu"),
       MED_INFO: _("Medical Information abbreviation|"),
       MILITARY_SERV: _("Military Service abbreviation|mil"),
       NATURALIZATION: _("Naturalization abbreviation|natu"),
       NOB_TITLE: _("Nobility Title abbreviation|nob"),
       NUM_MARRIAGES: _("Number of Marriages abbreviation|"),
       OCCUPATION: _("Occupation abbreviation|occu"),
       ORDINATION: _("Ordination abbreviation|ordi"),
       PROBATE: _("Probate abbreviation|prob"),
       PROPERTY: _("Property abbreviation|prop"),
       RELIGION: _("Religion abbreviation|rel"),
       RESIDENCE: _("Residence abbreviation|res"),
       RETIREMENT: _("Retirement abbreviation|ret"),
       WILL: _("Will abbreviation|will"),
       MARR_SETTL: _("Marriage Settlement abbreviation|"),
       MARR_LIC: _("Marriage License abbreviation|"),
       MARR_CONTR: _("Marriage Contract abbreviation|"),
       MARR_BANNS: _("Marriage Banns abbreviation|"),
       MARR_ALT: _("Alternate Marriage abbreviation|"),
       ENGAGEMENT: _("Engagement abbreviation|enga"),
       DIVORCE: _("Divorce abbreviation|div"),
       DIV_FILING: _("Divorce Filing abbreviation|"),
       ANNULMENT: _("Annulment abbreviation|annu")
       }

If I understand well, something like
       MARR_SETTL: _("Marriage Settlement abbreviation|"),
which is the empty string, will be displayed how? Because it is empty as m.s.? Then why not write m.s.?
It seems a bad idea to me to have empty strings.

Benny

/Peter


> 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

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