-
Notifications
You must be signed in to change notification settings - Fork 37
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
shiny.i18n appears to not handle backslash properly #56
Comments
Indeed, after reading this:
You get: > i18n$get_translations()
de
One \\\\& Two Eins \\\\& Zwei That's something to do with how This worked fine for me though:
|
Hey @dokato, thanks for the fast reply. I have no idea what happens. So I need This seems strange to me. But, oh well. If it works I just need to strip the second backslash after extracting the keys. |
So I think that you need to keep double backslash only in R strings, otherwise it interprets by default it as a beginning of special character, e.g. > cat("\ta")
a
> cat("\\ta")
\ta I remembered that I had this problem in my other project, where we were porting template to latex (https://github.com/satRdays/badgeR/). |
Alright, I had to use sed to remove the second backslash. But now translations work well enough. Maybe create_translation_file() could do this for us? ;-) |
I'm using shiny.i18n to create multilang PDFs with knitr and LaTeX.
Using double-backslash for markup in i18n-translated strings results in the key not being recognized anymore.
Example:
i18n$t("One \\& Two")
translate-de.csv:
The text was updated successfully, but these errors were encountered: