@@ -190,13 +190,15 @@ private static List<LocalizableStringParam> GetParameters(string format)
190
190
i ++ ; // Move past '{'
191
191
int index = 0 ;
192
192
bool hasIndex = false ;
193
+
193
194
// Parse index
194
195
while ( i < len && char . IsDigit ( format [ i ] ) )
195
196
{
196
197
hasIndex = true ;
197
198
index = index * 10 + ( format [ i ] - '0' ) ;
198
199
i ++ ;
199
200
}
201
+
200
202
if ( ! hasIndex )
201
203
{
202
204
// Skip invalid format item
@@ -210,8 +212,25 @@ private static List<LocalizableStringParam> GetParameters(string format)
210
212
}
211
213
continue ;
212
214
}
213
- // Check for colon to parse format
215
+
216
+ // Check for alignment (comma followed by optional sign and digits)
217
+ if ( i < len && format [ i ] == ',' )
218
+ {
219
+ i ++ ; // Skip comma and optional sign
220
+ if ( i < len && ( format [ i ] == '+' || format [ i ] == '-' ) )
221
+ {
222
+ i ++ ;
223
+ }
224
+ // Skip digits
225
+ while ( i < len && char . IsDigit ( format [ i ] ) )
226
+ {
227
+ i ++ ;
228
+ }
229
+ }
230
+
214
231
string formatPart = null ;
232
+
233
+ // Check for format (after colon)
215
234
if ( i < len && format [ i ] == ':' )
216
235
{
217
236
i ++ ; // Move past ':'
@@ -243,6 +262,7 @@ private static List<LocalizableStringParam> GetParameters(string format)
243
262
i ++ ; // Move past '}'
244
263
}
245
264
}
265
+
246
266
parameters [ index ] = formatPart ;
247
267
if ( index > maxIndex )
248
268
{
@@ -255,11 +275,11 @@ private static List<LocalizableStringParam> GetParameters(string format)
255
275
// Handle possible escaped '}}'
256
276
if ( i + 1 < len && format [ i + 1 ] == '}' )
257
277
{
258
- i += 2 ;
278
+ i += 2 ; // Skip escaped '}}'
259
279
}
260
280
else
261
281
{
262
- i ++ ;
282
+ i ++ ; // Move past '}'
263
283
}
264
284
}
265
285
else
@@ -274,7 +294,7 @@ private static List<LocalizableStringParam> GetParameters(string format)
274
294
{
275
295
return result ;
276
296
}
277
-
297
+
278
298
for ( int idx = 0 ; idx <= maxIndex ; idx ++ )
279
299
{
280
300
var formatValue = parameters . TryGetValue ( idx , out var value ) ? value : null ;
0 commit comments