summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/config.py
Commit message (Collapse)AuthorAgeFilesLines
* ticket 1669 - improve i18n docstring extractionJohn Dennis2011-08-241-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reverts the use of pygettext for i18n string extraction. It was originally introduced because the help documentation for commands are in the class docstring and module docstring. Docstrings are a Python construct whereby any string which immediately follows a class declaration, function/method declaration or appears first in a module is taken to be the documentation for that object. Python automatically assigns that string to the __doc__ variable associated with the object. Explicitly assigning to the __doc__ variable is equivalent and permitted. We mark strings in the source for i18n translation by embedding them in _() or ngettext(). Specialized extraction tools (e.g. xgettext) scan the source code looking for strings with those markers and extracts the string for inclusion in a translation catalog. It was mistakingly assumed one could not mark for translation Python docstrings. Since some docstrings are vital for our command help system some method had to be devised to extract docstrings for the translation catalog. pygettext has the ability to locate and extract docstrings and it was introduced to acquire the documentation for our commands located in module and class docstrings. However pygettext was too large a hammer for this task, it lacked any fined grained ability to extract only the docstrings we were interested in. In practice it extracted EVERY docstring in each file it was presented with. This caused a large number strings to be extracted for translation which had no reason to be translated, the string might have been internal code documentation never meant to be seen by users. Often the superfluous docstrings were long, complex and likely difficult to translate. This placed an unnecessary burden on our volunteer translators. Instead what is needed is some method to extract only those strings intended for translation. We already have such a mechanism and it is already widely used, namely wrapping strings intended for translation in calls to _() or _negettext(), i.e. marking a string for i18n translation. Thus the solution to the docstring translation problem is to mark the docstrings exactly as we have been doing, it only requires that instead of a bare Python docstring we instead assign the marked string to the __doc__ variable. Using the hypothetical class foo as an example. class foo(Command): ''' The foo command takes out the garbage. ''' Would become: class foo(Command): __doc__ = _('The foo command takes out the garbage.') But which docstrings need to be marked for translation? The makeapi tool knows how to iterate over every command in our public API. It was extended to validate every command's documentation and report if any documentation is missing or not marked for translation. That information was then used to identify each docstring in the code which needed to be transformed. In summary what this patch does is: * Remove the use of pygettext (modification to install/po/Makefile.in) * Replace every docstring with an explicit assignment to __doc__ where the rhs of the assignment is an i18n marking function. * Single line docstrings appearing in multi-line string literals (e.g. ''' or """) were replaced with single line string literals because the multi-line literals were introducing unnecessary whitespace and newlines in the string extracted for translation. For example: ''' The foo command takes out the garbage. ''' Would appear in the translation catalog as: "\n The foo command takes out the garbage.\n " The superfluous whitespace and newlines are confusing to translators and requires us to strip leading and trailing whitespace from the translation at run time. * Import statements were moved from below the docstring to above it. This was necessary because the i18n markers are imported functions and must be available before the the doc is parsed. Technically only the import of the i18n markers had to appear before the doc but stylistically it's better to keep all the imports together. * It was observed during the docstring editing process that the command documentation was inconsistent with respect to the use of periods to terminate a sentence. Some doc had a trailing period, others didn't. Consistency was enforced by adding a period to end of every docstring if one was missing.
* Fixed label capitalizationEndi S. Dewata2011-07-141-1/+1
| | | | | | | | The CSS text-transform sometimes produces incorrect capitalization, so the code has been modified to use translated labels that already contain the correct capitalization. Ticket #1424
* Fixed object_name and object_name_plural internationalizationEndi S. Dewata2011-07-121-1/+1
| | | | | | | | | The object_name, object_name_plural and messages that use these attributes have been converted to support translation. The label attribute in the Param class has been modified to accept unicode string. Ticket #1435
* password expiration labelAdam Young2011-07-051-1/+1
|
* Add pwd expiration notif (ipapwdexpadvnotify) to config plugin def attr listRob Crittenden2011-07-051-0/+1
| | | | https://fedorahosted.org/freeipa/ticket/1416
* config widgets entity select default group checkbox for migrationAdam Young2011-06-301-1/+1
|
* Added singular entity labels.Endi S. Dewata2011-06-271-0/+1
| | | | | | | | | | | | | | | A new attribute label_singular has been added to all entities which contains the singular form of the entity label in lower cases except for acronyms (e.g. HBAC) or proper nouns (e.g. Kerberos). In the Web UI, this label can be capitalized using CSS text-transform. The existing 'label' attribute is intentionally left unchanged due to inconsistencies in the current values. It contains mostly the plural form of capitalized entity label, but some are singular. Also, it seems currently there is no comparable capitalization method on the server-side. So more work is needed before the label can be changed. Ticket #1249
* Fix style and grammatical issues in built-in command help.Rob Crittenden2011-03-041-22/+22
| | | | | | | There is a rather large API.txt change but it is only due to changes in the doc string in parameters. ticket 729
* Update config doc to reflect that 0 is not allowed for search time limit.Pavel Zuna2011-02-101-2/+2
| | | | Fix #837
* Raise ValidationError when adding unallowed attribute to search fields.Pavel Zuna2011-01-261-0/+16
| | | | Ticket #845
* python-ldap fails gloriously if the search time limit is 0. Don't allow it.Rob Crittenden2011-01-141-1/+7
| | | | | | | | | Don't allow the time limit to be set in the API. Also add a failsafe in the ldap driver because such bad things happen if this value is 0. I think it literally spends 0 time on the request and just returns immediately. ticket 752
* Change FreeIPA license to GPLv3+Jakub Hrozek2010-12-201-5/+5
| | | | | | | | | | The changes include: * Change license blobs in source files to mention GPLv3+ not GPLv2 only * Add GPLv3+ license text * Package COPYING not LICENSE as the license blobs (even the old ones) mention COPYING specifically, it is also more common, I think https://fedorahosted.org/freeipa/ticket/239
* Set labels on all attributes in the config object.Rob Crittenden2010-12-101-1/+35
| | | | | | | Make the cert subject base read-only. This is here only so replicated servers know their base. ticket 466
* Fix default attributes in config plugin (ipadefaultemaildomain).Pavel Zuna2010-12-071-1/+1
| | | | Ticket #573
* Add new parameter type IA5Str and use this to enforce the right charset.Rob Crittenden2010-12-071-4/+4
| | | | ticket 496
* Check if the group existsJan Zeleny2010-12-061-0/+6
| | | | | | | | When setting default group, we should check if the group exists. If not, it could lead to some issues with adding new users after the new default group is set. https://fedorahosted.org/freeipa/ticket/504
* Document that the default group has to existJan Zeleny2010-12-061-1/+2
| | | | | | | | | After calling ipa config --defaultgroup=xxx with nonexistent group xxx, the result will be that no new user can be added. The operation will always fail in the middle because it is not possible to add the new user to desired default group. https://bugzilla.redhat.com/show_bug.cgi?id=654117#c4
* I18N for webAdam Young2010-09-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Performing I18N completely on the server, to leverage the existing gettext architecture. Also, the browser does not have access to the Language header. Added the additional po files for a set of required languages conflict with install/static/ipa.js was resolved. Note that the addition of the .po files in this patch is necessary. In order to get Transifex support, we need to update the LINGUAS file with the languages for which we want support. If we don't add the .po files in, they get automatically generated by the rpmbuild process. Our implementation of gettext has a bug in it (It might be F13 thing) where the the Plurals line is not getting correctly transformed, which causes a build failure. However, since the RPM would have the .po files anyway, we should revision control the ones we have, even if they are empty. Fixed the Bug reporting url to the original value. Corrected the Chartype encoding for UK
* Update command documentation based on feedback from docs team.Rob Crittenden2010-08-271-7/+7
| | | | ticket #158
* First pass at per-command documentationRob Crittenden2010-06-221-2/+33
|
* localize doc stringsJohn Dennis2010-03-081-1/+1
| | | | | | | | | | | | A number of doc strings were not localized, wrap them in _(). Some messages were not localized, wrap them in _() Fix a couple of failing tests: The method name in RPC should not be unicode. The doc attribute must use the .msg attribute for comparison. Also clean up imports of _() The import should come from ipalib or ipalib.text, not ugettext from request.
* Code cleanup: remove unused stuff, take 1.Pavel Zuna2010-03-011-13/+0
|
* Translatable Param.label, Param.docJason Gerard DeRose2010-02-241-21/+20
|
* Fix merge error, variable mis-named label instead of docRob Crittenden2010-01-211-1/+1
|
* User-defined certificate subjectsRob Crittenden2010-01-201-1/+17
| | | | | | | | | | | | | | | Let the user, upon installation, set the certificate subject base for the dogtag CA. Certificate requests will automatically be given this subject base, regardless of what is in the CSR. The selfsign plugin does not currently support this dynamic name re-assignment and will reject any incoming requests that don't conform to the subject base. The certificate subject base is stored in cn=ipaconfig but it does NOT dynamically update the configuration, for dogtag at least. The file /var/lib/pki-ca/profiles/ca/caIPAserviceCert.cfg would need to be updated and pki-cad restarted.
* Add --enable-migration option in config plugin.Pavel Zuna2010-01-201-1/+14
|
* Make the config plugin use baseldap classes.Pavel Zuna2009-10-051-103/+33
|
* Remove outstanding 2's from plugins.Pavel Zuna2009-07-021-2/+2
|
* Rename *-create/*-delete commands to *-add/*-del respectively.Pavel Zuna2009-07-021-1/+1
|
* Rename plugins2 files (remove '2' suffix').Pavel Zuna2009-07-021-0/+183