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
Clean run results in modifications to en-us.py #832
Comments
Web2py's auto-i18n magic: https://github.com/OneZoom/OZtree/blob/main/models/db.py#L44-L45 http://web2py.com/books/default/chapter/29/04/the-core#Translating-variables We don't keep these derived files up-to-date though, I think we should be turning it off by default. |
Yep. We should fix this. What happens is that web2py makes "automatic translations" into different languages whenever a client visits the site with that language set. Whenever we make a new "translatable string", such as IMO, the easy fix is, once we have established a reasonable set of strings, to leave this to happen on beta.onezoom.org, then commit the changes into the main repo? But maybe @lentinj has a better idea. |
(@davidebbo, web2py has some management pages with a translation GUI, which people have used to translate onezoom via. beta.onezoom.org before, thus why Yan is suggesting allowing it on beta) We could start a regime where we commit any changes to the languages files with every commit, but it'd make the commit log a lot more noisy (assuming I don't forget and then have to do follow up commits...). I'd prefer if we:
This would be a bit annoying if you wanted to use the translation machinery locally, since you'd have to go gather strings yourself. But I don't think this has come up yet? And it's what would need to happen today anyway. |
This sounds good to me. Alternatively, we could only allow Another possibility is to set an appconfig.ini setting ( |
Thanks for all the details. I confirm that is I set Anyway, this is not a huge deal at the moment, so we can just track it and deal with it once we're passed this new release. |
Ah, I forgot that I had already implemented that, so that we don't write to the internationalised strings on production. We could change it so that the default (on github) setting is |
The default of An |
@lentinj Right, we should decouple them. Do you mean having Side note, |
Yup, please do. If you do, watch out for We should move to having a helper function do the try/except, but I don't think that's happened yet. |
There is already one: |
It does however do automatic casting of ints, and recognizes true/false, so it's quite usable. See https://github.com/web2py/web2py/blob/master/gluon/contrib/appconfig.py#L60-L79 |
I'm sure there was something else Could well be that this has since been fixed in web2py, and I've never updated my brain to match. |
I'll play around with it and send a PR. |
It's what they recommend in the web2py docs: http://web2py.com/books/default/chapter/29/04/the-core#Determining-the-language I guess it's a web2py shorthand, for plain |
Yep, no reason to mess with it, even though it is unusual! |
Not sure if it's something I'm doing, but this has been bugging me for a while. If I run the web site from a clean repo, I instantly see
en-us.py
get modified, with many lines added. Among others, it adds:Where are these coming from?
The text was updated successfully, but these errors were encountered: