-
-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
Yeah, I'm a little worried about this as-is. We have been making some updates recently and it will get further behind. For instance, I want to fix #246 which should be easy, but I hesitate to all of a sudden plop a bunch of English into the localizations just by changing a couple words. What strategy do you suggest? |
Also, can you give (here in the comments, I mean) an example of how to use this utility? There is a lot in the first few commits and it would be good to have an overview. This would be pretty impressive, though. |
A workflow example with the translations utility. Assume that
Other tasks.
|
This is a very good explanation. Perhaps it should go into the sagenb docs in Sage. |
There are more options, but are auto-explained in the command's help. |
👍 That is really good. I agree that a version of this should definitely go in if this is merged. I won't have time to really look at it soon, but I like having a way to update the pot easily. |
A couple dumb questions:
|
#: from the location of this file, so it must not be moved or copied | ||
#: and executed from other location. Symlinking is fine. | ||
self.command_name = pth.basename(__file__) | ||
self.src = pth.dirname(pth.dirname(pth.realpath(__file__))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoah Nelly! Doesn't this assume this file will always be at this depth? I guess that's okay...
This is really impressive work. When I get a chance to try this out, I'm just going to try it by using it on the updated sagenb and seeing how it performs; that should be as good of a test case as any! Thanks for this. Upstream for babel doesn't look too active (perhaps like sagenb most of the time, note they have lots of unresolved pull requests too) but you never know. |
By the way, @migeruhito you may want to check out https://groups.google.com/forum/#!topic/sage-support/zglN_3QLCPo |
I mean completely unneeded now, but I understand that it is not the standard way for localizations, and people likes a
I don't think so. I think that babel is as it is by design. There are usually involved two steps in the localization tasks
And this workflow is reflected in the Babel coding style.
Yes. Were
Nothing at all.
Babel is licensed under BSD licensing scheme. I don't know if it is a problem for sage notebook. However the copy/pasted code is for filename, lineno, message, comments, context in extracted:
self.catalog.add(message, None, [(filename, lineno)],
auto_comments=comments, context=context) that is, a standard way to convert data furnished by the public API of Corrections in string docs done.
I have had this problem with my classroom server. If you have a server with ancient configuration files, you have 512 bit rsa keys and firefox 33 refuses to work with it. Currently, sage notebook generates 1024 bit keys, thus by deleting old RSA key and certificate, the notebook generates (on restart) new RSA stuff adequate for firefox 33. |
Okay, that answers all my questions, hopefully it will get tested sometime - not immediately by me, anyway - because it is very nice and definitely ready for testing. Interesting addition on the code for certificates. I think you could submit a pull request, just making it very clear that
because having the code available to look at could still be beneficial. I agree that introducing different bugs with security stuff is probably not wise! |
I want to try this out but get
I assume this is because I wasn't in the Sage shell. Did you assume that would be necessary? Maybe you had babel in your path anyway. |
Yes, I have the babel package installed in my system. If you don't want to install it, a workaround could be: |
Or one could just have people use the Sage shell all along, since Babel is installed there (assuming sagenb is installed, which in this case seems pretty safe!). |
Points just for my reference:
|
61e8a27
to
3b39823
Compare
Okay, I see a problem, one that has probably already crept in. What does this do with Just as a note to myself (or others), it turns out that at least some "outdated" messages when using this are from switch from |
I think that before we merge this I want to fix this problem - it is pretty bad, and a lot of the |
**self.data.to_file) | ||
|
||
def extract(self): | ||
"""Action function for the `update` subcommand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trivial typo - this should be extract
subcommand.
I think (but not sure) that For testing the true obsolete messages I use |
ee88f90
to
70a98b0
Compare
Thanks for the typo fix - though I have to say, the pep8 stuff probably wasn't strictly necessary 😃 |
Also, by the way, I took a quick look at your Spanish language changes and the ones I saw seemed good (it wouldn't let me preview the very large changeset). |
I think this just needs one thing, then.
Really, it should give the same message about not having enough arguments as I get here.
Otherwise this is ready to go, and I look forward to testing it out on the German messages, as well as adding some version of your instructions as a markdown file (unless you want to). |
I think that things like
must not throw an error because the rest of arguments are optional. The subcommand
In the case
an error must be issued (execution is actually aborted) because, unless you call for help, a I you want me to change this behavior, I'll do it, of course, but then I must to rethink the interface logic. |
The When translation's code of the Notebook reaches a more or less stable status (i.e. pending pull requests were accepted or discarded), I shall issue the corresponding pull request for that branch. |
Well, my point was that maybe it shouldn't be optional to give an argument! But I agree that people using this probably will be with it enough to look for help by just using the file itself without any arguments.
Did you mean "put in |
Yes, definitely, or you meant "get rid of" in the sense of extracting them. Great. |
cbe21a7
to
f99bfed
Compare
It is easy to make the language arguments mandatory for all the subcommands. I can do it if you think it is better.
Sorry, I mean, as you have concluded, exactly the contrary thing. Commit message changed. |
This is already really fine, no need for this. |
Po and pot management utility
Currently the messages template for translations is outdated, specially the references to sources. Also the localizations are outdated. I have implemented a small utility to easily accomplish maintenance task on translations. It encapsulates some
pybabel
functionality, adapted to the Sage Notebook source tree. Also it performs some tasks not directly available frompybabel
. For example, we can now update translations directly from the source tree without any intermediate template file (pot
). Only the public API of thebabel
package is used.The utility has a detailed buitin help. Issue
/path_to_sagenb_source/utility/translations.py -h
on the command line for help. Warnings about the need of manual review on update are issued on demand.TODO:
sagenb/babel.cfg
is no more neccessary.sagenb/message.pot
. Updates of existing translations (with manual review, of course) from the source tree can be done, and also new translation initializatiions.