-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Tornado Template i18n extract the text waited to translate #2600
Comments
related: #622 |
Yes, a PR to extract translatable strings into babel would be welcome. |
Ok, I will do it as soon as possible. Code flow is very simple, but I need make a way to extend it to Tornado code structure Non-intrusive. This may waste a few days to do it. |
Hello: I open this comment to explain what I think about the extract translatable strings from Tornado's template. I study some days and I found that is hard to make this to Tornado code structure Non-intrusive. How can I extract translatable strings from Tornado's template?It is very simple to make this. As we know, all HTML template used in Python, It MUST translate to Python code, no matter what type template language it used. so, we can make it simple like this code flow:
Actually, I have finish the extract translatable strings part for Tornado. but I have some questions to extend this to Tornado code structure Non-intrusive. what problem I need some adviceI ask for some advice to help finish this. Here are my difficulty to finish the extract translatable strings for Tornado HTML template.
This is all my thoughts Does anyone have some advices about this? @bdarnell @ploxiln . Thanks. |
Adding a
Oh, good point. We might be able to work around this, though. We need the template path to be able to process
To be clear, this is just the extraction step, right? If this step walks over all the |
Thanks Ben. I also think it is not necessary to process template tag like The same process as like Tornado template has no It's better to do this as a plugin for babel. That's right. The plugin's core function is how to export tornado template And more, babel won't know about tornado's csv format, it is true. But it is very simple to get this as follow:
I will extend this to Thanks. |
Hello:
I use tornado template in my website, and I need to take i18n to my website. This is a sample HTML template in my application
As we know,
_('xxxxx')
is the i18n text waited to translate, but, if you used tornado template, You may NOT find any tools to extract those text asmessage.pot
oren_US.cvs
to take the translation.I found
pybabel
can extract the text fron jinja2 template, but it is NOT suitable to tornado template. As the same, GNU gettext not support HTML template to extract the text.After I review the source code of pybabel, I found it is simple to integreted to tornado template, What I need is just add some
functions
intornado.locale
, it is simeple and not much code, it will enhance tornado i18n.If anyone like this and need the code to extract tornado template HTML file gettext string, I am happy to share how I do it.
And more, if Ben like this, please feel free to leave a comment, I will make a PR ASAP.
The text was updated successfully, but these errors were encountered: