From 60f186629273f08c0f7ede7df6a6521b7dbca4d2 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 21 Aug 2020 22:27:23 +0100 Subject: [PATCH] Replace intltool with gettext tools The build now requires gettext v0.19.7 or above. Removed obsolete files: * gramps.applications * gramps.keys * gramps.mime Created ITS rules for holidays.xml and tips.xml files. Included ITS files for shared-mime-info from a gettext v0.20.2 installation. --- .gitignore | 3 - MANIFEST.in | 3 - data/gramps.applications | 7 - data/gramps.desktop.in | 10 +- data/gramps.keys.in | 54 ----- data/gramps.mime | 14 -- data/{holidays.xml.in => holidays.xml} | 96 ++++---- data/tips.xml | 130 ++++++++++ data/tips.xml.in | 130 ---------- po/LINGUAS | 37 +++ po/POTFILES.in | 7 +- po/genpot.sh | 7 - po/its/holidays.its | 6 + po/its/holidays.loc | 4 + po/its/shared-mime-info.its | 9 + po/its/shared-mime-info.loc | 6 + po/its/tips.its | 5 + po/its/tips.loc | 4 + po/update_po.py | 322 ++----------------------- setup.py | 119 +++------ 20 files changed, 303 insertions(+), 670 deletions(-) delete mode 100644 data/gramps.applications delete mode 100644 data/gramps.keys.in delete mode 100644 data/gramps.mime rename data/{holidays.xml.in => holidays.xml} (93%) create mode 100644 data/tips.xml delete mode 100644 data/tips.xml.in create mode 100644 po/LINGUAS delete mode 100755 po/genpot.sh create mode 100644 po/its/holidays.its create mode 100644 po/its/holidays.loc create mode 100644 po/its/shared-mime-info.its create mode 100644 po/its/shared-mime-info.loc create mode 100644 po/its/tips.its create mode 100644 po/its/tips.loc diff --git a/.gitignore b/.gitignore index e0d9e4f83..0c22cb26f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,6 @@ build/ dist/ # Gramps -data/tips.xml -data/holidays.xml -po/.intltool-merge-cache docs/_build/ # Editing diff --git a/MANIFEST.in b/MANIFEST.in index 50c941309..dc0459a10 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -22,9 +22,6 @@ recursive-include test * recursive-include windows * # Remove files created in the build -exclude data/tips.xml -exclude data/holidays.xml -exclude po/.intltool-merge-cache global-exclude *.pyc global-exclude *.pyo diff --git a/data/gramps.applications b/data/gramps.applications deleted file mode 100644 index 65edea604..000000000 --- a/data/gramps.applications +++ /dev/null @@ -1,7 +0,0 @@ -gramps - command=gramps - name=GRAMPS - can_open_multiple_files=false - expects_uris=false - requires_terminal=false - mime_types=application/x-gramps,application/x-gedcom,application/x-gramps-package,application/x-gramps-xml,application/x-geneweb diff --git a/data/gramps.desktop.in b/data/gramps.desktop.in index d85e31e65..5ec22974e 100644 --- a/data/gramps.desktop.in +++ b/data/gramps.desktop.in @@ -1,13 +1,13 @@ [Desktop Entry] -_Name=Gramps -_GenericName=Genealogy System -_X-GNOME-FullName=Gramps Genealogy System -_Comment=Manage genealogical information, perform genealogical research and analysis +Name=Gramps +GenericName=Genealogy System +X-GNOME-FullName=Gramps Genealogy System +Comment=Manage genealogical information, perform genealogical research and analysis Icon=gramps Terminal=false Type=Application StartupNotify=true Categories=GTK;Office; -_Keywords=Genealogy;Family History;Research;Family Tree;GEDCOM; +Keywords=Genealogy;Family History;Research;Family Tree;GEDCOM; MimeType=application/x-gramps;application/x-gedcom;application/x-gramps-package;application/x-gramps-xml; Exec=gramps %F diff --git a/data/gramps.keys.in b/data/gramps.keys.in deleted file mode 100644 index f0a070832..000000000 --- a/data/gramps.keys.in +++ /dev/null @@ -1,54 +0,0 @@ -application/x-gramps: - _description=Gramps database - default_action_type=application - short_list_application_ids=gramps - short_list_application_ids_for_novice_user_level=gramps - short_list_application_ids_for_intermediate_user_level=gramps - short_list_application_ids_for_advanced_user_level=gramps - category=Documents/Genealogy - icon-filename=/usr/share/gramps/gramps.png - open=gramps %f - -application/x-gramps-package: - _description=Gramps package - default_action_type=application - short_list_application_ids=gramps - short_list_application_ids_for_novice_user_level=gramps - short_list_application_ids_for_intermediate_user_level=gramps - short_list_application_ids_for_advanced_user_level=gramps - category=Documents/Genealogy - icon-filename=/usr/share/gramps/gramps.png - open=gramps %f - -application/x-gramps-xml: - _description=Gramps XML database - default_action_type=application - short_list_application_ids=gramps - short_list_application_ids_for_novice_user_level=gramps - short_list_application_ids_for_intermediate_user_level=gramps - short_list_application_ids_for_advanced_user_level=gramps - category=Documents/Genealogy - icon-filename=/usr/share/gramps/gramps.png - open=gramps %f - -application/x-gedcom: - _description=GEDCOM - default_action_type=application - short_list_application_ids=gramps - short_list_application_ids_for_novice_user_level=gramps - short_list_application_ids_for_intermediate_user_level=gramps - short_list_application_ids_for_advanced_user_level=gramps - category=Documents/Genealogy - icon-filename=/usr/share/gramps/gramps.png - open=gramps %f - -application/x-geneweb: - _description=GeneWeb - default_action_type=application - short_list_application_ids=gramps - short_list_application_ids_for_novice_user_level=gramps - short_list_application_ids_for_intermediate_user_level=gramps - short_list_application_ids_for_advanced_user_level=gramps - category=Documents/Genealogy - icon-filename=/usr/share/gramps/gramps.png - open=gramps %f diff --git a/data/gramps.mime b/data/gramps.mime deleted file mode 100644 index f11609f16..000000000 --- a/data/gramps.mime +++ /dev/null @@ -1,14 +0,0 @@ -application/x-gramps - ext: grdb - -application/x-gramps-xml - ext: gramps - -application/x-gramps-package - ext: gpkg - -application/x-gedcom - ext: ged gedcom GED GEDCOM - -application/x-geneweb - ext: gw GW diff --git a/data/holidays.xml.in b/data/holidays.xml similarity index 93% rename from data/holidays.xml.in rename to data/holidays.xml index c2dedb9d9..dc2685bde 100644 --- a/data/holidays.xml.in +++ b/data/holidays.xml @@ -1,6 +1,6 @@ - + @@ -49,7 +49,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -104,10 +104,10 @@ - + - + @@ -123,7 +123,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -168,7 +168,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -315,7 +315,7 @@ - + @@ -338,37 +338,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -384,7 +384,7 @@ - + @@ -397,7 +397,7 @@ - + @@ -412,7 +412,7 @@ - + @@ -427,7 +427,7 @@ - + @@ -444,7 +444,7 @@ - + @@ -471,7 +471,7 @@ - + @@ -498,7 +498,7 @@ - + diff --git a/data/tips.xml b/data/tips.xml new file mode 100644 index 000000000..4bb2cc2e1 --- /dev/null +++ b/data/tips.xml @@ -0,0 +1,130 @@ + + + +Working with Dates
A range of dates can be given by using the format "between January 4, 2000 and March 20, 2003". You can also indicate the level of confidence in a date and even choose between seven different calendars. Try the button next to the date field in the Events Editor.
+ +Editing Objects
In most cases double clicking on a name, source, place or media entry will bring up a window to allow you to edit the object. Note that the result can be dependent on context. For example, in the Family View clicking on a parent or child will bring up the Relationship Editor.
+ +Adding Images
An image can be added to any gallery or the Media View by dragging and dropping it from a file manager or a web browser. Actually you can add any type of file like this, useful for scans of documents and other digital sources.
+ +Ordering Children in a Family
The birth order of children in a family can be set by using drag and drop. This order is preserved even when they do not have birth dates.
+ +Talk to Relatives Before It Is Too Late
Your oldest relatives can be your most important source of information. They usually know things about the family that haven't been written down. They might tell you nuggets about people that may one day lead to a new avenue of research. At the very least, you will get to hear some great stories. Don't forget to record the conversations!
+ +Filtering People
In the People View, you can 'filter' individuals based on many criteria. To define a new filter go to "Edit > Person Filter Editor". There you can name your filter and add and combine rules using the many preset rules. For example, you can define a filter to find all adopted people in the family tree. People without a birth date mentioned can also be filtered. To get the results save your filter and select it at the bottom of the Filter Sidebar, then click Apply. If the Filter Sidebar is not visible, select View > Filter.
+ +Inverted Filtering
Filters can easily be reversed by using the 'invert' option. For instance, by inverting the 'People with children' filter you can select all people without children.
+ +Locating People
By default, each surname in the People View is listed only once. By clicking on the arrow to the left of a name, the list will expand to show all individuals with that last name. To locate any Family Name from a long list, select a Family Name (not a person) and start typing. The view will jump to the first Family Name matching the letters you enter.
+ +The Family View
The Family View is used to display a typical family unit as two parents and their children.
+ +Changing the Active Person
Changing the Active Person in views is easy. In the Relationship view just click on anyone. In the Ancestry View doubleclick on the person or right click to select any of their spouses, siblings, children or parents.
+ +Who Was Born When?
Under "Tools > Analysis and exploration > Compare Individual Events..." you can compare the data of individuals in your database. This is useful, say, if you wish to list the birth dates of everyone in your database. You can use a custom filter to narrow the results.
+ +Gramps Tools
Gramps comes with a rich set of tools. These allow you to undertake operations such as checking the database for errors and consistency. There are research and analysis tools such as event comparison, finding duplicate people, interactive descendant browser, and many others. All tools can be accessed through the "Tools" menu.
+ +Calculating Relationships
To check if two people in the database are related (by blood, not marriage) try the tool under "Tools > Utilities > Relationship Calculator...". The exact relationship as well as all common ancestors are reported.
+ +SoundEx can help with family research
SoundEx solves a long standing problem in genealogy, how to handle spelling variations. The SoundEx Gramplet takes a surname and generates a simplified form that is equivalent for similar sounding names. Knowing the SoundEx Code for a surname is very helpful for researching Census Data files (microfiche) at a library or other research facility. To view the SoundEx codes for surnames in your database, add the SoundEx Gramplet.
+ +Setting Your Preferences
"Edit > Preferences..." lets you modify a number of settings, such as the path to your media files, and allows you to adjust many aspects of the Gramps presentation to your needs. Each separate view can also be configured under "View > Configure View..."
+ +Gramps Reports
Gramps offers a wide variety of reports. The Graphical Reports and Graphs can present complex relationships easily and the Text Reports are particularly useful if you want to send the results of your family tree to members of the family via email. If you're ready to make a website for your family tree then there's a report for that as well.
+ +Starting a New Family Tree
A good way to start a new family tree is to enter all the members of the family into the database using the Person View (use "Edit > Add..." or click on the Add a new person button from the People View). Then go to the Relationship View and create relationships between people.
+ +What's That For?
Unsure what a button does? Simply hold the mouse over a button and a tooltip will appear.
+ +Unsure of a Date?
If you're unsure about the date an event occurred, Gramps allows you to enter a wide range of date formats based on a guess or an estimate. For instance, "about 1908" is a valid entry for a birth date in Gramps. Click the Date button next to the date field and see the Gramps Manual to learn more.
+ +Duplicate Entries
"Tools > Database Processing > Find Possible Duplicate People..." allows you to locate (and merge) entries of the same person entered more than once in the database.
+ +Merging Entries
The function "Edit > Compare and Merge..." allows you to combine separately listed people into one. Select the second entry by holding the Control key as you click. This is very useful for combining two databases with overlapping people, or combining erroneously entered differing names for one individual. This also works for the Places, Sources and Repositories views.
+ +Organising the Views
Many of the views can present your data as either a hierarchical tree or as a simple list. Each view can also be configured to the way you like it. Have a look to the right of the top toolbar or under the "View" menu.
+ +Navigating Back and Forward
Gramps maintains a list of previous active objects such as People and Events. You can move forward and backward through the list using "Go > Forward" and "Go > Back" or the arrow buttons.
+ +Keyboard Shortcuts
Tired of having to take your hand off the keyboard to use the mouse? Many functions in Gramps have keyboard shortcuts. If one exists for a function it is displayed on the right side of the menu.
+ +Read the Manual
Don't forget to read the Gramps manual, "Help > User Manual". The developers have worked hard to make most operations intuitive but the manual is full of information that will make your time spent on genealogy more productive.
+ +Adding Children
To add children in Gramps there are two options. You can find one of their parents in the Families View and open the family. Then choose to create a new person or add an existing person. You can also add children (or siblings) from inside the Family Editor.
+ +Editing the Parent-Child Relationship
You can edit the relationship of a child to its parents by double clicking the child in the Family Editor. Relationships can be any of Adopted, Birth, Foster, None, Sponsored, Stepchild and Unknown.
+ +Show All Checkbutton
When adding an existing person as a spouse, the list of people shown is filtered to display only people who could realistically fit the role (based on dates in the database). In case Gramps is wrong in making this choice, you can override the filter by checking the Show All checkbutton.
+ +Improving Gramps
Users are encouraged to request enhancements to Gramps. Requesting an enhancement can be done either through the gramps-users or gramps-devel mailing lists, or by going to https://gramps-project.org/bugs/ and creating a Feature Request. Filing a Feature Request is preferred but it can be good to discuss your ideas on the email lists.
+ +Gramps Mailing Lists
Want answers to your questions about Gramps? Check out the gramps-users email list. Many helpful people are on the list, so you're likely to get an answer quickly. If you have questions related to the development of Gramps, try the gramps-devel list. You can see the lists by selecting "Help > Gramps Mailing Lists".
+ +Contributing to Gramps
Want to help with Gramps but can't write programs? Not a problem! A project as large as Gramps requires people with a wide variety of skills. Contributions can be anything from writing documentation to testing development versions and helping with the web site. Start by subscribing to the Gramps developers mailing list, gramps-devel, and introducing yourself. Subscription information can be found at "Help > Gramps Mailing Lists"
+ +So What's in a Name?
The name Gramps was suggested to the original developer, Don Allingham, by his father. It stands for Genealogical Research and Analysis Management Program System. It is a full-featured genealogy program letting you store, edit, and research genealogical data. The Gramps database back end is so robust that some users are managing genealogies containing hundreds of thousands of people.
+ +Bookmarking Individuals
The Bookmarks menu is a convenient place to store the names of frequently used individuals. Selecting a bookmark will make that person the Active Person. To bookmark someone make them the Active Person then go to "Bookmarks > Add Bookmark" or press Ctrl+D. You can also bookmark most of the other objects.
+ +Incorrect Dates
Everyone occasionally enters dates with an invalid format. Incorrect date formats will show up in Gramps with a either a reddish background or a red dot on the right edge of the field. You can fix the date using the Date Selection dialog which can be opened by clicking on the date button. The format of the date is set under "Edit > Preferences > Display".
+ +Listing Events
Events are added using the editor opened with "Person > Edit Person > Events". There is a long list of preset event types. You can add your own event types by typing in the text field, they will be added to the available events, but not translated.
+ +Managing Names
It is easy to manage people with several names in Gramps. In the Person Editor select the Names tab. You can add names of different types and set the preferred name by dragging it to the Preferred Name section.
+ +Ancestor View
The Ancestry View displays a traditional pedigree chart. Hold the mouse over an individual to see more information about them or right click on an individual to access other family members and settings. Play with the settings to see the different options.
+ +Managing Sources
The Sources View shows a list of all sources in a single window. From here you can edit your sources, merge duplicates and see which individuals reference each source. You can use filters to group your sources.
+ +Managing Places
The Places View shows a list of all places in the database. The list can be sorted by a number of different criteria, such as City, County or State.
+ +Media View
The Media View shows a list of all media entered in the database. These can be graphic images, videos, sound clips, spreadsheets, documents, and more.
+ +Filters
Filters allow you to limit the people seen in the People View. In addition to the many preset filters, Custom Filters can be created limited only by your imagination. Custom filters are created from "Edit > Person Filter Editor".
+ +The GEDCOM File Format
Gramps allows you to import from, and export to, the GEDCOM format. There is extensive support for the industry standard GEDCOM version 5.5, so you can exchange Gramps information to and from users of most other genealogy programs. Filters exist that make importing and exporting GEDCOM files trivial.
+ +The Gramps XML Package
You can export your Family Tree as a Gramps XML Package. This is a compressed file containing your family tree data and all the media files connected to the database (images for example). This file is completely portable so is useful for backups or sharing with other Gramps users. This format has the key advantage over GEDCOM that no information is ever lost when exporting and importing.
+ +Web Family Tree Format
Gramps can export data to the Web Family Tree (WFT) format. This format allows a family tree to be displayed online using a single file, instead of many html files.
+ +Making a Genealogy Website
You can easily export your family tree to a web page. Select the entire database, family lines or selected individuals to a collection of web pages ready for upload to the World Wide Web.
+ +Reporting Bugs in Gramps
The best way to report a bug in Gramps is to use the Gramps bug tracking system at https://gramps-project.org/bugs/
+ +The Gramps Homepage
The Gramps homepage is at http://gramps-project.org/
+ +Privacy in Gramps
Gramps helps you to keep personal information secure by allowing you to mark information as private. Data marked as private can be excluded from reports and data exports. Look for the padlock which toggles records between private and public.
+ +Keeping Good Records
Be accurate when recording genealogical information. Don't make assumptions while recording primary information; write it exactly as you see it. Use bracketed comments to indicate your additions, deletions or comments. Use of the Latin 'sic' is recommended to confirm the accurate transcription of what appears to be an error in a source.
+ +Extra Reports and Tools
Extra tools and reports can be added to Gramps with the "Addon" system. See them under "Help > Extra Reports/Tools". This is the best way for advanced users to experiment and create new functionality.
+ +Book Reports
The Book report under "Reports > Books > Book Report...", allows you to collect a variety of reports into a single document. This single report is easier to distribute than multiple reports, especially when printed.
+ +Gramps Announcements
Interested in getting notified when a new version of Gramps is released? Join the Gramps-announce mailing list at "Help > Gramps Mailing Lists"
+ +Record Your Sources
Information collected about your family is only as good as the source it came from. Take the time and trouble to record all the details of where the information came from. Whenever possible get a copy of original documents.
+ +Directing Your Research
Go from what you know to what you do not. Always record everything that is known before making conjectures. Often the facts at hand suggest plenty of direction for more research. Don't waste time looking through thousands of records hoping for a trail when you have other unexplored leads.
+ +The 'How and Why' of Your Genealogy
Genealogy isn't only about dates and names. It is about people. Be descriptive. Include why things happened, and how descendants might have been shaped by the events they went through. Narratives go a long way in making your family history come alive.
+ +Don't speak English?
Volunteers have translated Gramps into more than 40 languages. If Gramps supports your language and it is not being displayed, set the default language in your operating system and restart Gramps.
+ +Gramps Translators
Gramps has been designed so that new translations can easily be added with little development effort. If you are interested in participating please email gramps-devel@lists.sf.net
+ +Hello, привет or 喂
Whatever script you use Gramps offers full Unicode support. Characters for all languages are properly displayed.
+ +The Home Person
Anyone can be chosen as the Home Person in Gramps. Use "Edit > Set Home Person" in the Person View. The home person is the person who is selected when the database is opened or when the home button is pressed.
+ +The Gramps Code
Gramps is written in a computer language called Python using the GTK and GNOME libraries for the graphical interface. Gramps is supported on any computer system where these programs have been ported. Gramps is known to be run on Linux, BSD, Solaris, Windows and Mac OS X.
+ +Open Source Software
The Free/Libre and Open Source Software (FLOSS) development model means Gramps can be extended by any programmer since all of the source code is freely available under its license. So it's not just about free beer, it's also about freedom to study and change the tool. For more about Open Source software lookup the Free Software Foundation and the Open Source Initiative.
+ +The Gramps Software License
You are free to use and share Gramps with others. Gramps is freely distributable under the GNU General Public License, see http://www.gnu.org/licenses/licenses.html#GPL to read about the rights and restrictions of this license.
+ +Gramps for Gnome or KDE?
For Linux users Gramps works with whichever desktop environment you prefer. As long as the required GTK libraries are installed it will run fine.
+ +
diff --git a/data/tips.xml.in b/data/tips.xml.in deleted file mode 100644 index 6d132a429..000000000 --- a/data/tips.xml.in +++ /dev/null @@ -1,130 +0,0 @@ - - - -<_tip number="1">Working with Dates
A range of dates can be given by using the format "between January 4, 2000 and March 20, 2003". You can also indicate the level of confidence in a date and even choose between seven different calendars. Try the button next to the date field in the Events Editor. - -<_tip number="2">Editing Objects
In most cases double clicking on a name, source, place or media entry will bring up a window to allow you to edit the object. Note that the result can be dependent on context. For example, in the Family View clicking on a parent or child will bring up the Relationship Editor. - -<_tip number="3">Adding Images
An image can be added to any gallery or the Media View by dragging and dropping it from a file manager or a web browser. Actually you can add any type of file like this, useful for scans of documents and other digital sources. - -<_tip number="4">Ordering Children in a Family
The birth order of children in a family can be set by using drag and drop. This order is preserved even when they do not have birth dates. - -<_tip number="5">Talk to Relatives Before It Is Too Late
Your oldest relatives can be your most important source of information. They usually know things about the family that haven't been written down. They might tell you nuggets about people that may one day lead to a new avenue of research. At the very least, you will get to hear some great stories. Don't forget to record the conversations! - -<_tip number="7">Filtering People
In the People View, you can 'filter' individuals based on many criteria. To define a new filter go to "Edit > Person Filter Editor". There you can name your filter and add and combine rules using the many preset rules. For example, you can define a filter to find all adopted people in the family tree. People without a birth date mentioned can also be filtered. To get the results save your filter and select it at the bottom of the Filter Sidebar, then click Apply. If the Filter Sidebar is not visible, select View > Filter. - -<_tip number="8">Inverted Filtering
Filters can easily be reversed by using the 'invert' option. For instance, by inverting the 'People with children' filter you can select all people without children. - -<_tip number="9">Locating People
By default, each surname in the People View is listed only once. By clicking on the arrow to the left of a name, the list will expand to show all individuals with that last name. To locate any Family Name from a long list, select a Family Name (not a person) and start typing. The view will jump to the first Family Name matching the letters you enter. - -<_tip number="10">The Family View
The Family View is used to display a typical family unit as two parents and their children. - -<_tip number="11">Changing the Active Person
Changing the Active Person in views is easy. In the Relationship view just click on anyone. In the Ancestry View doubleclick on the person or right click to select any of their spouses, siblings, children or parents. - -<_tip number="12">Who Was Born When?
Under "Tools > Analysis and exploration > Compare Individual Events..." you can compare the data of individuals in your database. This is useful, say, if you wish to list the birth dates of everyone in your database. You can use a custom filter to narrow the results. - -<_tip number="13">Gramps Tools
Gramps comes with a rich set of tools. These allow you to undertake operations such as checking the database for errors and consistency. There are research and analysis tools such as event comparison, finding duplicate people, interactive descendant browser, and many others. All tools can be accessed through the "Tools" menu. - -<_tip number="14">Calculating Relationships
To check if two people in the database are related (by blood, not marriage) try the tool under "Tools > Utilities > Relationship Calculator...". The exact relationship as well as all common ancestors are reported. - -<_tip number="15">SoundEx can help with family research
SoundEx solves a long standing problem in genealogy, how to handle spelling variations. The SoundEx Gramplet takes a surname and generates a simplified form that is equivalent for similar sounding names. Knowing the SoundEx Code for a surname is very helpful for researching Census Data files (microfiche) at a library or other research facility. To view the SoundEx codes for surnames in your database, add the SoundEx Gramplet. - -<_tip number="16">Setting Your Preferences
"Edit > Preferences..." lets you modify a number of settings, such as the path to your media files, and allows you to adjust many aspects of the Gramps presentation to your needs. Each separate view can also be configured under "View > Configure View..." - -<_tip number="17">Gramps Reports
Gramps offers a wide variety of reports. The Graphical Reports and Graphs can present complex relationships easily and the Text Reports are particularly useful if you want to send the results of your family tree to members of the family via email. If you're ready to make a website for your family tree then there's a report for that as well. - -<_tip number="18">Starting a New Family Tree
A good way to start a new family tree is to enter all the members of the family into the database using the Person View (use "Edit > Add..." or click on the Add a new person button from the People View). Then go to the Relationship View and create relationships between people. - -<_tip number="19">What's That For?
Unsure what a button does? Simply hold the mouse over a button and a tooltip will appear. - -<_tip number="20">Unsure of a Date?
If you're unsure about the date an event occurred, Gramps allows you to enter a wide range of date formats based on a guess or an estimate. For instance, "about 1908" is a valid entry for a birth date in Gramps. Click the Date button next to the date field and see the Gramps Manual to learn more. - -<_tip number="21">Duplicate Entries
"Tools > Database Processing > Find Possible Duplicate People..." allows you to locate (and merge) entries of the same person entered more than once in the database. - -<_tip number="22">Merging Entries
The function "Edit > Compare and Merge..." allows you to combine separately listed people into one. Select the second entry by holding the Control key as you click. This is very useful for combining two databases with overlapping people, or combining erroneously entered differing names for one individual. This also works for the Places, Sources and Repositories views. - -<_tip number="23">Organising the Views
Many of the views can present your data as either a hierarchical tree or as a simple list. Each view can also be configured to the way you like it. Have a look to the right of the top toolbar or under the "View" menu. - -<_tip number="24">Navigating Back and Forward
Gramps maintains a list of previous active objects such as People and Events. You can move forward and backward through the list using "Go > Forward" and "Go > Back" or the arrow buttons. - -<_tip number="25">Keyboard Shortcuts
Tired of having to take your hand off the keyboard to use the mouse? Many functions in Gramps have keyboard shortcuts. If one exists for a function it is displayed on the right side of the menu. - -<_tip number="26">Read the Manual
Don't forget to read the Gramps manual, "Help > User Manual". The developers have worked hard to make most operations intuitive but the manual is full of information that will make your time spent on genealogy more productive. - -<_tip number="27">Adding Children
To add children in Gramps there are two options. You can find one of their parents in the Families View and open the family. Then choose to create a new person or add an existing person. You can also add children (or siblings) from inside the Family Editor. - -<_tip number="28">Editing the Parent-Child Relationship
You can edit the relationship of a child to its parents by double clicking the child in the Family Editor. Relationships can be any of Adopted, Birth, Foster, None, Sponsored, Stepchild and Unknown. - -<_tip number="29">Show All Checkbutton
When adding an existing person as a spouse, the list of people shown is filtered to display only people who could realistically fit the role (based on dates in the database). In case Gramps is wrong in making this choice, you can override the filter by checking the Show All checkbutton. - -<_tip number="31">Improving Gramps
Users are encouraged to request enhancements to Gramps. Requesting an enhancement can be done either through the gramps-users or gramps-devel mailing lists, or by going to https://gramps-project.org/bugs/ and creating a Feature Request. Filing a Feature Request is preferred but it can be good to discuss your ideas on the email lists. - -<_tip number="32">Gramps Mailing Lists
Want answers to your questions about Gramps? Check out the gramps-users email list. Many helpful people are on the list, so you're likely to get an answer quickly. If you have questions related to the development of Gramps, try the gramps-devel list. You can see the lists by selecting "Help > Gramps Mailing Lists". - -<_tip number="33">Contributing to Gramps
Want to help with Gramps but can't write programs? Not a problem! A project as large as Gramps requires people with a wide variety of skills. Contributions can be anything from writing documentation to testing development versions and helping with the web site. Start by subscribing to the Gramps developers mailing list, gramps-devel, and introducing yourself. Subscription information can be found at "Help > Gramps Mailing Lists" - -<_tip number="34">So What's in a Name?
The name Gramps was suggested to the original developer, Don Allingham, by his father. It stands for Genealogical Research and Analysis Management Program System. It is a full-featured genealogy program letting you store, edit, and research genealogical data. The Gramps database back end is so robust that some users are managing genealogies containing hundreds of thousands of people. - -<_tip number="36">Bookmarking Individuals
The Bookmarks menu is a convenient place to store the names of frequently used individuals. Selecting a bookmark will make that person the Active Person. To bookmark someone make them the Active Person then go to "Bookmarks > Add Bookmark" or press Ctrl+D. You can also bookmark most of the other objects. - -<_tip number="37">Incorrect Dates
Everyone occasionally enters dates with an invalid format. Incorrect date formats will show up in Gramps with a either a reddish background or a red dot on the right edge of the field. You can fix the date using the Date Selection dialog which can be opened by clicking on the date button. The format of the date is set under "Edit > Preferences > Display". - -<_tip number="38">Listing Events
Events are added using the editor opened with "Person > Edit Person > Events". There is a long list of preset event types. You can add your own event types by typing in the text field, they will be added to the available events, but not translated. - -<_tip number="39">Managing Names
It is easy to manage people with several names in Gramps. In the Person Editor select the Names tab. You can add names of different types and set the preferred name by dragging it to the Preferred Name section. - -<_tip number="40">Ancestor View
The Ancestry View displays a traditional pedigree chart. Hold the mouse over an individual to see more information about them or right click on an individual to access other family members and settings. Play with the settings to see the different options. - -<_tip number="41">Managing Sources
The Sources View shows a list of all sources in a single window. From here you can edit your sources, merge duplicates and see which individuals reference each source. You can use filters to group your sources. - -<_tip number="42">Managing Places
The Places View shows a list of all places in the database. The list can be sorted by a number of different criteria, such as City, County or State. - -<_tip number="43">Media View
The Media View shows a list of all media entered in the database. These can be graphic images, videos, sound clips, spreadsheets, documents, and more. - -<_tip number="44">Filters
Filters allow you to limit the people seen in the People View. In addition to the many preset filters, Custom Filters can be created limited only by your imagination. Custom filters are created from "Edit > Person Filter Editor". - -<_tip number="45">The GEDCOM File Format
Gramps allows you to import from, and export to, the GEDCOM format. There is extensive support for the industry standard GEDCOM version 5.5, so you can exchange Gramps information to and from users of most other genealogy programs. Filters exist that make importing and exporting GEDCOM files trivial. - -<_tip number="46">The Gramps XML Package
You can export your Family Tree as a Gramps XML Package. This is a compressed file containing your family tree data and all the media files connected to the database (images for example). This file is completely portable so is useful for backups or sharing with other Gramps users. This format has the key advantage over GEDCOM that no information is ever lost when exporting and importing. - -<_tip number="48">Web Family Tree Format
Gramps can export data to the Web Family Tree (WFT) format. This format allows a family tree to be displayed online using a single file, instead of many html files. - -<_tip number="49">Making a Genealogy Website
You can easily export your family tree to a web page. Select the entire database, family lines or selected individuals to a collection of web pages ready for upload to the World Wide Web. - -<_tip number="50">Reporting Bugs in Gramps
The best way to report a bug in Gramps is to use the Gramps bug tracking system at https://gramps-project.org/bugs/ - -<_tip number="51">The Gramps Homepage
The Gramps homepage is at http://gramps-project.org/ - -<_tip number="53">Privacy in Gramps
Gramps helps you to keep personal information secure by allowing you to mark information as private. Data marked as private can be excluded from reports and data exports. Look for the padlock which toggles records between private and public. - -<_tip number="54">Keeping Good Records
Be accurate when recording genealogical information. Don't make assumptions while recording primary information; write it exactly as you see it. Use bracketed comments to indicate your additions, deletions or comments. Use of the Latin 'sic' is recommended to confirm the accurate transcription of what appears to be an error in a source. - -<_tip number="57">Extra Reports and Tools
Extra tools and reports can be added to Gramps with the "Addon" system. See them under "Help > Extra Reports/Tools". This is the best way for advanced users to experiment and create new functionality. - -<_tip number="58">Book Reports
The Book report under "Reports > Books > Book Report...", allows you to collect a variety of reports into a single document. This single report is easier to distribute than multiple reports, especially when printed. - -<_tip number="59">Gramps Announcements
Interested in getting notified when a new version of Gramps is released? Join the Gramps-announce mailing list at "Help > Gramps Mailing Lists" - -<_tip number="60">Record Your Sources
Information collected about your family is only as good as the source it came from. Take the time and trouble to record all the details of where the information came from. Whenever possible get a copy of original documents. - -<_tip number="61">Directing Your Research
Go from what you know to what you do not. Always record everything that is known before making conjectures. Often the facts at hand suggest plenty of direction for more research. Don't waste time looking through thousands of records hoping for a trail when you have other unexplored leads. - -<_tip number="62">The 'How and Why' of Your Genealogy
Genealogy isn't only about dates and names. It is about people. Be descriptive. Include why things happened, and how descendants might have been shaped by the events they went through. Narratives go a long way in making your family history come alive. - -<_tip number="63">Don't speak English?
Volunteers have translated Gramps into more than 40 languages. If Gramps supports your language and it is not being displayed, set the default language in your operating system and restart Gramps. - -<_tip number="64">Gramps Translators
Gramps has been designed so that new translations can easily be added with little development effort. If you are interested in participating please email gramps-devel@lists.sf.net - -<_tip number="66">Hello, привет or 喂
Whatever script you use Gramps offers full Unicode support. Characters for all languages are properly displayed. - -<_tip number="67">The Home Person
Anyone can be chosen as the Home Person in Gramps. Use "Edit > Set Home Person" in the Person View. The home person is the person who is selected when the database is opened or when the home button is pressed. - -<_tip number="70">The Gramps Code
Gramps is written in a computer language called Python using the GTK and GNOME libraries for the graphical interface. Gramps is supported on any computer system where these programs have been ported. Gramps is known to be run on Linux, BSD, Solaris, Windows and Mac OS X. - -<_tip number="71">Open Source Software
The Free/Libre and Open Source Software (FLOSS) development model means Gramps can be extended by any programmer since all of the source code is freely available under its license. So it's not just about free beer, it's also about freedom to study and change the tool. For more about Open Source software lookup the Free Software Foundation and the Open Source Initiative. - -<_tip number="72">The Gramps Software License
You are free to use and share Gramps with others. Gramps is freely distributable under the GNU General Public License, see http://www.gnu.org/licenses/licenses.html#GPL to read about the rights and restrictions of this license. - -<_tip number="73">Gramps for Gnome or KDE?
For Linux users Gramps works with whichever desktop environment you prefer. As long as the required GTK libraries are installed it will run fine. - -
diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 000000000..e8eecd938 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,37 @@ +# this list MUST be a subset of _LOCALE_NAMES in gen/utils/grampslocale.py +# (that is, if you add a new language here, be sure it's in _LOCALE_NAMES too) +ar +bg +ca +cs +da +de +el +en_GB +eo +es +fi +fr +he +hr +hu +is +it +ja +lt +nb +nl +nn +pl +pt_BR pt_PT +ru +sk +sl +sq +sr +sv +ta +tr +uk +vi +zh_CN zh_HK zh_TW diff --git a/po/POTFILES.in b/po/POTFILES.in index 5455649ea..9aed1efef 100755 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -808,9 +808,8 @@ gramps/plugins/webstuff/webstuff.py # # Files to extract from and then merge into # -data/gramps.desktop.in -data/gramps.keys.in data/gramps.xml.in -data/holidays.xml.in -data/tips.xml.in data/gramps.appdata.xml.in +data/gramps.desktop.in +data/holidays.xml +data/tips.xml diff --git a/po/genpot.sh b/po/genpot.sh deleted file mode 100755 index fe1efad13..000000000 --- a/po/genpot.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Make translation files - -# additional keywords must always be kept in sync with those in update_po.py -XGETTEXT_ARGS='--keyword=_T_ --keyword=trans_text' \ - intltool-update -g gramps -o gramps.pot -p diff --git a/po/its/holidays.its b/po/its/holidays.its new file mode 100644 index 000000000..d070c717c --- /dev/null +++ b/po/its/holidays.its @@ -0,0 +1,6 @@ + + + + + diff --git a/po/its/holidays.loc b/po/its/holidays.loc new file mode 100644 index 000000000..9c48edb12 --- /dev/null +++ b/po/its/holidays.loc @@ -0,0 +1,4 @@ + + + + diff --git a/po/its/shared-mime-info.its b/po/its/shared-mime-info.its new file mode 100644 index 000000000..e504a2736 --- /dev/null +++ b/po/its/shared-mime-info.its @@ -0,0 +1,9 @@ + + + + + + diff --git a/po/its/shared-mime-info.loc b/po/its/shared-mime-info.loc new file mode 100644 index 000000000..a6f7f4092 --- /dev/null +++ b/po/its/shared-mime-info.loc @@ -0,0 +1,6 @@ + + + + + + diff --git a/po/its/tips.its b/po/its/tips.its new file mode 100644 index 000000000..263687544 --- /dev/null +++ b/po/its/tips.its @@ -0,0 +1,5 @@ + + + + + diff --git a/po/its/tips.loc b/po/its/tips.loc new file mode 100644 index 000000000..9f9d6df9c --- /dev/null +++ b/po/its/tips.loc @@ -0,0 +1,4 @@ + + + + diff --git a/po/update_po.py b/po/update_po.py index fd06c85c5..f36471f6f 100644 --- a/po/update_po.py +++ b/po/update_po.py @@ -6,6 +6,7 @@ # Copyright (C) 2006 Brian Matherly # Copyright (C) 2008 Stephen George # Copyright (C) 2012 +# Copyright (C) 2020 Nick Hall # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -133,232 +134,6 @@ def tests(): except: print ('Please, install python') -def TipsParse(filename, mark): - """ - Experimental alternative to 'intltool-extract' for 'tips.xml'. - """ - from xml.etree import ElementTree - - tree = ElementTree.parse(filename) - root = tree.getroot() - - ''' - - - <_tip number="1"> - Working with Dates -
- A range of dates can be given by using the format "between - January 4, 2000 and March 20, 2003". You can also indicate - the level of confidence in a date and even choose between seven - different calendars. Try the button next to the date field in the - Events Editor. - - - char *s = N_("Working with Dates
A range of dates can be - given by using the format "between January 4, 2000 and March 20, - 2003". You can also indicate the level of confidence in a date - and even choose between seven different calendars. Try the button - next to the date field in the Events Editor."); - - gramps.pot: - msgid "" - "Working with Dates
A range of dates can be given by using the " - "format "between January 4, 2000 and March 20, 2003". You can also " - "indicate the level of confidence in a date and even choose between seven " - "different calendars. Try the button next to the date field in the Events " - "Editor." - ''' - - with open('../data/tips.xml.in.h', 'w', encoding='utf-8') as tips: - marklist = root.iter(mark) - for key in marklist: - tip = ElementTree.tostring(key, encoding="UTF-8", method="xml") - if sys.version_info[0] < 3: - tip = tip.replace("", "") - tip = tip.replace('\n<_tip number="%(number)s">' % key.attrib, "") - else: # python3 support - tip = tip.decode("utf-8") - tip = tip.replace('<_tip number="%(number)s">' % key.attrib, "") - tip = tip.replace("
", "
") - #tip = tip.replace("\n\n", "\n") # special case tip 7 - #tip = tip.replace("\n", "") # special case tip 18 - tip = tip.replace("\n\n", "") - tip = tip.replace('"', '"') - tips.write('char *s = N_("%s");\n' % tip) - print ('Wrote ../data/tips.xml.in.h') - root.clear() - -def HolidaysParse(filename, mark): - """ - Experimental alternative to 'intltool-extract' for 'holidays.xml'. - """ - from xml.etree import ElementTree - - tree = ElementTree.parse(filename) - root = tree.getroot() - ellist = root.iter() - - ''' - - calendar> - - .. - - - - char *s = N_("Bulgaria"); - char *s = N_("Jewish Holidays"); - char *s = N_("Yom Kippur"); - - gramps.pot: - msgid "Bulgaria" - msgid "Jewish Holidays" - msgid "Yom Kippur" - ''' - with open('../data/holidays.xml.in.h', 'w') as holidays: - for key in ellist: - if key.attrib.get(mark): - line = key.attrib - string = line.items - # mapping via the line dict (_name is the key) - name = 'char *s = N_("%(_name)s");\n' % line - holidays.write(name) - print ('Wrote ../data/holidays.xml.in.h') - root.clear() - - -def XmlParse(filename, mark): - """ - Experimental alternative to 'intltool-extract' for 'file.xml.in'. - """ - from xml.etree import ElementTree - - tree = ElementTree.parse(filename) - root = tree.getroot() - - ''' - - - - - <_comment>Gramps database - - - - <_comment>GEDCOM - - - - - - msgid "Gramps database" - msgid "GEDCOM" - - - <_p> Gramps is a free software project and community. - We strive to produce a genealogy program that is both intuitive for hobbyists - and feature-complete for professional genealogists. -

-
- ''' - - with open(filename + '.h', 'w') as head: - for key in root.iter(): - if key.tag == '{http://www.freedesktop.org/standards/shared-mime-info}%s' % mark: - comment = 'char *s = N_("%s");\n' % key.text - head.write(comment) - if key.tag == mark: #appdata - comment = 'char *s = N_("%s");\n' % key.text - head.write(comment) - - if root.tag == 'application': - for key in root.iter(): - if key.tag == mark: - comment = 'char *s = N_("%s");\n' % key.text - head.write(comment) - - print ('Wrote %s' % filename) - root.clear() - -def DesktopParse(filename): - """ - Experimental alternative to 'intltool-extract' for 'gramps.desktop'. - """ - - ''' - [Desktop Entry] - _Name=Gramps - _GenericName=Genealogy System - _X-GNOME-FullName=Gramps Genealogy System - _Comment=Manage genealogical information, - perform genealogical research and analysis - - msgid "Gramps" - msgid "Genealogy System" - msgid "Gramps Genealogy System" - msgid "" - "Manage genealogical information, - perform genealogical research and analysis" - ''' - with open('../data/gramps.desktop.in.h', 'w') as desktop: - - with open(filename) as f: - lines = [file.strip() for file in f] - - for line in lines: - if line[0] == '_': - for i in range(len(line)): - if line[i] == '=': - val = 'char *s = N_("%s");\n' % line[i+1:len(line)] - desktop.write(val) - - print ('Wrote ../data/gramps.desktop.in.h') - -def KeyParse(filename, mark): - """ - Experimental alternative to 'intltool-extract' for 'gramps.keys'. - """ - - ''' - application/x-gramps-xml: - _description=Gramps XML database - default_action_type=application - short_list_application_ids=gramps - short_list_application_ids_for_novice_user_level=gramps - short_list_application_ids_for_intermediate_user_level=gramps - short_list_application_ids_for_advanced_user_level=gramps - category=Documents/Genealogy - icon-filename=/usr/share/gramps/gramps.png - open=gramps %f - - application/x-gedcom: - _description=GEDCOM - default_action_type=application - - msgid "Gramps XML database" - msgid "GEDCOM" - ''' - with open('../data/gramps.keys.in.h', 'w') as key: - - with open(filename) as f: - lines = [file for file in f] - - temp = [] - - for line in lines: - for i in range(len(line)): - if line[i:i+12] == mark: - temp.append(line.strip()) - - for t in temp: - for i in range(len(t)): - if t[i] == '=': - val = 'char *s = N_("%s");\n' % t[i+1:len(t)] - key.write(val) - - print ('Wrote ../data/gramps.keys.in.h') - def main(): """ The utility for handling translation stuff. @@ -522,20 +297,6 @@ def headers(): headers = [] # in.h; extract_xml - if os.path.isfile('''../data/tips.xml.in.h'''): - headers.append('''../data/tips.xml.in.h''') - if os.path.isfile('''../data/holidays.xml.in.h'''): - headers.append('''../data/holidays.xml.in.h''') - if os.path.isfile('''../data/gramps.xml.in.h'''): - headers.append('''../data/gramps.xml.in.h''') - if os.path.isfile('''../data/gramps.desktop.in.h'''): - headers.append('''../data/gramps.desktop.in.h''') - if os.path.isfile('''../data/gramps.keys.in.h'''): - headers.append('''../data/gramps.keys.in.h''') - if os.path.isfile('''../data/gramps.appdata.xml.in.h'''): - headers.append('''../data/gramps.appdata.xml.in.h''') - if os.path.isfile('''gtklist.h'''): - headers.append('''gtklist.h''') if os.path.isfile('''fragments.pot'''): headers.append('''fragments.pot''') @@ -543,15 +304,23 @@ def headers(): def extract_xml(): """ - Extract translation strings from XML based, keys, mime and desktop - files. Own XML files parsing and custom translation marks. + Extract translation strings from XML based, mime and desktop files. + Uses custom ITS rules found in the po/its directory. """ - HolidaysParse('../data/holidays.xml.in', '_name') - TipsParse('../data/tips.xml.in', '_tip') - XmlParse('../data/gramps.xml.in', '_comment') - XmlParse('../data/gramps.appdata.xml.in', '_p') - DesktopParse('../data/gramps.desktop.in') - KeyParse('../data/gramps.keys.in', '_description') + if not os.path.isfile('gramps.pot'): + create_template() + + for input_file in ['../data/holidays.xml', + '../data/tips.xml', + '../data/gramps.xml.in', + '../data/gramps.appdata.xml.in', + '../data/gramps.desktop.in']: + os.system(('GETTEXTDATADIR=. %(xgettext)s -F -j ' + '-o gramps.pot --from-code=UTF-8 %(inputfile)s') + % {'xgettext': xgettextCmd, + 'inputfile': input_file} + ) + print (input_file) def create_template(): """ @@ -573,58 +342,6 @@ def extract_glade(): % {'xgettext': xgettextCmd} ) -def extract_gtkbuilder(): - """ - Temp workaround for xgettext bug (< gettext 0.18.3) - https://savannah.gnu.org/bugs/index.php?29216 - See bug reports #6595, #5621 - """ - - from xml.etree import ElementTree - - ''' - - - - - - - - - - - - All rules must apply - - - At least one rule must apply - - - Exactly one rule must apply - - - - - msgid "All rules must apply" - msgid "At least one rule must apply" - msgid "Exactly one rule must apply" - ''' - - files = ['../gramps/plugins/importer/importgedcom.glade', '../gramps/gui/glade/rule.glade'] - with open('gtklist.h', 'w') as temp: - for filename in files: - tree = ElementTree.parse(filename) - root = tree.getroot() - for line in root.iter(): - att = line.attrib - if att == {'id': '0', 'translatable': 'yes'}: - col = 'char *s = N_("%s");\n' % line.text - temp.write(col) - root.clear() - - print ('Wrote gtklist.h') - - def xml_fragments(): """ search through the file for xml fragments that contain the 'translate="yes">string<' pattern. These need to be added to the message @@ -698,10 +415,6 @@ def retrieve(): """ Extract messages from all files used by Gramps (python, glade, xml) """ - extract_xml() - - extract_gtkbuilder() - create_template() create_filesfile() @@ -718,6 +431,7 @@ def retrieve(): ) extract_glade() + extract_xml() # C format header (.h extension) for h in headers(): diff --git a/setup.py b/setup.py index 9516076ab..e4e70633b 100755 --- a/setup.py +++ b/setup.py @@ -3,9 +3,9 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2012 Nick Hall -# Copyright (C) 2012 Rob G. Healey -# Copyright (C) 2012 Benny Malengier +# Copyright (C) 2012,2020 Nick Hall +# Copyright (C) 2012 Rob G. Healey +# Copyright (C) 2012 Benny Malengier # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -45,14 +45,6 @@ from gramps.version import VERSION import unittest import argparse -# this list MUST be a subset of _LOCALE_NAMES in gen/utils/grampslocale.py -# (that is, if you add a new language here, be sure it's in _LOCALE_NAMES too) -ALL_LINGUAS = ('ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en_GB', - 'eo', 'es', 'fi', 'fr', 'he', 'hr', 'hu', 'is', 'it', - 'ja', 'lt', 'nb', 'nl', 'nn', 'pl', 'pt_BR', 'pt_PT', - 'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'ta', 'tr', 'uk', 'vi', - 'zh_CN', 'zh_HK', 'zh_TW') -_FILES = ('data/tips.xml', 'data/holidays.xml') svem_flag = '--single-version-externally-managed' if svem_flag in sys.argv: @@ -65,34 +57,6 @@ argparser.add_argument("--no-compress-manpages", dest="no_compress_manpages", args, passthrough = argparser.parse_known_args() sys.argv = [sys.argv[0]] + passthrough -def intltool_version(): - ''' - Return the version of intltool as a tuple. - ''' - if sys.platform == 'win32': - cmd = ["perl", - r"-e print qx(intltool-update --version) =~ m/(\d+.\d+.\d+)/;"] - try: - ver, ret = subprocess.Popen(cmd ,stdout=subprocess.PIPE, - stderr=subprocess.PIPE, shell=True).communicate() - ver = ver.decode("utf-8") - if ver > "": - version_str = ver - else: - return (0,0,0) - except: - return (0,0,0) - else: - cmd = 'intltool-update --version 2> /dev/null' # pathological case - retcode, version_str = subprocess.getstatusoutput(cmd) - if retcode != 0: - return None - cmd = 'intltool-update --version 2> /dev/null | head -1 | cut -d" " -f3' - retcode, version_str = subprocess.getstatusoutput(cmd) - if retcode != 0: # unlikely but just barely imaginable, so leave it - return None - return tuple([int(num) for num in version_str.split('.')]) - def substitute_variables(filename_in, filename_out, subst_vars): ''' Substitute variables in a file. @@ -106,12 +70,24 @@ def substitute_variables(filename_in, filename_out, subst_vars): f_in.close() f_out.close() +def get_linguas(): + ''' + Read the po/LINGUAS file to get a list of all linguas. + ''' + all_linguas = [] + with open(os.path.join('po', 'LINGUAS'), 'r', encoding='utf-8') as linguas: + for line in linguas: + if '#' in line: + line = line[:line.find('#')] + all_linguas.extend(line.split()) + return all_linguas + def build_trans(build_cmd): ''' Translate the language files into gramps.mo ''' data_files = build_cmd.distribution.data_files - for lang in ALL_LINGUAS: + for lang in get_linguas(): po_file = os.path.join('po', lang + '.po') mo_file = os.path.join(build_cmd.build_base, 'mo', lang, 'LC_MESSAGES', 'gramps.mo') @@ -183,21 +159,12 @@ def build_intl(build_cmd): ''' Merge translation files into desktop and mime files ''' - for filename in _FILES: - filename = convert_path(filename) - strip_files(filename + '.in', filename, ['_tip', '_name']) - - i_v = intltool_version() - if i_v is None or i_v < (0, 25, 0): - log.info('No intltool or version < 0.25.0, build_intl is aborting') - return data_files = build_cmd.distribution.data_files base = build_cmd.build_base - merge_files = (('data/gramps.desktop', 'share/applications', '-d'), - ('data/gramps.keys', 'share/mime-info', '-k'), - ('data/gramps.xml', 'share/mime/packages', '-x'), - ('data/gramps.appdata.xml', 'share/metainfo', '-x')) + merge_files = (('data/gramps.desktop', 'share/applications', '--desktop'), + ('data/gramps.xml', 'share/mime/packages', '--xml'), + ('data/gramps.appdata.xml', 'share/metainfo', '--xml')) for filename, target, option in merge_files: filenamelocal = convert_path(filename) @@ -208,46 +175,17 @@ def build_intl(build_cmd): merge(filenamelocal + '.in', newfile, option) data_files.append((target, [base + '/' + filename])) -def strip_files(in_file, out_file, mark): +def merge(in_file, out_file, option, po_dir='po'): ''' - strip the file of the first character (typically an underscore) in each - keyword (in the "mark" argument list) in the file -- so this method is an - Alternative to intltool-merge command. + Run the msgfmt command. ''' if (not os.path.exists(out_file) and os.path.exists(in_file)): - old = open(in_file, 'r', encoding='utf-8') - with open(out_file, 'w', encoding='utf-8', errors='strict') as fb: - for line in old: - for marker in mark: - line = line.replace(marker, marker[1:]) - fb.write(line) - old.close() - log.info('Compiling %s >> %s', in_file, out_file) - -def merge(in_file, out_file, option, po_dir='po', cache=True): - ''' - Run the intltool-merge command. - ''' - option += ' -u' - if cache: - cache_file = os.path.join('po', '.intltool-merge-cache') - option += ' -c ' + cache_file - - if (not os.path.exists(out_file) and os.path.exists(in_file)): - if sys.platform == 'win32': - cmd = (('set LC_ALL=C && perl -S intltool-merge %(opt)s %(po_dir)s %(in_file)s ' - '%(out_file)s') % - {'opt' : option, - 'po_dir' : po_dir, - 'in_file' : in_file, - 'out_file' : out_file}) - else: - cmd = (('LC_ALL=C intltool-merge %(opt)s %(po_dir)s %(in_file)s ' - '%(out_file)s') % - {'opt' : option, - 'po_dir' : po_dir, - 'in_file' : in_file, - 'out_file' : out_file}) + cmd = (('GETTEXTDATADIR=%(po_dir)s msgfmt %(opt)s ' + '--template %(in_file)s -d %(po_dir)s -o %(out_file)s') % + {'opt' : option, + 'po_dir' : po_dir, + 'in_file' : in_file, + 'out_file' : out_file}) if os.system(cmd) != 0: msg = ('ERROR: %s was not merged into the translation files!\n' % out_file) @@ -391,8 +329,7 @@ package_data = package_data_core + package_data_gui # Resources # #------------------------------------------------------------------------- -data_files_core = [('share/mime-info', ['data/gramps.mime']), - ('share/icons', ['images/gramps.png'])] +data_files_core = [('share/icons', ['images/gramps.png'])] DOC_FILES = ['AUTHORS', 'COPYING', 'FAQ', 'INSTALL', 'NEWS', 'README.md', 'TODO'] GEDCOM_FILES = glob.glob(os.path.join('example', 'gedcom', '*.*'))