Change attributes from forms

Gramps 5.1.5 on Linux mint 21.3
When I created the danish census’s on forms, I wrongly used Danish language for the attributes. When the form definition became official the attributes were changed to English. This means that I now have a lot of entries from Forms, that I cannot see in the form gramplet. Is there an easy way of changing the attribute types, or at least see which ancestors I need edit.

OK, I can export the database as xml, and the do a grep.
I could change the entries in xml, and then import, but how do I make sure that I dont loose data in the proces of exporting and importing?

Are you just going to rename the custom types in Attributes?

You should be able to do that without the export/grep/import cycle. Look at the Strategies for leveraging Attributes subsection of the Attributes wiki article for applicable tools.

Fail to see that it helps


I cannot find the attribute type “Fødselsdato” in any list or any tool.
And it should be changed do "Birth date2

Doesn’t the Custom Types Cleanup tool addon directly support harmonizing and renaming?

I cannot find the types that comes from the form plugin

@prculley Paul, could you comment? I don’t have a lot of Form data where I can experiment.

I had exactly the same issue when I used a preliminary version of the US 1950 census. When the form template finalized, I realized that the fields I used were not the same as the fields in the final (github) version.

Initially, I decided to migrate all my data to the new form template. To do this I exported an XML and then wrote sed scripts (on my Mac) to edit the field names. I got pretty far along with this but then decided that there may be attributes with the same name in other forms templates in the form file (some attributes have fairly common names). So either I had to modify the edit scripts to only within the US1950 tag or take another approach.

I decided to take another approach. I put my old US1950 form template and put it in custom.xml and renamed to US1950-old (for instance). Now all my old data worked fine. And I could use the standard US1950 if I wanted to use the new form.

This allows me to use the standard forms templates when I update to a new version, and just copy the custom.xml file.

1 Like

The best approach is probably just to translate the forms back to Danish, then the Danish attributes names will be used.

I’ll generate a Danish translation template for you.

1 Like

I have created the da-local.po file for you.

Start by translating the entries with “Form\form_dk.xml.h” in the comments above them. These are used in the Danish forms.

You should also translate the four strings in “Form/form.py”. They are also used in attributes, but I think that the Danish forms probably only use “Order”.

Thanks Nick, but all new entries I have made is using the english attributes.
As the say in Danish - no matters which way you turns, your ass is always behind you :grinning:

1 Like

In the early days of the Census addon, I wrote a script to do this. I think I wanted to change some of my original attribute names from their original unpublished version.

Unfortunately, I can’t find the script. I’ve looked in all published versions back to v3.2, and on my current development machine. It would be very easy to write again though.

2 Likes

I think it will be just as easy to go with the export import model…
I will proceed with that today.
Thanks to everybody for your efforts

Just an update.
Ended by exporting gramps.
Extracting all attributes via grep and awk, added the translation to the lines, which needed translations.
Fed this dictionary into a perl script, which created the new file, which I imported to gramps.
And remembered I made the same mistake for a custom.xml file for Swedish census and “husförhörsprotokoll” so I also used the script for changing the custom.xml file.
Mission accomplished

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.