Code source wiki de ClassTranslationsGenerator
Modifié par superadmin le 2021/12/12 21:57
Masquer les derniers auteurs
author | version | line-number | content |
---|---|---|---|
![]() |
3.1 | 1 | {{include reference="AppWithinMinutes.VelocityMacros" /}} |
2 | |||
![]() |
2.1 | 3 | {{velocity output="false"}} |
4 | ## Special characters that need to be escaped in the key. | ||
5 | #set ($keySpecialCharsPattern = $regextool.compile('([=: \\])')) | ||
6 | |||
7 | #macro (map $key $value) | ||
8 | $keySpecialCharsPattern.matcher($key).replaceAll('\\$1')=$value | ||
9 | #end | ||
![]() |
3.1 | 10 | |
11 | #getAppTitle | ||
![]() |
2.1 | 12 | {{/velocity}} |
13 | |||
14 | {{velocity wiki="false"}} | ||
![]() |
1.1 | 15 | $escapetool.h Class fields |
16 | #set ($prefix = "${doc.fullName}_") | ||
17 | #foreach ($property in $doc.getxWikiClass().properties) | ||
![]() |
2.1 | 18 | #map("$prefix$property.name" $property.prettyName) |
![]() |
3.1 | 19 | #if ($property.type == 'StaticListClass') |
![]() |
1.1 | 20 | ## Generate translations for the list values. |
21 | #foreach ($entry in $property.mapValues.entrySet()) | ||
![]() |
2.1 | 22 | #map("$prefix${property.name}_$entry.key" $entry.value.value) |
![]() |
1.1 | 23 | #end |
24 | #end | ||
25 | #end | ||
26 | |||
![]() |
4.1 | 27 | $escapetool.h Sheet keys |
28 | #set ($appName = $doc.documentReference.name.replaceAll('Class', '').toLowerCase()) | ||
29 | #map("${appName}.sheet.description" "This page controls how $appTitle pages are displayed in both view and edit modes.") | ||
30 | #map("${appName}.sheet.noObject" "The current page doesn't have the expected $appTitle object.") | ||
31 | #map("${appName}.sheet.noFields" "The $appTitle application doesn't have any fields to display.") | ||
32 | |||
![]() |
1.1 | 33 | $escapetool.h Live table generic keys |
![]() |
2.1 | 34 | #set ($prefix = "${appName}.livetable.") |
35 | #set ($liveTableGenericKeys = { | ||
36 | 'doc.title': 'liveTableEditorDocTitleColumnName', | ||
37 | 'doc.name': 'liveTableEditorDocNameColumnName', | ||
38 | 'doc.space': 'liveTableEditorDocSpaceColumnName', | ||
39 | 'doc.fullname': 'liveTableEditorDocFullNameColumnName', | ||
![]() |
3.1 | 40 | 'doc.location': 'liveTableEditorDocLocationColumnName', |
![]() |
2.1 | 41 | 'doc.author': 'liveTableEditorDocAuthorColumnName', |
42 | 'doc.creator': 'liveTableEditorDocCreatorColumnName', | ||
43 | 'doc.date': 'liveTableEditorDocDateColumnName', | ||
44 | 'doc.creationDate': 'liveTableEditorDocCreationDateColumnName', | ||
45 | '_avatar': 'liveTableEditorAvatarColumnName', | ||
46 | '_images': 'liveTableEditorImagesColumnName', | ||
47 | '_attachments': 'liveTableEditorAttachmentsColumnName', | ||
48 | '_actions': 'liveTableEditorActionsColumnName', | ||
49 | '_actions.edit': 'appLiveTableEditEntryActionName', | ||
50 | '_actions.delete': 'appLiveTableDeleteEntryActionName' | ||
51 | }) | ||
52 | #foreach ($entry in $liveTableGenericKeys.entrySet()) | ||
53 | #map("$prefix$entry.key" $services.localization.render("platform.appwithinminutes.$entry.value")) | ||
54 | #end | ||
55 | #map("${prefix}emptyvalue" '-') | ||
![]() |
1.1 | 56 | |
57 | $escapetool.h Live table specific keys | ||
58 | #foreach ($property in $doc.getxWikiClass().properties) | ||
![]() |
2.1 | 59 | #map("$prefix$property.name" $property.prettyName) |
![]() |
1.1 | 60 | #end |
![]() |
2.1 | 61 | |
![]() |
3.1 | 62 | $escapetool.h Other keys |
63 | #map("${appName}.entry.name" $appTitle) | ||
64 | |||
65 | $escapetool.h Deprecated keys | ||
![]() |
2.1 | 66 | #map("${appName}.dataSpace.title" 'Data') |
![]() |
1.1 | 67 | {{/velocity}} |