Code source wiki de ClassTranslationsGenerator
Version 2.1 par Paul Libbrecht (admin) le 2016/07/26 22:02
Masquer les derniers auteurs
author | version | line-number | content |
---|---|---|---|
![]() |
2.1 | 1 | {{velocity output="false"}} |
2 | ## Special characters that need to be escaped in the key. | ||
3 | #set ($keySpecialCharsPattern = $regextool.compile('([=: \\])')) | ||
4 | |||
5 | #macro (map $key $value) | ||
6 | $keySpecialCharsPattern.matcher($key).replaceAll('\\$1')=$value | ||
7 | #end | ||
8 | {{/velocity}} | ||
9 | |||
10 | {{velocity wiki="false"}} | ||
![]() |
1.1 | 11 | $escapetool.h Class fields |
12 | #set ($prefix = "${doc.fullName}_") | ||
13 | #foreach ($property in $doc.getxWikiClass().properties) | ||
![]() |
2.1 | 14 | #map("$prefix$property.name" $property.prettyName) |
![]() |
1.1 | 15 | #if ($property.type.endsWith('ListClass')) |
16 | ## Generate translations for the list values. | ||
17 | #foreach ($entry in $property.mapValues.entrySet()) | ||
![]() |
2.1 | 18 | #map("$prefix${property.name}_$entry.key" $entry.value.value) |
![]() |
1.1 | 19 | #end |
20 | #end | ||
21 | #end | ||
22 | |||
23 | $escapetool.h Live table generic keys | ||
![]() |
2.1 | 24 | #set ($appName = $doc.name.replaceAll('Class', '').toLowerCase()) |
25 | #set ($prefix = "${appName}.livetable.") | ||
26 | #set ($liveTableGenericKeys = { | ||
27 | 'doc.title': 'liveTableEditorDocTitleColumnName', | ||
28 | 'doc.name': 'liveTableEditorDocNameColumnName', | ||
29 | 'doc.space': 'liveTableEditorDocSpaceColumnName', | ||
30 | 'doc.fullname': 'liveTableEditorDocFullNameColumnName', | ||
31 | 'doc.author': 'liveTableEditorDocAuthorColumnName', | ||
32 | 'doc.creator': 'liveTableEditorDocCreatorColumnName', | ||
33 | 'doc.date': 'liveTableEditorDocDateColumnName', | ||
34 | 'doc.creationDate': 'liveTableEditorDocCreationDateColumnName', | ||
35 | '_avatar': 'liveTableEditorAvatarColumnName', | ||
36 | '_images': 'liveTableEditorImagesColumnName', | ||
37 | '_attachments': 'liveTableEditorAttachmentsColumnName', | ||
38 | '_actions': 'liveTableEditorActionsColumnName', | ||
39 | '_actions.edit': 'appLiveTableEditEntryActionName', | ||
40 | '_actions.delete': 'appLiveTableDeleteEntryActionName' | ||
41 | }) | ||
42 | #foreach ($entry in $liveTableGenericKeys.entrySet()) | ||
43 | #map("$prefix$entry.key" $services.localization.render("platform.appwithinminutes.$entry.value")) | ||
44 | #end | ||
45 | #map("${prefix}emptyvalue" '-') | ||
![]() |
1.1 | 46 | |
47 | $escapetool.h Live table specific keys | ||
48 | #foreach ($property in $doc.getxWikiClass().properties) | ||
![]() |
2.1 | 49 | #map("$prefix$property.name" $property.prettyName) |
![]() |
1.1 | 50 | #end |
![]() |
2.1 | 51 | |
52 | #map("${appName}.dataSpace.title" 'Data') | ||
![]() |
1.1 | 53 | {{/velocity}} |