Skip to content

stringification inside MP_ERROR_TEXT does not work; change affected code. #8610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jepler opened this issue Nov 15, 2023 · 0 comments · Fixed by #8613
Closed

stringification inside MP_ERROR_TEXT does not work; change affected code. #8610

jepler opened this issue Nov 15, 2023 · 0 comments · Fixed by #8613

Comments

@jepler
Copy link

jepler commented Nov 15, 2023

CircuitPython version

main

Code/REPL

mp_raise_NotImplementedError(MP_ERROR_TEXT("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported."));

Behavior

This places only the following string in circuitpython.pot:

#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c
msgid "Only 8 or 16 bit mono with "
msgstr ""

Description

Please change the message so it works properly.

One option is to simply write out "64x" in the source string and add a MP_STATIC_ASSERT that OVERSAMPLING==64.

Another option is to %d-format the number into the message.

Until one of these things is done, I don't think this message can be localized.

Additional information

This message occurs in two places:

ports/atmel-samd/common-hal/audiobusio/PDMIn.c|160| mp_raise_NotImplementedError(MP_ERROR_TEXT("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported."));     
ports/raspberrypi/common-hal/audiobusio/PDMIn.c|60| mp_raise_NotImplementedError(MP_ERROR_TEXT("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported."));
elpekenin added a commit to elpekenin/circuitpython that referenced this issue Nov 15, 2023
elpekenin added a commit to elpekenin/circuitpython that referenced this issue Nov 15, 2023
dhalbert added a commit that referenced this issue Nov 15, 2023
[Bugfix] Resolve #8610: concatenated strings not translatable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant