yes, I will think how to implement that, maybe as a bottle plugin or
something, because right now move translation from one web2py
application to another is one of that things that I think can improve in
my workflow.
Greethings.
El 2/5/19 a las 3:02 a.m., Massimo Di Pierro escribió:
I would prefer not to go in that direction. The previous T suffered
from scope creep and too many options. This would make the interface
for editing the translations more complex. It would also break one of
the use cases exposed in web3py/applications/_scaffold/controller.py
which exposes the translations as json service.
If you want to divide translations in subfolders, maybe you can create
simply a tool that aggregates mutliple files into one for each
language and, for subfolders, it prepends the subfolder name to the
original string. Example:
default/it.py = {'pizza':{0:'no pizza',1:'una pizza',2:'due pizze'}}
margherita/it.py {'pizza':{0:'no pizza',1:'una pizza
margherita',2:'due pizze margherite'}}
it.py (merged) = {'pizza':{0:'no pizza',1:'una pizza',2:'due pizze'},
'margherita::pizza':{0:'no pizza',1:'una pizza margherita',2:'due
pizze margherite'}}
T("pizza") % dict(n=2) -> "due pizze"
T("margherita::pizza") % dict(n=2) -> "due pizze margherite"
In this was you can achieve the same without changing the current code.
On Monday, 29 April 2019 06:59:24 UTC-7, Carlos Cesar Caballero wrote:
It looks good!! I can work to support categories if you think it
worth it. Allow something like T("string", "category") or
T("string", cat="category"). A category would map to an specific
folder of json internationalization files, if there is no category
specified, it will map to a default category. Something like this
would make the translations reutilization easier.
Greetings.
El 26/4/19 a las 1:53 a.m., Massimo Di Pierro escribió:
web3py now uses this:
https://pypi.org/project/pluralize/
<https://pypi.org/project/pluralize/>
https://github.com/web2py/pluralize
<https://github.com/web2py/pluralize>
thoughts? comments?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
<http://github.com/web2py/web2py> (Source code)
- https://code.google.com/p/web2py/issues/list
<https://code.google.com/p/web2py/issues/list> (Report Issues)
---
You received this message because you are subscribed to the
Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to web2py+unsubscr...@googlegroups.com
<mailto:web2py+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to web2py+unsubscr...@googlegroups.com
<mailto:web2py+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.