GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 
Name.Alternative for Parents and Siblings


https://support.genopro.com/Topic16826.aspx
Print Topic | Close Window

By nadiminti - Thursday, March 15, 2007
Hi
I am using Name.Alternative for the English name and for addressing it in the Report Skin, I need the tag name for the Parents and Siblings.

Could you please help me in addressing the above issue of Name.Alternative Tag for Parents and / or Siblings

I could not understand how i.Father is arrived.

I am getting this:

Ram's father is అధికార్ల కృష్ణయ్య and his mother is నడిమింటి (అధికార్ల) లక్ష్మి.

whereas I want to get
Ram's father is Krishnaiah and his mother is Lakshmi

The Italics are the names filled in as Alternative Names.

Thanks in advance for your comments / suggestions /help

By genome - Thursday, March 15, 2007
As I understand it, the default property of an Individual object is Name.  i.Father points to an Individual object, and so by default the Name property is returned. But you can of course also say i.Father.Name.Alternative to return the Alternative name of i's father.
By nadiminti - Thursday, March 15, 2007
Hi Ron,

Thanks for the suggestion. I have tried but it gives the following error.

Error at line 311 (Code/Util.vbs) generating 'ind00003.htm': Object required: 'obj'
Microsoft VBScript runtime error 800A01A8


where as the line 311 of Util.vbs is
Report.WritePhraseDic "PhParents", strNameEng, ToBe(i.Father), StrHtmlHyperlink(i.Father.Name.Alternative), strPnR, ToBe(i.Mother), StrHtmlHyperlink(i.Mother)


If I give i.Father, it is working OK. In the above code, I have changed strNameEng where strNameEng=StrPossessiveProperNoun(i.Name.Alternative) and it is being picked correctly. I do not know where I am going wrong.
By genome - Thursday, March 15, 2007
The i.Father.Name.Alternative will only work where a string result is expected, e.g. a name. the Function StrHtmlHyperlink requires an object as its parameter, not a string, and is used to generate a hyperlink to that individuals page. You could define a new function StrHtmlHyperlinkAlt

Function StrHtmlHyperlinkAlt(obj)
  Dim coll
  Set coll = Util.NewGenoCollection()
  coll.Add obj
  StrHtmlHyperlinkAlt = coll.ToHtmlHyperlinks("Name.Alternative", StrNameNN(obj),,"target='detail' onclick='hidePopUpFrame();'")
End Function

and replace for example StrHtmlHyperLink(i.Father) with StrHtmlHyperLinkAlt(i.Father)

By nadiminti - Thursday, March 15, 2007
Hi Ron,

Needless to say that it worked. Great!!

Thanks a ton!!
regards
Sriram
By genome - Thursday, March 15, 2007
The suggested function StrHtmlHyperlinkAlt is rather convoluted in that the Individual object is first added to a collection of objects before deriving the hyperlink via ToHtmlHyperlinks. The GenoCollections method ToHtmlHyperlinks has parameters to specify which tag to use for the hyperlink text, what to use instead if that tag is blank and also extra attributes for the hyperlink anchor tag such as target etc. Unfortunately the equivalent method ToHtmlHyperlink for a single GenoObject, such as an Individual, rather than  a collection of such objects does does accept these extra parameters (according to the published SDK).

It would be most useful if Dan could also provide this extra functionality in the ToHtmlHyperlink method. This would also allow simplification or even redundancy for the function StrHtmlHyperlink.

By GenoProSupport - Thursday, March 15, 2007
Ron (3/15/2007)
It would be most useful if Dan could also provide this extra functionality in the ToHtmlHyperlink method. This would also allow simplification or even redundancy for the function StrHtmlHyperlink.

This is a good suggestion.  Ron, you pushed the report generator beyond anything I could dream of.  I realize some of the core routines, especially the ones creating hyperlinks have limitations.  One feature I have in mind is having an object containing all the parameters to create hyperlinks.  This way, instead of passing half a dozen of parameters, a single object would do the trick.  New parameters could be added without having to change the prototype of the function.

At the moment, I cannot give an ETA.  Tomorrow I have a meeting with a CEO to get a crash course how to structure an organization.  I need someone to handle the sales, marketing and some of the support so I can focus on research and development.

By nadiminti - Friday, March 16, 2007
Hi Ron,
I have no luck with Siblings. The code works perfectly well with Parents, Parents.Parents (Grand parents)
With siblings it seems to be very complicated to get the names out.

I am at the StrHtmlCollectionMFU portion of the Lang.VBS.
Can you please give some direction / suggestion
regards
Sriram
By genome - Friday, March 16, 2007
Yes this code is buried a little deeper. The hyperlinks for the list of siblings is ultimately generated by the function StrHtmlNarrativeNames at about line 662 of Lang.vbs. This is used both for the full and short forms of names (Name & Name.Short). I suggest you change line 675
from
strName = i.TagValue(strTagName)
to
strName = Util.FirstNonEmpty(i.Name.Alternative, i.TagValue(strTagName))

so that any Alternative name is used in preference to the full or short name.
By nadiminti - Saturday, March 17, 2007
Hi Ron,
Thanks again. I am struck a little further now.

It is PlurialCardinal. In telugu we do not have 's' added for plurality. So I tried to take the help on Genopro website about PlurialCardinal - it did not help. I have searched for PlurialCardinal in the support site and found no help there too.

As I understand, when PlurialCardinal is invoked, it gets two parts, one takes __FmtPlurial and the other based on the value of second part takes the appropriate Cardinal and return both values to the invoker.

I am using Lang.vbs

Now my Q:
a. Is my understanding correct?
b. How can I get rid of "s" but at the same time for English it remains same.
c. How to trigger that it should use C1, C2 etc?
d. Do I need to post this separately?


<_FmtPlurial T="{}" P="{}s" C1="{}" C2="{}" />
<_FmtPlurialCount T="{0} {1}" />
<_FmtPlurialCardinal T="{0} {1}" />

<_Cardinal_0 T="zero"/>
<_Cardinal_1 T="one"/>
<_Cardinal_2 T="ఇద్దరు"/>
<_Cardinal_3 T="ముగ్గురు"/>


Thanks and regards
Sriram
By genome - Saturday, March 17, 2007
nadiminti (3/17/2007)
As I understand, when PlurialCardinal is invoked, it gets two parts, one takes __FmtPlurial and the other based on the value of second part takes the appropriate Cardinal and return both values to the invoker.

Now my Q:
a. Is my understanding correct?
b. How can I get rid of "s" but at the same time for English it remains same.
c. How to trigger that it should use C1, C2 etc?
d. Do I need to post this separately?

a. Your understanding is not quite correct. When PlurialCardinal is invoked the first part is only taken from _FmtPlurial when the count supplied to PlurialCardinal is > 1 and the target Dictionary element has no 'P' attribute.

e.g. in Lang.vbs line 624 we have

  Dic.PlurialCardinal(strDicPrefix & "M", cMales), _

If strDicPrefix is Sibling_M then the Dictionary element is
<Sibling_M T="brother" C1="a brother" />
and that has no P attribute and so if the count is > 1 then _FmtPlurial is used and brothers is returned. However if strDicPrefix is Sibling_ the entry is
<Sibling_ T="sibling of unknown gender" P="siblings of unknown gender" C1="a sibling of unknown gender" />
and so when the count > 1 the P attribute siblings of unknown gender is returned.

b. I assume from this question you are attempting a dual language report using a single Dictionary.xml. This is always going to be problematic because as yet the Dictionary does not support multiple language alternatives. One way it could be achieved now is to use separate elements for each language. And so as well as the existing

<Sibling_M T="brother" C1="a brother" />
you also have
<TE_Sibling_M T="brother" P="brother"  C1="a brother" />
but obviously translated into Telugu. You will then need to ensure that you code uses the correct prefix for each case.

c. The C1, C2 etc. forms are used when the count n matches the Cn value. Note that the C1 form is only used with Dic.PlurialCardinal and not Dic.Plurial. So Dic.PlurialCardinal("Sibling_M", 1) returns 'a brother' and not 'one brother', but Dic.Plurial("Sibling_M",1) returns 'brother'. Dic.PlurialCardinal("Twins",3) returns 'three triplets' but Dic.Plurial("Twins",3) returns 'triplets'.

d. Normally a new topic should be posted as a new thread/topic. But since you are the originator of this thread/topic and the original topic has been dealt with then I guess it is OK. I think a lot depends on the original title - if you had called it 'Problems translating to Telugu' you could include all related queries in the one thread.

By nadiminti - Saturday, March 17, 2007
Hi Ron,

Thanks for the in-roads. I know it is difficult, but I am attempting.

b. I assume from this question you are attempting a dual language report using a single Dictionary.xml. This is always going to be problematic because as yet the Dictionary does not support multiple language alternatives. One way it could be achieved now is to use separate elements for each language. And so as well as the existing

you also have

but obviously translated into Telugu. You will then need to ensure that you code uses the correct prefix for each case.

I am using the following format so that not much time need to be spent on the origins of the correct prefix, though the work on dictionary remains same. I am almost there in having the bi-lingual (dual language) report skin with few crucial, vital exceptions.

Select Case nistel
Case "0"
StrHtmlCollectionMFU = Dic.FormatPhrase("PhCollectionTELMFU", _
Dic.PlurialCardinal(strDicPrefix & "TELM", cMales), _
Dic.PlurialCardinal(strDicPrefix & "TELF", cFemales), _
Dic.PlurialCardinal(strDicPrefix, cCount - cMales - cFemales), strHtmlNames)
Case "1"
StrHtmlCollectionMFU = Dic.FormatPhrase("PhCollectionMFU", _
Dic.PlurialCardinal(strDicPrefix & "M", cMales), _
Dic.PlurialCardinal(strDicPrefix & "F", cFemales), _
Dic.PlurialCardinal(strDicPrefix, coll.Count - cMales - cFemales), strHtmlNames)
End Select


With this I do not have to look for the origins of strDicPrefix - some time saver for me.

I am not a programmer at all and I appreciate your help in suggesting some reading on this Dictionary. I have already gone through GenoPro documents available

Can we have another Dic.PlurialTEL? I am getting VB error when I do so.

regards
Sriram
By nadiminti - Tuesday, March 27, 2007
Hi

I have this problem of identifying where the family strings are generated. Currently, Telugu skin I am working on shows every thing in Telugu (which is OK), but I would like to use Alternative Name.


In the picture above the contents of toc_families.htm is shown.

My basic Question is how "families" is generated?

thanks and regards
By genome - Thursday, March 29, 2007
The family names in the index are generated in Lang.vbs lines 869-870.
    strNameParent = f.Parents(0).Name.Last
    If strNameParent = "" Then strNameParent = f.Parents(1).Name.Last

i.e. it is the last name of the 1st parent/spouse, unless this is blank, in which case the last name of the 2nd parent/spouse is used.

When there is a change of family name then it is written to the report at line 895

     If StrNameParent <> "" Then Report.WriteFormatted strFmtTemplateFamily, strNameParent
By nadiminti - Thursday, March 29, 2007
Hi Ron,
I have tried, but I get the following when I change the code on 869
From
strNameParent = f.Parents(0).Name.Last
To
strNameParent = f.Parents(0).Name.Alternative


The following image shows the result of the above.


What I would like to have is to make the family names appear in English (using the Name.Alternative) (As indicated by Red lines above). The code for that is on lines 897-902
If Not fPicturesOnly Then
Report.WriteFormattedLn strFmtTemplateName, StrHtmlImgFamily(f), f.Href, f.Name, StrHtmlImgPhoto(f)
ElseIf Not Util.IsNothing(pp) Then
Report.WriteFormattedLn strFmtTemplateName, StrHtmlImgFamily(f), f.Href, f.Name, ""


The f.Name, looks like is giving the total family name and I am unable to track it up to make it use Name.Alternative.
thanks and regards
By genome - Thursday, March 29, 2007
f.Name is a built in property generated by GenoPro from the names of the spouses. You could try changing f.Name in the lines you have indicated to Util.FirstNonEmpty(f.Parents(0).Name.Alternative, f.Parents(1).Name.Alternative, f.Name) This will generate the alternative name of the 1st or 2nd spouse, or failing that fall back to the GenoPro family name property.
By nadiminti - Thursday, March 29, 2007
Hi Ron,
I have tried. It works half way though. Now it gives the Alternative Name of Husband only. The wife name along with '&' is missing.

Is it possible that a separate collection of families can be written using Alternative Names?

Can a parents name be referenced like this directly? I am getting a VB error.
f.Parents.Name
f.Parents.Name.Alternative

f.Husband.Name
f.Husband.Name.Alternative


thanks and regards
By genome - Friday, March 30, 2007
Again some misunderstanding of what exactly you are trying to achieve.

f.Parents, f.Husband & f.Wife are arrays so an index qualifier is required. Using Parents rather than Husband & Wife is probably better in case of any same sex relationships so I suggest

Util.IfElse(fParents(0).Name.Alternative <> "" And f.Parents(1).Name.Alternative <> "", f.Parents(0).Name.Alternative & " & " &  f.Parents(1).Name.Alternative, Util.FirstNonEmpty(f.Parents(0).Name.Alternative, f.Parents(1).Name.Alternative, f.Name))

It's a bit of a mouthful, but basically it is :

if alternative names are present for both spouses , join with '&' otherwise use any available alternative and failing that use the GenoPro family name.

By nadiminti - Friday, March 30, 2007
Hi Ron,
Wonderful!!
I thought I would attempt to build a collection or so and you have magically used the wand to clear the matter for me.

With this I have completed the Phase I of Telugu - English bi-lingual Report skin and will post it soon.

Needless to say that but for your support and help, I could not have finished it.
thanks and regards