I asked about this on IRC, but didn’t get a response. It didn’t seem to have been discussed in a quick search of the forum either. In summary, it would be nice if translations for Places could be used in reports and graphs.
In my Places tree, I have Alternative Names for them in other languages like French (fr) and Spanish (es). When I generate a Family Lines Graph or Detailed Ancestral Report in French, for example, those Alternative Names don’t get used. Is this a bug and if not could it be a feature instead?
You need to make sure that the main place Name field also has a language code. At the end of the place Name field and before the Type field there is an edit Icon. This opens the same edit window for the main entry as the Alternative name entries.
That worked for the Family Lines Graph, but not the Detailed Ancestral Report.
That’s interesting. I’d never noticed that. Setting the default to ‘en’ doesn’t allow the French Alternative Name to be used in the Detailed Ancestral Report, however.
Do you have an SQL snippet for lazy people (me) I could use via the sqlite3 console to add ‘en’ as the default place language for all those that don’t have it already? It wasn’t clear to me from the table’s schema how that’s managed. Maybe there’s a way to mass update them from the interface that’s safer.
Using the Place Format Editor you should be able to create a format named ‘French’ setting fr in the language field. Then set ‘French’ as the place name format in Preferences causing French place names to be displayed throughout the Gramps GUI. This should carry over into all reports.
I use the endonym for all place names. I add the English name as an alternative so I can search for the record. When needed, I’ll add the record using the latin alphabet with the native script as another alternative. I do not add the language codes since I never have the need to translate place names.
French place names are in French. German place names are in German.
I use the Narrative Web as the report I create for cousins so all this gets added to the place record. I also add the Wikipedia page to each place record. If someone doesn’t know where Suomi is they can learn something.
Perhaps we can brainstorm adapting their Place name formatting approach to the other report. Having a Report from a similar category is usually easier to use as a reference example.
Posting a Feature Request with a possible patch is more likely to yield results.
The Detailed Ancestral Report source has a pretty basic place format handling: self.place_format = menu.get_option_by_name("place_format").get_value()
def get_event_place(self, event):
"""get the place of the event"""
place_text = ""
place_handle = event.get_place_handle()
if place_handle:
place = self._db.get_place_from_handle(place_handle)
if place:
place_text = _pd.display(self._db, place)
place_text = html.escape(place_text)
return place_text
Setting the place format in Preferences to either FRENCH or SPANISH, the Detailed Ancestral Report displayed the place in the correct language. Setting the default to Full in Preferences displayed the English name in the GUI. When running the DAR, I set the Place format option to FRENCH and the report displayed the French place name.
That’s the part I missed. It’s a good workaround. Thanks!
This is the part I’m unsure about the correct solution. Users can add multiple Alternative Names with the same language, so which one would get selected? Is the workaround ITT the best way to handle it instead of assuming that setting the report/graph language would pull in Alternate Names with the same language like I was proposing?
If the event date is after 1690 Woodstock is displayed. Events between 1620 and 1690 New Roxbury displays. The last entry is there in case an event has no date. No date is looking for the earliest date (think 1 Jan 0001). An entry before <date> will also handle an event with no date. But is that the name you want to display.
What I am showing is for the English or default language.
To do the same for other languages you need to add additional entries with the dates but also for the language.
Just remember that the main place name entry is evaluated first then the list of alternatives in order. The first entry that returns as true for the date and/or language will be the name displayed.
You should list the endonym before the exonyms. The language can be left empty for the endonym, since the first name matching the date range will be used if there is no matching exonym.
For example:
Firenze “” or “it”
Florence “en”
will display “Firenze” for all languages except for English when “Florence” will be displayed.