I’m working on a plugin. Text strings are in english and I have a swedish translation file. Unfortunately it sometimes picks up the wrong translations from “somewhere”, I assume it is because the string is already translated in Gramps.
Is there a way to give my translation higher prio within the plugin?
Example: “Handle” is translated to “Hantera” which is correct in the context “I will handle this”, but not in “this is a handle to”.
I guess the workaround is to not use “real strings” in the code but some unique placeholders. But it makes the code harder to read and I will also need to add english translation file. What will happen for other laguages without a translation file? Will they pick the english translation or just show the placeholder?
@Bigfoot In the example you gave, the string context was definitely misunderstood. And you are right that it was mistranslated. So a suggestion should be made in Weblate of a more appropriate string. (databaspostreferens rather than hantera?) And that change will flow through to your plugin.
Weblate is the tool used by the Gramps-project to manage translating of strings across various languages.
Your direction here is important but the workflow is unclear.
It assumes that:
the translations have been searched in Weblate
it was discovered that the source/target string already exists in Weblate.
and that inspecting the source code confirmed that the existing translation (target string) was appropriate for the context of the marked translatable source string .
In this case, the assumption failed in the 3rd criteria. When the string ‘handle’ exists as part of larger strings, the current hantera translation is appropriate in those contexts as a verb. But as an individual word, the context clearly indicates a noun, making the current translation is incorrect. So the _("string", "context") would work but be complicated by there being 15 occurrences. Wouldn’t all 15 need to have the explicit context if 1 entry needs it? But since all 15 have the same context, that makes more work.
But if this case had satisfied those criteria, what would the workflow be to use the workaround?
Something like this?:
Obviously the first step is checking the criteria and verifying a context parameter is needed.
the developer adds an explicit _("string", "context") context hint to their source code
they submit a PR for the _("string", "context") change
after review, the PR is merged
after the merge, some criteria nudges the Translation Coordinator (volunteer needed) to submit a Weblate PR
some other criteria, an admin merges the Weblate PR
the string becomes available in Weblate
Translators notice the waiting untranslated string and submit a translation suggestion
the suggestion is approved
something causes the Translation Coordinator to submit a PR for the Gramps source or Addon source
the admin approves the PR and merges
the changes wait until there minor public release of Gramps
something causes Gary Griffin to rebuild Addons that have the string and expedite publishing an Addon List.json
(I really hope that the workflow is not this convoluted and involve that many gatekeepers.)
In the specific case of Handle/handle and Hantera/hantera, it would be effective to submit 2 ‘suggestions’ in the Swedish Weblate component for Gramps to resolve the Swedish issue. (Nick is also right that adding a context note in the 17 Gramps Core strings could help translators in other languages. And any “Handle” string that you mark as translatable should use the same “context”. Otherwise, Weblate will add duplicate listings that confuse everyone.)
So… what is the Swedish translation that you would recommend for a handle database record identifier? We can make that suggestion in Weblate for you.
What will happen if @Bigfoot creates a po subfolder, a po/template.pot, and po/sv-local.po in their experimental plugin’s folder? Would that localization take priority?
Or would generating the locale/sv/LC_MESSAGES/addon.mo in their experimental plugin’s folder? Would that localization take priority?
The workflow of 13 steps is far more difficult than reality. The flow is different for gramps vs addons. For addons, when a string is added or changed or context is added, a PR is created. Then it follows this flow:
PR for string (or context) is created
After a window of time, PR is reviewed and merged/published. If the PR contains either an update to template.pot OR has a string change, the string is sent to Weblate (as part of the PR publishing). This is steps 4-7 in your list.
Translators translate. There exists exactly one Weblate PR at a time. Each translation gets added to that open Weblate PR. This is steps 9-10
After there are a significant number of changes in the PR, it is merged. I am changing my process to include publishing Addons impacted when the Weblate PR is approved. This is steps 11-13.
This should allow the Addons to get the new translated string more quickly yet not have too many extra releases. I am working the bugs out of this process currently.
Thanks for the information.
(Regarding the swedish translation of “handle” I suppose “handtag” is the correct translation. But when used as a technical computer term most tech people would probably prefer the english “handle”.)
Prompting Perplexity AI with: When translating English technical documentation for database engineering to Swedish, what is the preferred/common translation of ‘handle’ when used in the context of an ID for a database record?
Perplexity responds:
In Swedish technical/database documentation, handle in the sense of an ID used to refer to a database record is most commonly translated as referens or referens-ID
Typical usage
handle → referens
record handle → postreferens or referens till posten
database handle in a UI/API sense may also be kept as handle if the English term is established in the codebase, but Swedish prose usually prefers referens.
Practical recommendation
For documentation aimed at Swedish readers, I would usually write:
postreferens if it means an internal identifier for a specific record.
referens-ID if you want to make the “ID” aspect explicit.
nyckel only if the text really means a key in the database-design sense, not a UI/API handle.
If you want, I can suggest the most natural Swedish phrasing for the full sentence you’re translating.