Page 1 of 1

how to print approximate dates in other language

Posted: 17 Dec 2018 19:53
by piotao
Hi,
I didn't found that in the forum nor on google, so here's the question.

I have a date format defined as follows:

Code: Select all

=TextIf(Year(%INDI.BIRT.DATE:XDATE1%) = Year(%INDI.BIRT.DATE:XDATE2%),Year(%INDI.BIRT.DATE:XDATE1%),%INDI.BIRT.DATE:ABBREV4%)
This expression is working nicely and it is generating dates as year, no matter if the whole date was entered or single year only.
And it works great only when date is entered as a valid date. When date is entered approximately either as "before 1900" or as "circa 1900", then on my output additional word appears, "bef" or "c", which I would like to change to another word more suitable to the language I'm working on ("przed" and "około" respectively). How to do that?

Simply put, I don't know where/how to change prefixes or suffixes added to date by the program when date is not exact. Maybe there is something in configuration which I have overlooked?

Re: how to print approximate dates in other language

Posted: 17 Dec 2018 23:43
by tatewise
No, you have not overlooked any settings. FH does NOT currently support foreign languages in any way at all.

With your expression circa Dates (and also Approximate, Calculated & Estimated Dates) only produce the Year.
Also Quarter Dates only produce the Year.

So the only ones you need to translate are Range Dates (before, after & between) and maybe Period Dates (from & to).
That will need a nested test for every XDATETYPE such as:

Code: Select all

TextIf(%INDI.BIRT.DATE:XDATETYPE%="After", Text("po " . Year(%INDI.BIRT.DATE%) ), TextIf(%INDI.BIRT.DATE:XDATETYPE%="Before",Text("przed " . Year(%INDI.BIRT.DATE%)), TextIf(%INDI.BIRT.DATE:XDATETYPE%="Between",Text("pomiędzy " . Year(%INDI.BIRT.DATE:XDATE1%) . " i " . Year(%INDI.BIRT.DATE:XDATE2%)), %INDI.BIRT.DATE:ABBREV4% )))
and insert that where you currently have just %INDI.BIRT.DATE:ABBREV4%.

So the full expression coping with just After, Before & Between would become:

Code: Select all

=TextIf(Year(%INDI.BIRT.DATE:XDATE1%)=Year(%INDI.BIRT.DATE:XDATE2%), Year(%INDI.BIRT.DATE%), TextIf(%INDI.BIRT.DATE:XDATETYPE%="After", Text("po " . Year(%INDI.BIRT.DATE%) ), TextIf(%INDI.BIRT.DATE:XDATETYPE%="Before",Text("przed " . Year(%INDI.BIRT.DATE%)), TextIf(%INDI.BIRT.DATE:XDATETYPE%="Between",Text("pomiędzy " . Year(%INDI.BIRT.DATE:XDATE1%) . " i " . Year(%INDI.BIRT.DATE:XDATE2%)), %INDI.BIRT.DATE:ABBREV4% ))))
But that needs to also cope with From, To & From/To.
See the Help at the end of Date Formats for details.

Re: how to print approximate dates in other language

Posted: 26 Dec 2018 19:28
by piotao
Brilliant!!!
Thank you, this solution works like a charm. In fact, it's now a quite a code fragment... :)