Open umlaeute opened 3 months ago
Hello @umlaeute !
Thanks for letting me know, I will consider implementing HTML-style string formatting, as well as variable placeholders. (<b>
for bold, %x, %y, %z
... for placeholders)
Regarding the punctuation marks, this is simply due to my lack of attention. Thanks for finding these, I will take care of them until the next update.
Hello @umlaeute !
I have implemented text formatting in the exact manner I mentioned in my message above. You may now implement changes to your localization as you desire. Please let me know if I've made any mistakes during re-formatting or if there's any formatting errors that need fixing.
I thank you very much for providing wonderful suggestions and helping out with localization!
Suggestion
while translating to german i noticed a couple of issues:
highlighting substrings
highlighting of substrings is achieved by concatenating multiple translations. this assumes that the translations follow the approximately the same syntactical structure as the original code.
e.g. the string
is split into two substrings ("Enter host address as shown" and "below the QR code"), where the 2nd one is highlighted. my preferred German translation would look like:
however, this is not possible (as the highlighted string must be at the end).
I'm not fully sure what would be the best approach here, but most likely some explicit markup within the translation string. e.g.
and then replace the
\<
and\>
markers to highlight-begin resp highlight-end at runtime.punctuation
right now the final punctuation mark in a translatable is hardcoded and cannot be translated. e.g. here the displayed string is forced to have a terminal
.
: https://github.com/GlitterWare/Passy/blob/f69bf2bbe7d72830407fde594e3aa84942c77614/lib/screens/export_screen.dart#L47and the translation must take care to not include this dot: https://github.com/GlitterWare/Passy/blob/f69bf2bbe7d72830407fde594e3aa84942c77614/lib/l10n/app_en.arb#L111
i think this is wrong:
.
in the template translation is a typo. and the correct translation does not look like a correct (full) sentence..
would be a problem somewhere.placeholders
also, some text requires placeholders. e.g. https://github.com/GlitterWare/Passy/blob/f69bf2bbe7d72830407fde594e3aa84942c77614/lib/l10n/app_en.arb#L34-L35 where there's an implicit placeholder at the end of the translation string. or https://github.com/GlitterWare/Passy/blob/f69bf2bbe7d72830407fde594e3aa84942c77614/lib/l10n/app_en.arb#L196-L199 i think this should be handled via an explicit placeholder: e.g.
resp.
there are two pros:
Submission checklist