Skip to content

Commit 2704e5b

Browse files
author
Jelte Lagendijk
committed
Fix #4 Multi language (now you can use translatable strings
1 parent 5c8cc5e commit 2704e5b

File tree

4 files changed

+276
-107
lines changed

4 files changed

+276
-107
lines changed

src/formatstring/formatstring.xml

Lines changed: 245 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@
44
<description>Format string.</description>
55

66
<icon>
7-
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhk
8-
iAAAAAlwSFlzAAAFMQAABTEBt+0oUgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3Nj
9-
YXBlLm9yZ5vuPBoAAAT4SURBVGiB1VrNTxtHFP/N7Owaf6JUiFQNhJRUvfARckSV
10-
sNTcmq9bI86tKg5EjXJqkHpKIxEiokr9GwBxzSEXUik98HXqpZGqcisOIaS4gPcT
11-
78z0YAy79q7X2EDNTxrN+HnW/v32+b15j4VIKXGeQf9vAs3i3AtglYbnvzy/no4n
12-
JzKZzE0hedyybDCFQWEKmKJAOVx7ZkU5GAyMHa0ppSCEQEoJIQQ4d8E5h+vywzXn
13-
HC53wd2jmXMXLufgLgdVKBSFWqZhvjQN/cn9+w9/9/Il3hh49vOzod7LPctXrvS2
14-
tbe3g1IFlmXCdV0QQkApLQ1CQSjxrCkoJb41IRSUEIAQQEoIKSGlgBASUgiIqrWA
15-
FPJwLYQApQpimgYuOP7N5/H23Yb199v1Lx56RPg8oDH1h66u7rbBgWtwXRetEuCE
16-
EPR+ehWpv/6Mf/jn/SMAX5ff8wmIt8Vup1NpWJZ15iSjUCwWkYgnkEqkb3ntPgGW
17-
ZScIoS1z5yshIWE7dtxr82UhQ9db8u6XYegG8vm8z+bzAOccxeJ+y3rAcRwIzn02
18-
vwAhICQCBRQKeygYe6dGLp3MIJ3O1NwjIcGF8Nl8AoQQQMjdN20DG+9yTdIMR3dX
19-
T7SAg/PEiyoBEjLQA92XevBZ7+cnQDUYjuPAcZ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qDuBUgJSAjT+IGPTAzM9MUucHBQQwMDETsKnVsXlRUo6VS
23+
ohHMzs42dF0ZqqpGCpCyxNGL6pM4wAPT09MYGxtDMpkM/fDl5eXjcvbBNM06epGI
24+
Yk7KYA+srKxgbW0N4+Pj6O/vD/zo7e3t4zFuAEEHma+UKL8ppfQNLaahoBcw+XQS
25+
M7Mz2D9oes56BHmgWkBACMQ0DTFNg6aq+PXVK/z0+DFyudPrDWpB1kyjnCMojWox
26+
zfd668MWnk5N4s6du7jx5Q0QQjA3N9cwqdHR0br2lc6BiJYyKINqmlZtBPDmzR8Y
27+
ujaEjo6OMxEAILqllAG/s1isWsC9e6PIjmSh6zo451haWjoOZx+2trbq2ldXSxkU
28+
A14PXLjwER58/wCpVBq7u7vHJtEsGuqJywJGRrK4dfM2dF1HoVA4ZarViOwHBA/2
29+
QCaTxrfffIeLFz/Gzs7OqZKMguCRxVz1STzx6EfYtl2T/Pz8fFPE+vv70dfXF7lP
30+
1qqFwoq4vb29yAKvWQGapkUKiAxiHhID9VSni4uL9XINhK7r0HU9cl/NNMor/u54
31+
HGxubjZ87XFQVxC3akMD1NETA60rgBBSu5ijlIKxqud+LQPGGFRV9du8LyglhmEY
32+
yUqVrQLLsqAo1PTafB4oFt0Xr397DULI2TKrA4QQLC4twradF167zwO2bU/l1nN3
33+
5+fnE8PDw4jH43BdF0KIw8eslXOQzTuXnxOXc3jYHGQjhIAxBtM0sbq6itx6zjQM
34+
Y8onrDJgs9ns9c7Ozon29vavhBAJx3HAGIOmadA0DaqqHq69o2z3zoyxQwGu66JY
35+
LGJ/f79qrhze91VVhRDC0nX9ZT6ff7KwsBD+oPs84tz/r8S5F/AfqCmjVAJVWGgA
36+
AAAASUVORK5CYII=
3737
</icon>
3838

3939
<properties>
40-
<property key="notused" type="object" isList="true" required="false">
40+
<property key="notused" type="object" isList="true" required="false">
4141
<caption>Attributes</caption>
4242
<category>Data source</category>
4343
<description></description>
@@ -47,75 +47,224 @@
4747
<category>Data source</category>
4848
<description>Identifies the attribute value, this name should be used in 'Display string' property.</description>
4949
</property>
50-
<property key="attrs" type="attribute" allowNonPersistableEntities="true" isPath="optional" pathType="reference">
51-
<caption>Attribute</caption>
52-
<category>Data source</category>
53-
<description>Value of this attribute will be used to replace ${your_Variable_Name}, defined in 'Display string' property</description>
54-
<attributeTypes>
55-
<attributeType name="AutoNumber"/>
56-
<attributeType name="String" />
57-
<attributeType name="Enum"/>
58-
<attributeType name="Integer"/>
59-
<attributeType name="Float"/>
60-
<attributeType name="Long"/>
61-
<attributeType name="DateTime"/>
62-
<attributeType name="Currency"/>
63-
<attributeType name="Decimal"/>
64-
</attributeTypes>
65-
</property>
66-
<property key="emptyReplacement" type="translatableString" required="false">
67-
<caption>Empty value replacement</caption>
68-
<category>Data source</category>
69-
<description>This string will be used when an attribute returns empty. Note that this string is interpreted as HTML.</description>
70-
</property>
71-
<property key="datetimeformat" type="enumeration" defaultValue="datetime" >
72-
<caption>Date format</caption>
73-
<category>Behaviour</category>
74-
<description>Shows date and/or time according to locale of user. Relative is time relative to current datetime. (E.g. 3 hours from now) </description>
75-
<enumerationValues>
76-
<enumerationValue key="datetime">Date and time </enumerationValue>
77-
<enumerationValue key="date">Date</enumerationValue>
78-
<enumerationValue key="time">Time</enumerationValue>
79-
<enumerationValue key="relative">Relative</enumerationValue>
80-
</enumerationValues>
81-
</property>
82-
<property key="datePattern" type="translatableString" required="false">
83-
<caption>Date pattern</caption>
84-
<category>Behaviour</category>
85-
<description>Optional, date pattern to override date part according to dojo/date/locale</description>
86-
</property>
87-
<property key="timePattern" type="translatableString" required="false">
88-
<caption>Time pattern</caption>
89-
<category>Behaviour</category>
90-
<description>Optional, time pattern to override time part according to dojo/date/locale</description>
91-
</property>
92-
<property key="renderHTML" type="boolean" defaultValue="false">
93-
<caption>Render value as HTML</caption>
94-
<category>Behaviour</category>
95-
<description>Escapes string value when set to false</description>
96-
</property>
97-
<property key="decimalPrecision" type="integer" defaultValue="0">
98-
<caption>Decimal precision</caption>
99-
<category>Behaviour</category>
100-
<description>Amount of decimals</description>
101-
</property>
102-
<property key="groupDigits" type="boolean" defaultValue="true">
103-
<caption>Group digits</caption>
104-
<category>Behaviour</category>
105-
<description>Displays a numeric value with group digits</description>
106-
</property>
50+
<property key="attrs" type="attribute" allowNonPersistableEntities="true" isPath="optional" pathType="reference">
51+
<caption>Attribute</caption>
52+
<category>Data source</category>
53+
<description>Value of this attribute will be used to replace ${your_Variable_Name}, defined in 'Display string' property</description>
54+
<attributeTypes>
55+
<attributeType name="AutoNumber"/>
56+
<attributeType name="String" />
57+
<attributeType name="Enum"/>
58+
<attributeType name="Integer"/>
59+
<attributeType name="Float"/>
60+
<attributeType name="Currency"/>
61+
<attributeType name="Decimal"/>
62+
<attributeType name="Long"/>
63+
<attributeType name="DateTime"/>
64+
</attributeTypes>
65+
</property>
66+
<property key="emptyReplacement" type="translatableString" required="false">
67+
<caption>Empty value replacement</caption>
68+
<category>Data source</category>
69+
<description>This string will be used when an attribute returns empty. Note that this string is interpreted as HTML.</description>
70+
</property>
71+
<property key="datetimeformat" type="enumeration" defaultValue="datetime" >
72+
<caption>Date format</caption>
73+
<category>Behaviour</category>
74+
<description>Shows date and/or time according to locale of user. Relative is time relative to current datetime. (E.g. 3 hours from now) </description>
75+
<enumerationValues>
76+
<enumerationValue key="datetime">Date and time </enumerationValue>
77+
<enumerationValue key="date">Date</enumerationValue>
78+
<enumerationValue key="time">Time</enumerationValue>
79+
<enumerationValue key="relative">Relative</enumerationValue>
80+
</enumerationValues>
81+
</property>
82+
<property key="datePattern" type="translatableString" required="false">
83+
<caption>Date pattern</caption>
84+
<category>Behaviour</category>
85+
<description>Optional, date pattern to override date part according to dojo/date/locale</description>
86+
</property>
87+
<property key="timePattern" type="translatableString" required="false">
88+
<caption>Time pattern</caption>
89+
<category>Behaviour</category>
90+
<description>Optional, time pattern to override time part according to dojo/date/locale</description>
91+
</property>
92+
<property key="renderHTML" type="boolean" defaultValue="false">
93+
<caption>Render value as HTML</caption>
94+
<category>Behaviour</category>
95+
<description>Escapes string value when set to false</description>
96+
</property>
97+
<property key="decimalPrecision" type="integer" defaultValue="0">
98+
<caption>Decimal precision</caption>
99+
<category>Behaviour</category>
100+
<description>Amount of decimals</description>
101+
</property>
102+
<property key="groupDigits" type="boolean" defaultValue="true">
103+
<caption>Group digits</caption>
104+
<category>Behaviour</category>
105+
<description>Displays a numeric value with group digits</description>
106+
</property>
107107
</properties>
108108
</property>
109-
<property key="onclickmf" type="microflow" required="false">
109+
<property key="onclickmf" type="microflow" required="false">
110110
<caption>On click</caption>
111111
<category>Behavior</category>
112112
<description>Microflow to be invoked on click.</description>
113113
<returnType type="Void"/>
114114
</property>
115-
<property key="displaystr" type="translatableString" multiline="true">
116-
<caption>Display string</caption>
117-
<category>Behavior</category>
118-
<description>Use ${[your_Variable_Name]} to have the attribute value inserted in this string. Note that this string, except for the replacements, is interpreted as HTML. </description>
119-
</property>
120-
</properties>
121-
</widget>
115+
<property key="useTranslatableStrings" type="boolean" defaultValue="false" required="true">
116+
<caption>Translatable strings</caption>
117+
<category>Behavior</category>
118+
<description>Use translatable strings (instead of internal language pack)</description>
119+
</property>
120+
<property key="translateStringsecond" type="translatableString">
121+
<caption>String value for second</caption>
122+
<category>Customization</category>
123+
<description>String value for second</description>
124+
<translations>
125+
<translation lang="en_US">second</translation>
126+
<translation lang="nl_NL">seconde</translation>
127+
</translations>
128+
</property>
129+
<property key="translateStringseconds" type="translatableString">
130+
<caption>String value for seconds</caption>
131+
<category>Customization</category>
132+
<description>String value for seconds</description>
133+
<translations>
134+
<translation lang="en_US">seconds</translation>
135+
<translation lang="nl_NL">seconden</translation>
136+
</translations>
137+
</property>
138+
<property key="translateStringminute" type="translatableString">
139+
<caption>String value for minute</caption>
140+
<category>Customization</category>
141+
<description>String value for minute</description>
142+
<translations>
143+
<translation lang="en_US">minute</translation>
144+
<translation lang="nl_NL">minuut</translation>
145+
</translations>
146+
</property>
147+
<property key="translateStringminutes" type="translatableString">
148+
<caption>String value for minutes</caption>
149+
<category>Customization</category>
150+
<description>String value for minutes</description>
151+
<translations>
152+
<translation lang="en_US">minutes</translation>
153+
<translation lang="nl_NL">minuten</translation>
154+
</translations>
155+
</property>
156+
<property key="translateStringhour" type="translatableString">
157+
<caption>String value for hour</caption>
158+
<category>Customization</category>
159+
<description>String value for hour</description>
160+
<translations>
161+
<translation lang="en_US">hour</translation>
162+
<translation lang="nl_NL">uur</translation>
163+
</translations>
164+
</property>
165+
<property key="translateStringhours" type="translatableString">
166+
<caption>String value for hours</caption>
167+
<category>Customization</category>
168+
<description>String value for hours</description>
169+
<translations>
170+
<translation lang="en_US">hours</translation>
171+
<translation lang="nl_NL">uur</translation>
172+
</translations>
173+
</property>
174+
<property key="translateStringday" type="translatableString">
175+
<caption>String value for day</caption>
176+
<category>Customization</category>
177+
<description>String value for day</description>
178+
<translations>
179+
<translation lang="en_US">day</translation>
180+
<translation lang="nl_NL">dag</translation>
181+
</translations>
182+
</property>
183+
<property key="translateStringdays" type="translatableString">
184+
<caption>String value for days</caption>
185+
<category>Customization</category>
186+
<description>String value for days</description>
187+
<translations>
188+
<translation lang="en_US">days</translation>
189+
<translation lang="nl_NL">dagen</translation>
190+
</translations>
191+
</property>
192+
<property key="translateStringweek" type="translatableString">
193+
<caption>String value for week</caption>
194+
<category>Customization</category>
195+
<description>String value for week</description>
196+
<translations>
197+
<translation lang="en_US">week</translation>
198+
<translation lang="nl_NL">week</translation>
199+
</translations>
200+
</property>
201+
<property key="translateStringweeks" type="translatableString">
202+
<caption>String value for weeks</caption>
203+
<category>Customization</category>
204+
<description>String value for weeks</description>
205+
<translations>
206+
<translation lang="en_US">weeks</translation>
207+
<translation lang="nl_NL">weken</translation>
208+
</translations>
209+
</property>
210+
<property key="translateStringmonth" type="translatableString">
211+
<caption>String value for month</caption>
212+
<category>Customization</category>
213+
<description>String value for month</description>
214+
<translations>
215+
<translation lang="en_US">month</translation>
216+
<translation lang="nl_NL">maand</translation>
217+
</translations>
218+
</property>
219+
<property key="translateStringmonths" type="translatableString">
220+
<caption>String value for months</caption>
221+
<category>Customization</category>
222+
<description>String value for months</description>
223+
<translations>
224+
<translation lang="en_US">months</translation>
225+
<translation lang="nl_NL">maanden</translation>
226+
</translations>
227+
</property>
228+
<property key="translateStringyear" type="translatableString">
229+
<caption>String value for year</caption>
230+
<category>Customization</category>
231+
<description>String value for year</description>
232+
<translations>
233+
<translation lang="en_US">year</translation>
234+
<translation lang="nl_NL">jaar</translation>
235+
</translations>
236+
</property>
237+
<property key="translateStringyears" type="translatableString">
238+
<caption>String value for years</caption>
239+
<category>Customization</category>
240+
<description>String value for years</description>
241+
<translations>
242+
<translation lang="en_US">years</translation>
243+
<translation lang="nl_NL">jaar</translation>
244+
</translations>
245+
</property>
246+
<property key="translateStringtimestampFuture" type="translatableString">
247+
<caption>String value for from now</caption>
248+
<category>Customization</category>
249+
<description>String value for from now</description>
250+
<translations>
251+
<translation lang="en_US">from now</translation>
252+
<translation lang="nl_NL">vanaf nu</translation>
253+
</translations>
254+
</property>
255+
<property key="translateStringtimestampPast" type="translatableString">
256+
<caption>String value for ago</caption>
257+
<category>Customization</category>
258+
<description>String value for ago</description>
259+
<translations>
260+
<translation lang="en_US">ago</translation>
261+
<translation lang="nl_NL">geleden</translation>
262+
</translations>
263+
</property>
264+
<property key="displaystr" type="translatableString" multiline="true">
265+
<caption>Display string</caption>
266+
<category>Behavior</category>
267+
<description>Use ${[your_Variable_Name]} to have the attribute value inserted in this string. Note that this string, except for the replacements, is interpreted as HTML. </description>
268+
</property>
269+
</properties>
270+
</widget>

0 commit comments

Comments
 (0)