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

Handling translations #106

Closed
larshp opened this issue Jul 8, 2021 · 12 comments
Closed

Handling translations #106

larshp opened this issue Jul 8, 2021 · 12 comments
Labels
decided Design decision made. Implementation by SAP is open

Comments

@larshp
Copy link
Collaborator

larshp commented Jul 8, 2021

No description provided.

@schneidermic0
Copy link
Contributor

schneidermic0 commented Jul 20, 2021

Let me try to summarise the current (not final) approach.

  1. .abap files do not contain translation relevant content
  2. Files containing structured data (.json) indicate their originalLanguage and consist of shortext descriptions or domain relevant texts (like the text for a domain value, or the message text in a message class) in the .json file.
  3. Text symbols are not part of the .jsonand are exported as .properties with an addition to the filename to indicate which language the texts are. This file could be taken 1:1 with another language and only language-relevant parts have to be updated. An example can be found here

It is still open how to add translations of texts that are part of the .json file or how other translatable artifacts are handled (like documentation; see #130)

@schneidermic0
Copy link
Contributor

I just add a link to a POC which tries to handle abapGit translations:
https://github.com/sbcgua/abapgit-translation-poc

@albertmink
Copy link
Contributor

Pull from remote with changed language does nothing
image

image

@larshp
Copy link
Collaborator Author

larshp commented Nov 6, 2022

@schneidermic0
Copy link
Contributor

schneidermic0 commented Mar 17, 2023

I have created two examples how translation cloud look like. Both are no final propsals. They are meant for further discussion

@schneidermic0
Copy link
Contributor

I had a meeting with a colleague from SAP who is responsible/working on LXE tools for ABAP. His preference would be properties files because SAP's non-ABAP artifacts (like Fiori or Java) are also using properties files for their translation processes.

@albertmink
Copy link
Contributor

👋 Hi there 👋
Over the last months abapGit moved into the direction of .po files (still experimental see abapGit/abapGit#6189 ) and as we had also quite a view offline discussions, it's time for a quick status update.

We try to decide between .po and .properties file format (we dropped the .json based format).

Examples:
Assume we have translation relevant texts in a typical AFF file (text elements for CLAS are in a different AFF file and there will be more objects that store translation relevant parts in other files 😢 )

{
  "formatVersion": "1",
  "header": {
    "description": "day",
    "originalLanguage": "en"
  }
}

PO file:

#: header.description
msgid 'day'
msgstr 'Tag'

Properties file:

header.description='Tag'

Brief summary:

  • Both store the reference (to the text-to-be-translated) and the 'target' language
  • PO stores in addition the 'source' language and is hence complete (but holds redundant information)

An incomplete list of aspects:

To finish it off. Suggestions are welcome as we try to understand the relevance and use-cases for translation text for ABAP.

Further reading:
Specification of the #: from https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html

References to the program’s source code, in lines that start with #:, are of the form file_name:line_number or just file_name. If the file_name contains spaces. it is enclosed within Unicode characters U+2068 and U+2069.

@sbcgua
Copy link

sbcgua commented Aug 18, 2023

If my opinion is needed, then as ".po is well established" and "we would love to keep the number of file formats to a minimum", where "properties" is not implemented yet at all, while PO is already productive ... so ... why not to use po ?

Besides, while working on abapGit/abapGit#2539 I faced some unobvious rakes, made some pivots ... e.g. you can follow that very the initial approach was much closer to the properties and also used keys to address the translation place. It had some complications ... e.g. that the keys differ for objects since 740 and before. Which makes text-to-text translation approach a lot more robust, and reliable. Let alone the fact that it is more readable, translatable and supports long-text serialization.

Anyway, comparing a working and theoretical solutions are not super fair. If there were a POC for properties, working in several system versions, covering same object type list as already supported by AG - https://github.com/abapGit/abapGit/blob/main/src/objects/texts/zcl_abapgit_lxe_texts.clas.abap#L201C11-L201C11, including edge cases like missing translations and etc. Then the choise can be more educated. Let alone the fact that the way I implemented translations in AG supports multiple file formats, so no obstacles to parallel development.

@sbcgua
Copy link

sbcgua commented Aug 18, 2023

A word for redundancy ... looks like it is considered a disadvantage ... though it is frequently a part of well-thought and robust IT concepts in many areas, like RAID, CDN, OLAP... Let alone the direct fact that in the case of translation seeing original text improves (if not to say "enable") the readability and translatability of text.

@schneidermic0
Copy link
Contributor

We had meetings with SAP's translation team. Currently, there are no plans by SAP’s translation team to support .po files in SAP’s translation processes. Therefore, they strongly recommend to use .properties instead of .po files.

This means for ABAP file formats, we plan to define .properties files for translations of repository objects.

Just as a disclaimer: SAP's plans might change in the future.

@schneidermic0 schneidermic0 added the decided Design decision made. Implementation by SAP is open label Nov 16, 2023
@schneidermic0
Copy link
Contributor

Since it is decided how to proceed, I'll close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decided Design decision made. Implementation by SAP is open
Projects
None yet
Development

No branches or pull requests

4 participants