Implement translated template string formatting in Rust #4338
Labels
code
Code improvements
core
Trezor Core firmware. Runs on Trezor Model T and T2B1.
translations
Put this label on a PR to run tests in all languages
Moving forward, we'd like to have the capability to format translation strings directly in Rust and we don't want to count on MicroPython and pass pre-formatted strings to Rust layouts.
Currently, we have to do something like this (not real code):
If the
text
is not influenced by uPy app, we should be able to pass justwords
to Rust and format the text there.What we can do right now is to format using
uformat!
fromufmt
crate, but the drawback is that the format string can only be a string literal:I.e. something like this is not possible using
ufmt
:The task is to find, test, integrate and review an external crate which can do that, or develop our own.
The text was updated successfully, but these errors were encountered: