8000 Shrink by combining error messages · rbrian/circuitpython@177b981 · GitHub
[go: up one dir, main page]

Skip to content

Commit 177b981

Browse files
committed
Shrink by combining error messages
1 parent 9d11bda commit 177b981

File tree

2 files changed

+16
-33
lines changed

2 files changed

+16
-33
lines changed

locale/circuitpython.pot

Lines changed: 13 additions & 30 deletions
D7AF
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,15 @@ msgstr ""
165165
msgid "%q length must be >= %d"
166166
msgstr ""
167167

168-
#: ports/raspberrypi/common-hal/picodvi/Framebuffer.c py/argcheck.c
168+
#: py/argcheck.c
169169
msgid "%q must be %d"
170170
msgstr ""
171171

172172
#: py/argcheck.c shared-bindings/displayio/Bitmap.c
173+
#: shared-bindings/displayio/Display.c
174+
#: shared-bindings/framebufferio/FramebufferDisplay.c
175+
#: shared-bindings/is31fl3741/FrameBuffer.c
176+
#: shared-bindings/rgbmatrix/RGBMatrix.c
173177
msgid "%q must be %d-%d"
174178
msgstr ""
175179

@@ -203,6 +207,7 @@ msgstr ""
203207

204208
#: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c
205209
#: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c
210+
#: shared-module/synthio/Synthesizer.c
206211
msgid "%q must be of type %q or %q, not %q"
207212
msgstr ""
208213

@@ -425,6 +430,7 @@ msgid "Address must be %d bytes long"
425430
msgstr ""
426431

427432
#: ports/espressif/common-hal/memorymap/AddressRange.c
433+
#: ports/nrf/common-hal/memorymap/AddressRange.c
428434
msgid "Address range not allowed"
429435
msgstr ""
430436

@@ -608,13 +614,6 @@ msgstr ""
608614
msgid "Both pins must support hardware interrupts"
609615
msgstr ""
610616

611-
#: shared-bindings/displayio/Display.c
612-
#: shared-bindings/framebufferio/FramebufferDisplay.c
613-
#: shared-bindings/is31fl3741/FrameBuffer.c
614-
#: shared-bindings/rgbmatrix/RGBMatrix.c
615-
msgid "Brightness must be 0-1.0"
616-
msgstr ""
617-
618617
#: shared-bindings/displayio/Display.c
619618
#: shared-bindings/framebufferio/FramebufferDisplay.c
620619
msgid "Brightness not adjustable"
@@ -927,11 +926,6 @@ msgstr ""
927926
msgid "EXTINT channel already in use"
928927
msgstr ""
929928

930-
#: shared-module/synthio/MidiTrack.c
931-
#, c-format
932-
msgid "Error in MIDI stream at position %d"
933-
msgstr ""
934-
935929
#: extmod/modure.c
936930
msgid "Error in regex"
937931
msgstr ""
@@ -1343,11 +1337,6 @@ msgstr ""
13431337
msgid "Mapping must be a tuple"
13441338
msgstr ""
13451339

1346-
#: shared-module/displayio/Shape.c
1347-
#, c-format
1348-
msgid "Maximum x value when mirrored is %d"
1349-
msgstr ""
1350-
13511340
#: shared-bindings/audiobusio/PDMIn.c
13521341
msgid "Microphone startup delay must be in range 0.0 to 1.0"
13531342
msgstr ""
@@ -1441,6 +1430,10 @@ msgstr ""
14411430
msgid "Nimble out of memory"
14421431
msgstr ""
14431432

1433+
#: ports/atmel-samd/common-hal/busio/UART.c
1434+
msgid "No %q pin"
1435+
msgstr ""
1436+
14441437
#: ports/espressif/common-hal/_bleio/Characteristic.c
14451438
#: ports/nrf/common-hal/_bleio/Characteristic.c
14461439
msgid "No CCCD for this Characteristic"
@@ -1489,14 +1482,12 @@ msgstr ""
14891482
msgid "No MOSI pin"
14901483
msgstr ""
14911484

1492-
#: ports/atmel-samd/common-hal/busio/UART.c
14931485
#: ports/espressif/common-hal/busio/UART.c
14941486
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
14951487
#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
14961488
msgid "No RX pin"
14971489
msgstr ""
14981490

1499-
#: ports/atmel-samd/common-hal/busio/UART.c
15001491
#: ports/espressif/common-hal/busio/UART.c
15011492
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
15021493
#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
@@ -2123,8 +2114,8 @@ msgstr ""
21232114
msgid "UART de-init"
21242115
msgstr ""
21252116

2126-
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
2127-
#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
2117+
#: ports/cxd56/common-hal/busio/UART.c ports/espressif/common-hal/busio/UART.c
2118+
#: ports/stm/common-hal/busio/UART.c
21282119
msgid "UART init"
21292120
msgstr ""
21302121

@@ -4342,18 +4333,10 @@ msgstr ""
43424333
msgid "wrong output type"
43434334
msgstr ""
43444335

4345-
#: shared-module/displayio/Shape.c
4346-
msgid "x value out of bounds"
4347-
msgstr ""
4348-
43494336
#: ports/espressif/common-hal/audiobusio/__init__.c
43504337
msgid "xTaskCreate failed"
43514338
msgstr ""
43524339

4353-
#: shared-module/displayio/Shape.c
4354-
msgid "y value out of bounds"
4355-
msgstr ""
4356-
43574340
#: extmod/ulab/code/scipy/signal/signal.c
43584341
msgid "zi must be an ndarray"
43594342
msgstr ""

ports/atmel-samd/common-hal/busio/UART.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
241241
}
242242

243243
if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) {
244-
mp_raise_RuntimeError(translate("UART init"));
244+
mp_raise_RuntimeError(NULL);
245245
}
246246

247247
// usart_async_init() sets a number of defaults based on a prototypical SERCOM
@@ -396,7 +396,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) {
396396
// Read characters.
397397
size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) {
398398
if (self->rx_pin == NO_PIN) {
399-
mp_raise_ValueError(translate("No RX pin"));
399+
mp_raise_ValueError_varg(translate("No %q pin"), MP_QSTR_rx);
400400
}
401401

402402
// This assignment is only here because the usart_async routines take a *const argument.
@@ -453,7 +453,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
453453
// Write characters.
454454
size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) {
455455
if (self->tx_pin == NO_PIN) {
456-
mp_raise_ValueError(translate("No TX pin"));
456+
mp_raise_ValueError_varg(translate("No %q pin"), MP_QSTR_tx);
457457
}
458458

459459
// This assignment is only here because the usart_async routines take a *const argument.

0 commit comments

Comments
 (0)
0