# HG changeset patch # User Sandrine Ribeau # Date 1226949393 28800 # Node ID 22665a052a31efb231dbd7e669bc74b332c038e4 # Parent a51d045a2e838f4ec15773cb594d0f36e05aeaf4# Parent f5886815126b67d2623d3c06150e036fd80aeef2 merge diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/03-sect-definition-schema.en.txt --- a/doc/book/en/03-sect-definition-schema.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/03-sect-definition-schema.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -21,10 +21,10 @@ * the name of the Python attribute corresponds to the name of the attribute or the relation in `LAX` application. -* all built-in types are available : `String`, `Int`, `Float`, +* all built-in types are available: `String`, `Int`, `Float`, `Boolean`, `Date`, `Datetime`, `Time`, `Byte`. -* each entity has at least the following meta-relations : +* each entity has at least the following meta-relations: - `eid` (`Int`) @@ -44,13 +44,13 @@ instead of `SubjectRelation` * the first argument of `SubjectRelation` and `ObjectRelation` gives respectively - the object/subject entity type of the relation. This could be : + the object/subject entity type of the relation. This could be: * a string corresponding to an entity type * a tuple of string correponding to multiple entities types - * special string such as follows : + * special string such as follows: - "**" : all types of entities - "*" : all types of entities non meta @@ -60,7 +60,7 @@ * it is possible to use the attribute `meta` to flag an entity type as a `meta` (e.g. used to describe/categorize other entities) -* optional properties for attributes and relations : +* optional properties for attributes and relations: - `description` : string describing an attribute or a relation. By default this string will be used in the editing form of the entity, which means @@ -75,7 +75,7 @@ the subject, the second on the object of the relation. When a relation has multiple possible subjects or objects, the cardinality applies to all and not on a one to one basis (so it must be consistent...). The possible - values are inspired from regular expressions syntax : + values are inspired from regular expressions syntax: * `1`: 1..1 * `?`: 0..1 @@ -85,7 +85,7 @@ - `meta` : boolean indicating that the relation is a meta-relation (false by default) -* optionnal properties for attributes : +* optionnal properties for attributes: - `required` : boolean indicating if the attribute is required (false by default) @@ -102,7 +102,7 @@ - `vocabulary` : specify static possible values of an attribute -* optionnal properties of type `String` : +* optionnal properties of type `String`: - `fulltextindexed` : boolean indicating if the attribute is part of the full text index (false by default) (*applicable on the type `Byte` @@ -113,7 +113,7 @@ - `maxsize` : integer providing the maximum size of the string (no limit by default) -* optionnal properties for relations : +* optionnal properties for relations: - `composite` : string indicating that the subject (composite == 'subject') is composed of the objects of the relations. For the opposite case (when @@ -124,7 +124,7 @@ Contraints `````````` -By default, the available constraints types are : +By default, the available constraints types are: * `SizeConstraint` : allows to specify a minimum and/or maximum size on string (generic case of `maxsize`) @@ -166,7 +166,7 @@ object = 'EUser' In addition to the permissions, the own properties of the relation types -(shared also by all definition of relation of this type) are : +(shared also by all definition of relation of this type) are: * `inlined` : boolean handling the physical optimization for archiving @@ -202,7 +202,7 @@ provided once the user is in the listed groups or one of the RQL condition is satisfied. -The standard groups are : +The standard groups are: * `guests` @@ -222,7 +222,7 @@ It is possible to define RQL expression to provide update permission (`add`, `delete` and `update`) on relation and entity types. -RQL expression for entity type permission : +RQL expression for entity type permission: * you have to use the class `ERQLExpression` @@ -239,7 +239,7 @@ to this variable For RQL expressions on a relation type, the principles are the same except -for the following : +for the following: * you have to use the class `RQLExpression` in the case of a non-final relation [WHAT IS A NON FINALE RELATION] @@ -249,7 +249,7 @@ which the action is being verified) and the user who executed the query * we can also defined rights on attributes of an entity (non-final relation), - knowing that : + knowing that: - to defines RQL expression, we have to use the class `ERQLExpression` in which X represents the entity the attribute belongs to @@ -261,7 +261,7 @@ In addition to thatm the entity type `EPermission` from the standard library allow to build very complex and dynamic security architecture. The schema of -this entity type is as follow : :: +this entity type is as follow: :: class EPermission(MetaEntityType): """entity type that may be used to construct some advanced security configuration @@ -308,7 +308,7 @@ This configuration assumes/indicates [???] that an entity `EPermission` named "add_version" can be associated to a project and provides rights to create -new versions on this project to specific groups. It is important to notice that : +new versions on this project to specific groups. It is important to notice that: * in such case, we have to protect both the entity type "Version" and the relation associating a version to a project ("version_of") @@ -321,7 +321,7 @@ Use of RQL expression for reading rights ```````````````````````````````````````` -The principles are the same but with the following restrictions : +The principles are the same but with the following restrictions: * we can not [??] `RRQLExpression` on relation types for reading diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/03-sect-stdlib-schemas.en.txt --- a/doc/book/en/03-sect-stdlib-schemas.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/03-sect-stdlib-schemas.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -20,7 +20,7 @@ ``entities/`` deifnes the methods you might need on the entities you defined in your schema. -The system entities available are : +The system entities available are: * `EUser`, system users * `EGroup`, users groups @@ -50,7 +50,7 @@ ./myapp/ginco-apps/ An application is based on several basic components. In the set of available -basic components we can find by example : +basic components we can find by example: * `ecomment`, provides an entity type for `Comment` allowing us to comment others site's entities diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/04-develop-views.en.txt --- a/doc/book/en/04-develop-views.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/04-develop-views.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -14,7 +14,7 @@ The selection/view principle ---------------------------- -With `LAX`, views are defined by Python classes. A view includes : +With `LAX`, views are defined by Python classes. A view includes: - an identifier (all objects in `LAX` are entered in a registry and this identifier will be used as a key) @@ -54,7 +54,7 @@ The view has a ``self.w()`` method that is used to output data. Here `lines 09-12` output HTML tags and values of the entity's attributes. -When displaying same blog entry as before, you will notice that the +When displaying same blog entries as before, you will notice that the page is now looking much nicer. .. image:: images/lax-book.09-new-view-blogentry.en.png diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/05-components.en.txt --- a/doc/book/en/05-components.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/05-components.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -24,7 +24,7 @@ ``lax-0.4``, you should get a set of application entities and system entities you can re-use. -The available application entities are : +The available application entities are: * addressbook: PhoneNumber and PostalAddress @@ -51,7 +51,7 @@ * ezone: Zone (to define places within larger places, for example a city in a state in a country) -The available system entities are : +The available system entities are: * ecomment: Comment (to attach comment threads to entities) @@ -65,7 +65,7 @@ included-yams-components=ecomment -Will make the ``Comment`` entity available in your ``BlogDemo`` +will make the ``Comment`` entity available in your ``BlogDemo`` application. Change the schema to add a relationship between ``BlogEntry`` and @@ -81,7 +81,7 @@ Component structure ------------------- -A complex component is structured as follows : +A complex component is structured as follows: :: mycomponent/ @@ -108,7 +108,7 @@ | \-- __pkginfo__.py -We can also define simple Python module instead of directories (packages), for example : +We can also define simple Python module instead of directories (packages), for example: :: mycomponent/ @@ -118,7 +118,7 @@ \-- views.py -where : +where: * ``schema`` contains the definition of the schema (server side only) * ``entities`` contains entities definition (server side and web interface) @@ -138,7 +138,7 @@ and the current version(server side and web interface) or sub-components used by the component. -At least you should have : +At least you should have: * the file ``__pkginfo__.py`` * schema definition diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/06-maintemplate.en.txt --- a/doc/book/en/06-maintemplate.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/06-maintemplate.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -7,7 +7,7 @@ Look at ``lax/skel/ginco/web/views/basetemplates.py`` and you will find the base templates used to generate HTML for your application. -A page is composed as indicated on the schema below : +A page is composed as indicated on the schema below: .. image:: images/lax-book.06-main-template-layout.en.png @@ -49,7 +49,7 @@ rendered by ``TheMainTemplate``, we will show how to do it in TheMainTemplate_. First, to remove the login menu, we just need to comment out the display of the -login component such as follows : :: +login component such as follows: :: class MyHTMLPageHeader(HTMLPageHeader): @@ -152,7 +152,7 @@ -------------- If you want to change the footer for example, look -for HTMLPageFooter and override it in your views file as in : +for HTMLPageFooter and override it in your views file as in: :: form ginco.web.views.basetemplates import HTMLPageFooter diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/08-rql.en.txt --- a/doc/book/en/08-rql.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/08-rql.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -1,7 +1,7 @@ .. -*- coding: utf-8 -*- RQL language (Relation Query Language) -======================================== +====================================== Introduction ------------ @@ -102,16 +102,16 @@ Advanced features ````````````````` -* Aggregate functions : `COUNT`, `MIN`, `MAX`, `SUM`. -* String functions :`UPPER`, `LOWER`. -* Optional relations : +* Aggregate functions: `COUNT`, `MIN`, `MAX`, `SUM`. +* String functions:`UPPER`, `LOWER`. +* Optional relations: * They allow to select entities related to others or not. * You should use `?` behind the variable to specify the relation to itself is optional. - - Project anomalies related to a version or not :: + - Project anomalies related to a version or not:: Any X,V WHERE X concerns P, P eid 42, X corrected_in V? diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/11-definition-workflow.en.txt --- a/doc/book/en/11-definition-workflow.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/11-definition-workflow.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -40,4 +40,4 @@ [Create a simple workflow for BlogDemo, to have a moderator approve new blog entry to be published. This implies, specify a dedicated group of blog moderator as well as hide the view of a blog entry to the user until -it reaches the state published] +it reaches the published state.] diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/12-internationalization.en.txt --- a/doc/book/en/12-internationalization.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/12-internationalization.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -6,68 +6,95 @@ Internationalization ==================== -The internationalization +Cubicweb fully supports the internalization of it's content and interface. -Le système d'internationalisation de l'interface web d'erudi est basé sur le -système `GNU gettext`_. +Cubicweb's interface internationalization is based on the translation project `GNU gettext`_. .. _`GNU gettext`: http://www.gnu.org/software/gettext/ -Messages à internationaliser ----------------------------- +Cubicweb' internalization involves two steps: + +* in your Python code and cubicweb-tal templates : mark translatable strings + +* in your application : handle the translation catalog + +String internalization +---------------------- -Marquage des messages à internaliser -```````````````````````````````````` -Les chaines de caractères à internationaliser sont marqués par l'appel à la -fonction `_` *OU* par la méthode équivalent de la requête dans le code python ou -dans les expressions python de template TAL. +In the Python code and cubicweb-tal templates translatable strings can be +marked in one of the following ways : + + * by using the *built-in* function `_` :: + + class PrimaryView(EntityView): + """the full view of an non final entity""" + id = 'primary' + title = _('primary') + + OR -Dans les templates erudi-tal, il est également possible d'insérer une chaine à -traduire via les balises `i18n:content` et `i18n:replace`. - -De plus des messages correspondant aux entités/relations utilisés par le schéma -de l'application seront automatiquement ajoutés. + * by using the equivalent request's method :: + + class NoResultView(EmptyRsetView): + """default view when no result has been found""" + id = 'noresult' + + def call(self, **kwargs): + self.w(u'
%s
\n' + % self.req._('No result matching query')) -Renvoi d'un message internationalisé lors de la construction d'une page -``````````````````````````````````````````````````````````````````````` -La fonction *built-in* `_` ne doit servir qu'**à marquer les messages à -traduire**, non pas à récupérer une traduction. Il faut pour cela utiliser la -méthode `_` de l'objet requête, sans quoi vous récupérerez l'identifiant de -message au lieu de sa traduction dans la langue propre à la requête.1 +The goal of the *built-in* function `_` is only **to mark the +translatable strings**, it will only return the translation string +it-self, but not it's translation. + +In the other hand the request's method `_` is ment to retrive the +proper translation of translation strings in the requested language. + +Translations in cubicweb-tal template can also be done with TAL tags +`i18n:content` and `i18n:replace`. + +Note :: + + We dont need to mark the translation strings of entities/relations + used by a particular application's schema as they are generated + automatically. -Gestion des catalogues de traduction ------------------------------------- -Une fois l'application rendu internationalisable coté code, reste à gérer les -catalogues de traductions. erudi-ctl intègre pour cela les commandes suivantes : - -* `i18nlibupdate`, met à jour les catalogues de messages *de la librairie - erudi*. Sauf si vous développez sur le framework (et non votre propre - application), vous ne devriez pas avoir à utiliser cette commande +Handle the translation catalog +------------------------------ -* `i18nupdate`, met à jour les catalogues de messages *du composant* (ou de tous - les composants). A la suite de cette commande, vous devez mettre à jour les - fichiers de traduction *.po* dans le sous-répertoire "i18n" de votre - template. Évidemment les traductions précédentes toujours utilisées ont été - conservées. - -* `i18ncompile`, recompile les catalogues de messages *d'une instance* (ou de - toutes les instances) après mise à jour des catalogues de son composant. Cela - est effectué automatiquement lors d'une création ou d'une mise à jour. Les - catalogues de messages compilés se trouvent dans le répertoire - "i18n//LC_MESSAGES/erudi.mo" de l'application où `lang` est - l'identifiant de la langue sur 2 lettres ('en' ou 'fr' par exemple) +Once the internalization is done in your application's code, you need +to populate and update the translation catalog. Cubicweb provides the +following commands for this purpose: -Le cas classique -```````````````` -Vous avez ajouté et/ou modifié des messages d'un composant utilisé par votre -application (en ajoutant une nouvelle vue ou en ayant modifié le schéma par -exemple) : +* `i18nlibupdate` updates Cubicweb framework's translation + catalogs. Unless you work on the framework development, you dont + need to use this command. + +* `i18nupdate` updates the translation catalogs of *one particular + component* (or of all components). FIXME After this command is + executed you must update the translation files *.po* in the "i18n" + directory of your template. This command will of course not remove + existing translations still in use -1. `cubicweb-ctl i18nupdate ` -2. éditer les fichiers /xxx.po dans pour y rajouter les traductions - manquantes (`msgstr` vide) +* `i18ncompile` recompile the transaltion catalogs of *one particular + instance* (or of all instances) after the translation catalogs of + its components have been updated. This command is automatically + called every time you create or update your instance. The compiled + catalogs (*.mo*) are stored in the i18n//LC_MESSAGES of + application where `lang` is the language identifier ('en' or 'fr' + for exemple). + + +Example +``````` +You have added and/or modified some translation strings in your application +(after creating a new view or modifying the application's schema for exemple). +To update the translation catalogs you need to do: + +1. `cubicweb-ctl i18nupdate ` +2. Edit the /xxx.po files and add missing translations (empty `msgstr`) 3. `hg ci -m "updated i18n catalogs"` -4. `cubicweb-ctl i18n compile ` +4. `cubicweb-ctl i18n compile ` diff -r a51d045a2e83 -r 22665a052a31 doc/book/en/tut-create-app.en.txt --- a/doc/book/en/tut-create-app.en.txt Mon Nov 17 11:11:23 2008 -0800 +++ b/doc/book/en/tut-create-app.en.txt Mon Nov 17 11:16:33 2008 -0800 @@ -30,7 +30,7 @@ Let us start with something simple and improve on it iteratively. -In schema.py, we define two entities : ``Blog`` and ``BlogEntry``. +In schema.py, we define two entities: ``Blog`` and ``BlogEntry``. :: @@ -123,7 +123,7 @@ the phrase ``everything about technology``. .. image:: images/lax-book.04-detail-one-blog.en.png - :alt: displaying the detailed view of a blog + :alt: displaying the detailed view of a blog Now get back to the home page by clicking on the top-left logo, then create a new Blog called ``MyLife`` and get back to the home page @@ -183,29 +183,29 @@ ~~~~~~~~~~ This menu provides you a way to adjust some navigation options depending on your needs, such as the number of entities to display by page of results. -Follows the detailled list of available options : +Follows the detailled list of available options: -* navigation.combobox-limit : maximum number of entities to display in related +* navigation.combobox-limit: maximum number of entities to display in related combo box (sample format: 23) -* navigation.page-size : maximum number of objects displayed by page of results +* navigation.page-size: maximum number of objects displayed by page of results (sample format: 23) -* navigation.related-limit : maximum number of related entities to display in +* navigation.related-limit: maximum number of related entities to display in the primary view (sample format: 23) -* navigation.short-line-size : maximum number of characters in short description +* navigation.short-line-size: maximum number of characters in short description (sample format: 23) UI ~~ This menu provides you a way to customize the user interface settings such as date format or encoding in the produced html. -Follows the detailled list of available options : +Follows the detailled list of available options: * ui.date-format : how to format date in the ui ("man strftime" for format description) * ui.datetime-format : how to format date and time in the ui ("man strftime" for format description) * ui.default-text-format : default text format for rich text fields. * ui.encoding : user interface encoding -* ui.fckeditor :should html fields being edited using fckeditor (a HTML WYSIWYG editor). +* ui.fckeditor : should html fields being edited using fckeditor (a HTML WYSIWYG editor). You should also select text/html as default text format to actually get fckeditor. * ui.float-format : how to format float numbers in the ui * ui.language : language of the user interface @@ -222,7 +222,7 @@ available on the left column which display some actions as well as a drop-down menu for more actions. -The context available are : +The context available are: * mainactions : actions listed in the left box * moreactions : actions listed in the `more` menu of the left box @@ -239,7 +239,7 @@ This configuration section allows you to place those boxes where you want in the application interface to customize it. -The available boxes are : +The available boxes are: * actions box : box listing the applicable actions on the displayed data diff -r a51d045a2e83 -r 22665a052a31 doc/book/fr/12-internationalization.fr.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/book/fr/12-internationalization.fr.txt Mon Nov 17 11:16:33 2008 -0800 @@ -0,0 +1,73 @@ +.. -*- coding: utf-8 -*- + +.. _internationalization: + + +Internationalization +==================== + +The internationalization + +Le système d'internationalisation de l'interface web d'erudi est basé sur le +système `GNU gettext`_. + +.. _`GNU gettext`: http://www.gnu.org/software/gettext/ + +Messages à internationaliser +---------------------------- + +Marquage des messages à internaliser +```````````````````````````````````` +Les chaines de caractères à internationaliser sont marqués par l'appel à la +fonction `_` *OU* par la méthode équivalent de la requête dans le code python ou +dans les expressions python de template TAL. + +Dans les templates erudi-tal, il est également possible d'insérer une chaine à +traduire via les balises `i18n:content` et `i18n:replace`. + +De plus des messages correspondant aux entités/relations utilisés par le schéma +de l'application seront automatiquement ajoutés. + +Renvoi d'un message internationalisé lors de la construction d'une page +``````````````````````````````````````````````````````````````````````` +La fonction *built-in* `_` ne doit servir qu'**à marquer les messages à +traduire**, non pas à récupérer une traduction. Il faut pour cela utiliser la +méthode `_` de l'objet requête, sans quoi vous récupérerez l'identifiant de +message au lieu de sa traduction dans la langue propre à la requête.1 + + +Gestion des catalogues de traduction +------------------------------------ +Une fois l'application rendu internationalisable coté code, reste à gérer les +catalogues de traductions. erudi-ctl intègre pour cela les commandes suivantes : + +* `i18nlibupdate`, met à jour les catalogues de messages *de la librairie + erudi*. Sauf si vous développez sur le framework (et non votre propre + application), vous ne devriez pas avoir à utiliser cette commande + +* `i18nupdate`, met à jour les catalogues de messages *du composant* (ou de tous + les composants). A la suite de cette commande, vous devez mettre à jour les + fichiers de traduction *.po* dans le sous-répertoire "i18n" de votre + template. Évidemment les traductions précédentes toujours utilisées ont été + conservées. + +* `i18ncompile`, recompile les catalogues de messages *d'une instance* (ou de + toutes les instances) après mise à jour des catalogues de son composant. Cela + est effectué automatiquement lors d'une création ou d'une mise à jour. Les + catalogues de messages compilés se trouvent dans le répertoire + "i18n//LC_MESSAGES/erudi.mo" de l'application où `lang` est + l'identifiant de la langue ('en' ou 'fr' par exemple). + + +Le cas classique +```````````````` +Vous avez ajouté et/ou modifié des messages d'un composant utilisé par votre +application (en ajoutant une nouvelle vue ou en ayant modifié le schéma par +exemple) : + +1. `cubicweb-ctl i18nupdate ` +2. éditer les fichiers /xxx.po dans pour y rajouter les traductions + manquantes (`msgstr` vide) +3. `hg ci -m "updated i18n catalogs"` +4. `cubicweb-ctl i18n compile ` +