-
-
Notifications
You must be signed in to change notification settings - Fork 958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using RegEx for Variants #4888
Comments
This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger. In case your question is already answered, making a donation is the right way to say thank you! |
I think it should work. The strings are grouped based on the key after the variant regex is removed. |
Right, it should, shouldn't it? But it doesn't.... When does this setting kick in? Only with brandnew components during the initialization, or also as kind of an Update to an existing component and/or for Components which are added via Auto Discovery after the setting was set for the "template" component? Maybe that is the problem we are facing? Basically, can this setting be added and set to action also retroctively? |
Whenever you change the regexp the variants mapping should be updated in the background. Maybe there is some issue with Celery and it doesn't process the queue? WeblateOrg/docker#887 seems to indicate that... |
Thanks for doing all these tests, @nijel! I also did some further tests. It seems that the issue is related to the number of trailing spaces which follow the expressions in the RegEx. The pattern is that When I add those three or four spaces to the RegEx, weblate creates two groups of variants, when I then add a single space to each of the other three expressions, it WORKS! ;-) A bit strange. I did not expect this with the RegEx, but perhaps it is my still limited knowledge of RegEx... Thanks a mil for your help - problem solved. |
The issue you have reported is resolved now. If you don’t feel it’s right, please follow it’s labels to get a clue and take further steps.
|
We use weblate to translate amongst other things also SAP content.
SAP text lines can be exported from the SAP system as e.g. XLIFF.
There are special object types within an SAP system. One very common one is a so called Data Element.
Since the text of a Data Element can be used in different context, each Data Element usually has 5 texts, each with a different length restriction.
So my idea was now of course to use Variants to group these for translation to make them easily recognizable as belonging together.
This is what it looks like in the SAP GUI:
And here is the set of five strings in Weblate; but not yet grouped as variants:
Since there is a pattern that can be used, I specified this RegEx in Settings / Translations / Variants:
//(SCRTEXT_S|SCRTEXT_M|SCRTEXT_L|REPTEXT|DDTEXT)
An example of the keys of such a Data Element would be
DTEL///ABSD/DE_INTEND_POSTBACKGR//SCRTEXT_M 00001
DTEL///ABSD/DE_INTEND_POSTBACKGR//REPTEXT 00001
DTEL///ABSD/DE_INTEND_POSTBACKGR//SCRTEXT_L 00001
DTEL///ABSD/DE_INTEND_POSTBACKGR//SCRTEXT_S 00001
DTEL///ABSD/DE_INTEND_POSTBACKGR//DDTEXT 00001
DTEL///ABSD/DE_INTEND_POSTBACKGR//SCRTEXT_M 00001
But the grouping does not work that way.
Is this because there is no "base" Key which ends with "DTEL///ABSD/DE_INTEND_POSTBACKGR"?
The "root" (unabbreviated text) would ideally be DTEL///ABSD/DE_INTEND_POSTBACKGR//DDTEXT or DTEL///ABSD/DE_INTEND_POSTBACKGR//REPTEXT
Thanks for any hints and suggestions.
The text was updated successfully, but these errors were encountered: