Skip to content
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

Q: Referencing translation text in po files #1

Open
albertmink opened this issue Jan 11, 2024 · 9 comments
Open

Q: Referencing translation text in po files #1

albertmink opened this issue Jan 11, 2024 · 9 comments

Comments

@albertmink
Copy link

Assume the interface

interface ZIF_BADI_TADIR_CHANGED_MA
  public .


  methods METHOD_B .
endinterface.

where description of METHOD_B is 'Sun' with associated translation 'Sonne', see SE63
Screenshot 2024-01-11 at 10 38 50

Q1: Does the po file has an entry that looks more or less like?

#: COMPO 00002, maxlen=60
msgid "Sun"
msgstr "Sonne"

Q2: Will be the above entry to converted to

#: COMPO 00003, maxlen=60
msgid "Sun"
msgstr "Sonne"

when adding a method (that alphabetically is before METHOD_B) without translation to the interface

@sbcgua
Copy link
Owner

sbcgua commented Jan 13, 2024

Hi Albert, I didn't check but probably yes to both.

@albertmink
Copy link
Author

Ok, I see. Just extrapolating what I learned from object type INTF: The file format (referencing the ABAP data in the system) is heavily based around the LXE_OBJ_TEXT_PAIR_READ_XXXX and the table LXE_PCX_S1.

From the example above I derive, that resolving merge conflicts in translations will be rather difficult, since the key is COMPO XY and it is not obvious which METHOD/EVENT/... it is.

@albertmink
Copy link
Author

As a heads up:
For the ABAP file format we can assume that there is a JSON file in which almost every translation relevant data is placed (exception are textpool for classes which is a separate file).
An example IF_BADI_TADIR_CHANGED: The JSON (from ABAP file format) is on the left, the properties file on the right.
Screenshot 2024-01-15 at 13 58 29

We believe that referencing array entries via$.descriptions.methods[?(@.name=='AFTER_TADIR_CHANGED')].description instead of alphabetic (?) order $.descriptions.methods[0].description will be more robust and easier to understand for humans. Some documentation we added over the last week is https://github.com/SAP/abap-file-formats/blob/main/docs/properties.md#translation-files-in-abap-file-formats

A way to migrate to properties format, even if there is not yet an ABAP file format, could be the following.
As the translation relevant data might not be in a JSON file, I guess a natural choice is, to stick with the LXE_PCX_S1-key to reference the translation.

@sbcgua
Copy link
Owner

sbcgua commented Jan 16, 2024

From the example above I derive, that resolving merge conflicts in translations will be rather difficult, since the key is COMPO XY and it is not obvious which METHOD/EVENT/... it is.

Well, I don't think it will be a big issue, since it is optional comments. But I see how this can be inconvenient. If I were pushing it to the end, I'd probably separate "productive" and "development" modes. The former (and the main one) would not have comments at all. And the "dev" version could be used for a translator and enabled temporarily. Thus it would be both conflict free and convenient and flexible. But it just an idea.

image

Frankly, and no offends, but ... for me this looks super unreadable and humanunfriedly :))) Sorry. Just IMHO.

@albertmink
Copy link
Author

Yeahh, I give you that. I got used to that look. For more nested JSON the identifier gets even longer and the relevant part starts kind of char80 in the line 😵‍💫
Hmm, we tried to make that identifier as meaningful as possible (referencing JSON data, which feels intuitive for AFF).

@albertmink
Copy link
Author

Are the productive and development modes like settings in abapGit?

@sbcgua
Copy link
Owner

sbcgua commented Jan 17, 2024

Are the productive and development modes like settings in abapGit?

Yeap. As the comments may differ in different systems too. So the question is how and when they are useful. As they do not take part in deserialization, they are ... really comments. And I guess the answer is "mainly during active translation time". While when the package is stable they seem a bit superfluous, and in addition create potential for merge conflicts and deployments. So maybe the process should look like: a) create a branch b) switch on "translation" mode - which will serialize the comments c) do the translation (externally) d) test, blah blah e) switch off comments e) merge the branch

Again, it's just thoughts

@albertmink
Copy link
Author

As the comments may differ in different systems too. So the question is how and when they are useful. As they do not take part in deserialization, they are ... really comments.

With comment you mean the #: line in

#: COMPO 00002, maxlen=60
msgid "Sun"
msgstr "Sonne"

right? If so, in which scenario does they differ from system to system?
I assume the goal of a file format is that the same object is serialized independently of the ABAP system. Is this me having Monday morning vibes, or is there a misunderstanding of the 'comment'?

@sbcgua
Copy link
Owner

sbcgua commented Jan 22, 2024

Yes, the # lines. The differences between releases (might not be the only ones):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants