Skip to content

Commit

Permalink
Merge branch 'main' into feature/translation-using-properties
Browse files Browse the repository at this point in the history
  • Loading branch information
schneidermic0 authored Mar 7, 2024
2 parents f494c38 + 8bd8b7b commit e077915
Show file tree
Hide file tree
Showing 37 changed files with 5,422 additions and 23,585 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Validate JSON schema
name: Generate JSON Schema

on:
pull_request:

jobs:
validate:
name: Compare generated against provided
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -19,3 +20,11 @@ jobs:
run: |
cd generate
npm run generate
- name: Upload generated schemas
if: always()
uses: actions/upload-artifact@v3
with:
name: schemas
path: |
generate/generated/*.json
5 changes: 3 additions & 2 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Markdown links
name: Check Markdown Links

on:
pull_request:
Expand All @@ -7,7 +7,8 @@ permissions:
contents: read

jobs:
markdown-link-check:
check-links:
name: Check links
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/py-validation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate JSON examples
name: Validate JSON Examples

on:
pull_request:
Expand All @@ -9,7 +9,7 @@ permissions:
jobs:
build:
# Name the Job
name: Validate JSON examples against their schema
name: Validate examples against schema

runs-on: ubuntu-latest

Expand Down
46 changes: 46 additions & 0 deletions docs/properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Translation Files in ABAP File Formats

### File Format
The file format for translation is `properties` and consists of key value pairs, e.g.
```PROPERTIES
key=value
...
```
The `key` refers to the text that is translated (source language), whereas `value` is the actual translated text.
A key follows the convenction of [JSONPath](https://goessner.net/articles/JsonPath/) when refering to data in JSON files.

### File Name

The translation of an ABAP object are stored in file named
`<object_name>.<object_type>.i18n.<language>.properties`

### Example
Assume that the ABAP object is represented by
```JSON
{
"formatVersion": "1",
"header": {
"description": "Hello",
"originalLanguage": "en"
},
"descriptions": {
"methods": [
{
"name": "METHOD_ONE",
"description": "One",
},
{
"name": "METHOD_TWO",
"description": "Two",
}
]
}
}
```
with the translation relevant texts being all descriptions.
Then the translation file (for french) is
```PROPERTIES
$.header.description=Bonjour
$.descriptions.methods[?(@.name=='METHOD_ONE')].description=Un
$.descriptions.methods[?(@.name=='METHOD_TWO')].description=Deux
```
2 changes: 1 addition & 1 deletion docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ABAP file formats define the file types:
* **`.acds`** stores source code of ABAP Core Data Services (CDS) as plain text
* **`.json`** stores content of form-based editors or properties of objects, such as `originalLanguage`, `abapLanguageVersion` and others.
Details are found in [JSON Files in ABAP File Formats](./json.md)
* **`.properties`** stores text elements as plain text
* **`.properties`** stores text elements as plain text and [translation texts](properties.md)


## Formatting Conventions
Expand Down
2 changes: 1 addition & 1 deletion file-formats/ront/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.ront.json` | 1 | [`zif_aff_ront_v1.intf.abap`](./type/zif_aff_ront_v1.intf.abap) | [`ront-v1.json`](./ront-v1.json) | [z_aff_example_ront.ront.json](./examples/z_aff_example_ront.ront.json)
`<name>.ront.json` | 1 | [`zif_aff_ront_v1.intf.abap`](./type/zif_aff_ront_v1.intf.abap) | [`ront-v1.json`](./ront-v1.json) | [`z_aff_example_ront.ront.json`](./examples/z_aff_example_ront.ront.json)
4 changes: 3 additions & 1 deletion file-formats/ront/examples/z_aff_example_ront.ront.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
},
"typeCategory": "businessObject",
"name": "Z_Aff_Example_Ront",
"objectTypeCode": "4789"
"objectTypeCode": "4789",
"interfaceBehaviorDefinition": "I_EXAMPLE_INTERFACE_BEH_DEF_TP",
"odmEntityName": "ExampleODMEntity"
}
12 changes: 12 additions & 0 deletions file-formats/ront/ront-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@
"description": "The object type code uniquely identifies the SAP Object Type.",
"type": "string",
"maxLength": 5
},
"interfaceBehaviorDefinition": {
"title": "Interface Behavior Definition",
"description": "The interface behavior definition related to the SAP Object Type.",
"type": "string",
"maxLength": 30
},
"odmEntityName": {
"title": "ODM Entity Name",
"description": "The One Domain Model entity related to the SAP Object Type.",
"type": "string",
"maxLength": 255
}
},
"additionalProperties": false,
Expand Down
22 changes: 15 additions & 7 deletions file-formats/ront/type/zif_aff_ront_v1.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,47 @@ INTERFACE zif_aff_ront_v1
configuration_object TYPE c LENGTH 2 VALUE `CO`,
"! <p class="shorttext">Dependent Object</p>
"! Dependent object
dependent_object TYPE c LENGTH 2 VALUE `DO`,
dependent_object TYPE c LENGTH 2 VALUE `DO`,
"! <p class="shorttext">Hierarchy Object</p>
"! Hierarchy object
hierarchy_object TYPE c LENGTH 2 VALUE `HO`,
hierarchy_object TYPE c LENGTH 2 VALUE `HO`,
END OF co_category.

TYPES:
"! <p class="shorttext">SAP Object Type</p>
"! SAP object type
BEGIN OF ty_main,
"! $required
format_version TYPE zif_aff_types_v1=>ty_format_version,
format_version TYPE zif_aff_types_v1=>ty_format_version,

"! <p class="shorttext">Header</p>
"! Header
"! $required
header TYPE zif_aff_types_v1=>ty_header_60_cloud,
header TYPE zif_aff_types_v1=>ty_header_60_cloud,

"! <p class="shorttext">Type Category</p>
"! The category of the SAP Object Type
"! $required
"! $values {@link zif_aff_ront_v1.data:co_category}
"! $default {@link zif_aff_ront_v1.data:co_category.business_object}
type_category TYPE c LENGTH 2,
type_category TYPE c LENGTH 2,

"! <p class="shorttext">Name</p>
"! The name of the SAP Object Type.
"! $required
name TYPE c LENGTH 30,
name TYPE c LENGTH 30,

"! <p class="shorttext">Object Type Code</p>
"! The object type code uniquely identifies the SAP Object Type.
object_type_code TYPE c LENGTH 5,
object_type_code TYPE c LENGTH 5,

"! <p class="shorttext">Interface Behavior Definition</p>
"! The interface behavior definition related to the SAP Object Type.
interface_behavior_definition TYPE c LENGTH 30,

"! <p class="shorttext">ODM Entity Name</p>
"! The One Domain Model entity related to the SAP Object Type.
odm_entity_name TYPE c LENGTH 255,

END OF ty_main.

Expand Down
2 changes: 1 addition & 1 deletion file-formats/sajc/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SAJC File Format

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
:--- | :--- | :--- | :--- | :---
`<name>.sajc.json` | 1 | [`zif_aff_sajc_v1.intf.abap`](./type/zif_aff_sajc_v1.intf.abap) | [`sajc-v1.json`](./sajc-v1.json) | [`z_aff_example_sajc.sajc.json`](./examples/z_aff_example_sajc.sajc.json)
3 changes: 1 addition & 2 deletions file-formats/sajc/examples/z_aff_example_sajc.sajc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"exitClasses": {
"check": "CL_APJ_HOME_DEMO_CHECK",
"valueHelp": "CL_VALUE_HELP_APJ_SIMPLE",
"notification": "CL_APJ_HOME_DEMO_CHECK",
"delete": "CL_APJT_RT_JOB_DELETE_EXIT"
"notification": "CL_APJ_HOME_DEMO_CHECK"
},
"sections": [
{
Expand Down
42 changes: 36 additions & 6 deletions file-formats/sajc/sajc-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@
"description": "Name of the class which contains the notification exit",
"type": "string",
"maxLength": 30
},
"delete": {
"title": "Delete",
"description": "Name of the class which contains the delete exit",
"type": "string",
"maxLength": 30
}
},
"additionalProperties": false
Expand Down Expand Up @@ -190,6 +184,12 @@
"type": "string",
"maxLength": 38
},
"title": {
"title": "Title",
"description": "Title of the parameter on the selection screen",
"type": "string",
"maxLength": 255
},
"group": {
"title": "Group",
"description": "Name of the parameter group",
Expand Down Expand Up @@ -222,6 +222,36 @@
"type": "string",
"maxLength": 38
},
"screenElement": {
"title": "Screen Element",
"description": "Display of the parameter as screen element (radio button, checkbox, list box)",
"type": "string",
"enum": [
"none",
"checkbox",
"radioButton",
"listBox"
],
"enumTitles": [
"None",
"Checkbox",
"Radio Button",
"List Box"
],
"enumDescriptions": [
"None",
"Checkbox",
"Radio button",
"List box"
],
"default": "none"
},
"radioButtonGroup": {
"title": "Radio Button Group",
"description": "Name of the radio button group if the parameter is a radio button",
"type": "string",
"maxLength": 4
},
"backendCall": {
"title": "Backend Call",
"description": "Flag indicating whether a call of the backend system is triggered after a parameter value change to check it",
Expand Down
51 changes: 43 additions & 8 deletions file-formats/sajc/type/zif_aff_sajc_v1.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ INTERFACE zif_aff_sajc_v1
"! <p class="shorttext">Notification</p>
"! Name of the class which contains the notification exit
notification TYPE zif_aff_types_v1=>ty_object_name_30,
"! <p class="shorttext">Delete</p>
"! Name of the class which contains the delete exit
delete TYPE zif_aff_types_v1=>ty_object_name_30,
END OF ty_exit_classes.

"! <p class="shorttext">Parameter Name</p>
Expand All @@ -64,9 +61,38 @@ INTERFACE zif_aff_sajc_v1
"! <p class="shorttext">Section Name</p>
"! Name of the section
TYPES ty_section_name TYPE c LENGTH 10.
"! <p class="shorttext">Parameter Title Text</p>
"! Text of the parameter title
TYPES ty_parameter_title_text TYPE c LENGTH 255.
"! <p class="shorttext">Title Text</p>
"! Text of the title
TYPES ty_title_text TYPE c LENGTH 120.
"! <p class="shorttext">Radio Button Group</p>
"! Name of the radio button group
TYPES ty_radio_button_group TYPE c LENGTH 4.
"! <p class="shorttext">Screen Element</p>
"! Type of the screen element
"! $values {@link zif_aff_sajc_v1.data:co_screen_element}
"! $default {@link zif_aff_sajc_v1.data:co_screen_element.none}
TYPES ty_screen_element TYPE c LENGTH 1.

CONSTANTS:
"! <p class="shorttext">Screen Element</p>
"! Type of the screen element
BEGIN OF co_screen_element,
"! <p class="shorttext">None</p>
"! None
none TYPE ty_screen_element VALUE ' ',
"! <p class="shorttext">Checkbox</p>
"! Checkbox
checkbox TYPE ty_screen_element VALUE 'C',
"! <p class="shorttext">Radio Button</p>
"! Radio button
radio_button TYPE ty_screen_element VALUE 'R',
"! <p class="shorttext">List Box</p>
"! List box
list_box TYPE ty_screen_element VALUE 'L',
END OF co_screen_element.

TYPES:
"! <p class="shorttext">Parameter</p>
Expand All @@ -76,6 +102,9 @@ INTERFACE zif_aff_sajc_v1
"! Name of the parameter
"! $required
name TYPE ty_parameter_name,
"! <p class="shorttext">Title</p>
"! Title of the parameter on the selection screen
title TYPE ty_parameter_title_text,
"! <p class="shorttext">Group</p>
"! Name of the parameter group
group TYPE ty_group_name,
Expand All @@ -94,6 +123,12 @@ INTERFACE zif_aff_sajc_v1
"! <p class="shorttext">Enabled By Parameter</p>
"! Name of the boolean parameter which enables / disables the current parameter
enabled_by_parameter TYPE ty_parameter_name,
"! <p class="shorttext">Screen Element</p>
"! Display of the parameter as screen element (radio button, checkbox, list box)
screen_element TYPE ty_screen_element,
"! <p class="shorttext">Radio Button Group</p>
"! Name of the radio button group if the parameter is a radio button
radio_button_group TYPE ty_radio_button_group,
"! <p class="shorttext">Backend Call</p>
"! Flag indicating whether a call of the backend system is triggered after a parameter value change to check it
backend_call TYPE abap_bool,
Expand All @@ -118,14 +153,14 @@ INTERFACE zif_aff_sajc_v1
"! <p class="shorttext">Name</p>
"! Name of the group
"! $required
name TYPE ty_group_name,
name TYPE ty_group_name,
"! <p class="shorttext">Title</p>
"! Title of the group on the selection screen
"! $required
title TYPE ty_title_text,
title TYPE ty_title_text,
"! <p class="shorttext">Section</p>
"! Name of the group section
section TYPE ty_section_name,
section TYPE ty_section_name,
END OF ty_group.
TYPES:
"! <p class="shorttext">Groups</p>
Expand All @@ -139,11 +174,11 @@ INTERFACE zif_aff_sajc_v1
"! <p class="shorttext">Name</p>
"! Name of the section
"! $required
name TYPE ty_section_name,
name TYPE ty_section_name,
"! <p class="shorttext">Title</p>
"! Title of the section on the selection screen
"! $required
title TYPE ty_title_text,
title TYPE ty_title_text,
END OF ty_section.
TYPES:
"! <p class="shorttext">Sections</p>
Expand Down
Loading

0 comments on commit e077915

Please sign in to comment.