Commit fc2b121
committed
Read .po
`declared_nplurals` re-read the `.po` line by line and returned the first
`nplurals=` it found anywhere, so a stray occurrence before the real
`Plural-Forms` header (a comment, a translated string) would be read as the
form count and make `guard_po_plural_count!` abort with a spurious error.
Real GlotPress exports were unaffected, but the scan was needlessly fragile
— and redundant, since the `.po` is already parsed by then.
Read `nplurals` from the parsed header entry (`po[nil, '']`), whose `msgstr`
holds only the header fields, so no token elsewhere in the file can be
mistaken for it. Drops the extra file read too.nplurals from the parsed header, not a raw-file scan1 parent 01483c4 commit fc2b121
2 files changed
Lines changed: 33 additions & 11 deletions
File tree
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios
- spec
Lines changed: 12 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | | - | |
353 | | - | |
| 353 | + | |
| 354 | + | |
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
356 | 377 | | |
357 | 378 | | |
0 commit comments