Getting started with translating Gramps interface using Weblate

Some recent discussions have been about translating GUI elements on some Gramps add-ons.

Being an English-speaking monoglot means I have had little exposure to Weblate use. But a couple Addons have been developed in other languages, so I now have real-world reasons to work with the translation tool.

The wiki currently has the following pages that mention Weblate and they are not written to be read by the average human being:

I composed a few Weblate FAQs so that I could leverage ChatGPT to start a refined framework of articles:

Please suggest other FAQ topics.

Note: The “5th grade reading level” requirement is one I was taught many, many years ago. (By World War I, the 5th grade was the end of compulsory education in the US. So students in the 1960s could assume their reading audience was literate to that level.) The guidance was: instructional material is already hard enough to absorb. The new information should not be buried in sophisticated grammar nor advanced vocabulary. And to always introduce a term (or abbreviation) that wouldn’t be in the standard vocabulary of a 5th grader.

Sure! Here’s a step-by-step process for using an existing Weblate glossary for a first-time user:

  1. Log in to Weblate: If you’re not already logged in to Weblate, log in to your account.
  2. Navigate to the project: Find the project you’re working on in the list of projects and click on it.
  3. Access the glossary: Click on the “Glossary” tab in the top menu bar to access the glossary.
  4. Search for a term: Use the search bar to search for the term you want to look up in the glossary.
  5. View the definition: Click on the term to view its definition and any additional context or examples.
  6. Use the glossary in translations: When translating a string in Weblate, if a glossary term matches the string, it will appear in the “Suggested translations” section. Select the appropriate glossary term and it will automatically fill in the translation box.
  7. Contribute to the glossary: If you find a term that is not in the glossary or that needs to be updated, you can contribute to the glossary by adding or editing a term.

That’s it! By using an existing Weblate glossary, you can ensure consistent and accurate translations across your project.

  1. Open the Weblate website: The first step is to open the Weblate website on your web browser.
  2. Create a new account: On the Weblate homepage, click the “Sign up” button to create a new account. Fill in the required information, such as your name, email address, and password.
  3. Choose a project: After signing up, you will be directed to the Weblate dashboard. Choose a project to work on. If there are no projects available, ask the project owner or administrator to add you to their project.
  4. Choose the US English dialect: Once you have selected a project, find the US English dialect glossary that you would like to translate from. You may need to ask the project owner or administrator for access to this glossary.
  5. Begin translating: In the US English dialect glossary, look for strings that do not have translations in the UK English dialect. These strings will be highlighted. Click on a string to start translating it to UK English. If you are unsure of a translation, you can look up the word or phrase in a dictionary.
  6. Save your translations: After you have translated a string, be sure to save your work. You can do this by clicking the “Save” button or using the keyboard shortcut Ctrl+S.
  7. Review your translations: Once you have finished translating a set of strings, review your translations for accuracy and consistency. Ensure that your translations follow any guidelines or conventions set by the project owner or administrator.
  8. Submit your translations: After reviewing your translations, you can submit them for review by the project owner or administrator. They will check your translations for accuracy and make any necessary edits before adding them to the glossary.

That’s it! By following these steps, a non-programmer can sign up for a new Weblate account and begin translating US English strings to UK English in an existing Weblate glossary.

  1. Open Weblate: The Python programmer should first open the Weblate platform on their web browser.
  2. Create a new project: Create a new Weblate project or select an existing one that corresponds to the Python module.
  3. Import the module’s strings: The programmer should import the module’s translatable strings into Weblate, creating a new translation component. This step could have more detail.
  4. Enable the glossary feature: In the Weblate project settings, enable the glossary feature.
  5. Import the glossary: Import the Weblate glossary for the target language (UK English).
  6. Identify untranslated strings: Weblate will automatically highlight the translatable strings in the module that do not have existing translations in the glossary. The programmer should review these strings to determine if they are valid translations that need to be added to the glossary.
  7. Add new translations to the glossary: If the programmer finds a valid translation, they can add it to the Weblate glossary to ensure consistency across the project.
  8. Translate remaining strings: Translate the remaining strings manually or use the glossary as a reference. If the string describes a fairly common activity, there is probably already a translated string that could be used instead. There should be a suggestion to search the Glossary for similar strings.

That’s it! By following these steps, a Python programmer can test US English translatable strings in a Python module against an existing Weblate glossary for UK English.

OK, right, I get it.

So, even though we have all sorts of AI, I still need to import those strings myself. Isn’t that weird? We have tools that can extract them from code, to create PO files, and with that in mind, the obvious thought is that Weblate is smart enough to do that same trick.

And apparently, it is not.

It does look like it can work with PO files though:

I strongly suspect that we could pass the French PO file through the ChatGPT today, have it cross-reference to use strings in the Weblate glossary and translate the remainder… simultaneously producing Dutch and the 2 english dialect files. (It already reads & writes Python and reads Weblate glossaries.)

It would still need human fine tuning. But it could probably do 90% of the grunt labor.

This kind of AI integration will probably be in Weblate in the near future. Nautral language processing is a natural fit.

We MIGHT be able to point it at the Python module and have the ChatGPT do the string extraction too. (That experiment is one of the reasons I hoped to get the Weblate process better documented. Experiments need a baseline.)

1 Like

Interesting. I just created an account, and asked if it could do that, but it did not ask me to upload a PO file, but gave me instructions on how to use Poedit.

I started that, and fed some lines to it, one by one, and got good Dutch translations.

But the best would indeed be if I could send the whole file, and let it fill in the blanks.

I’m having problems limiting it to leave the original Esperanto untranslated:

"In the following PO file, ignore that it is a translation file and treat it as plain text. Leave the original Esperanto text in the `msgid` field value untranslated in Esperanto, and translate just the corresponding `msgstr` field value from French to English: "

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