Ok. I did so and worked fine.
I supposed words needed to be included in translation file once, but in
fact, expressions including words has to be included also in the dictionary
as if they were words itself.
I propose this to be included in the manual:
1. expressions including words has to be included also in the dictionary
as if they were words itself
2. you can use '%%{word(%i)}' or '%%{word(%s)}' if you want to use
plural without showing the number that decides the plural form.
There's also an errata: substitute "rules/plural_rules/*.py" with
"gluon/contrib/plural_rules/*.py".
Besides, i propose this to be added to "gluon/contrib/plural_rules/es.py":
# This rule isn't perfect but covers many cases. Complete rules at
http://www.rae.es/dpd/srv/search?id=Iwao8PGQ8D6QkHPn4i.
construct_plural_form = lambda word, plural_id: (word +
('es' if word[-1:] in ('s', 'x', 'ch', 'y', 'l',
'r', 'n', 'd', 'z', 'j')
else 's'))
By the way, is there a better way to propose modifications to the manual?.
Thank you very much!.
El sábado, 21 de septiembre de 2013 01:23:38 UTC+2, dbdeveloper escribió:
>
> It is not an issue. It's only a small misunderstanding. :)
>
> There are correct steps how to create application with working
> pluralization system:
>
> 1. Create a simple app
> 2. Replace index() at default.py with return T('%s %%{object}', 2,
> language='es')
> 3. Insert into administrative interface, click [Reload routers] (in my
> case it did not appear without this workaround)
> 4. Click [Manage]->[Edit] beside newly created app
> 5. Go to "Languages" section and click [update all languages] to refresh
> language files
> 6. Click [Edit] beside "es.py" language file and find string '%s
> %%{object}'
> 7. Write translation FOR THIS WHOLE STRING '%s %%{objeto}' and click "Save
> changes", then return to previous window by clicking [Edit] menu item on
> the top of the screen
> 8. Return to "Languages" section and click [Edit] beside "Plural-Forms:
> plural-es.py" and add plural form for "objeto" word: "objetos" then click
> "Update" and leave this screen by clicking [Edit] menu item on the top of
> the screen.
> 9. Access app/default/index
>
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.