Options for spell checking

Review Request #2160 — Created Feb. 25, 2011 and discarded

Information

Review Board
spell_checking

Reviewers

Users can choose to have spell-checking feature or not.
If either the site or the account choose not to have the feature, the checking will be omitted.
Languages for the checking language can be picked for the site.
(The list should be improved later to change with the installation on the server machine)

 
DO
DO
chipx86
  1. 
      
  2. reviewboard/admin/checks.py (Diff revision 2)
     
     
     
     
     
     
     
     
    I think you can do:
    
    if parse_version(enchant.__version__) >= parse_version("1.6.5"):
    
    You'll need to import parse_version near the top:
    
    from pkg_resources import parse_version.
  3. reviewboard/admin/checks.py (Diff revision 2)
     
     
     
    Use parens for multi-line conditionals instead of \
  4. reviewboard/admin/checks.py (Diff revision 2)
     
     
    PyEnchant I think?
  5. reviewboard/admin/checks.py (Diff revision 2)
     
     
     
    It'd actually be nice to pull all the required version parts out into one place so we only have a single place to update the version we need. Same with the checks above.
  6. reviewboard/admin/checks.py (Diff revision 2)
     
     
    PyEnchant?
  7. reviewboard/admin/forms.py (Diff revision 2)
     
     
     
     
     
    I think what I'd prefer is that in the import above, you set has_spell_checking to True or False based on whether the import succeeded, and then create LANGUAGE_CHOICES conditionally based on that.
    
    Also, no space between the opening parens.
  8. reviewboard/admin/forms.py (Diff revision 2)
     
     
    This will fail if spell checking isn't available. We may need to set LANGUAGE_CHOICES above to an empty tuple if we don't have spell checking.
  9. reviewboard/diffviewer/filters.py (Diff revision 2)
     
     
     
     
    Alphabetical order. djblets should come first.
  10. reviewboard/diffviewer/filters.py (Diff revision 2)
     
     
     
     
     
    So this is kind of an interesting issue.
    
    If the user changes the language, this code won't know about it. It'll keep using the old one. We need to therefore have this somewhat conditional.
    
    So what I'd suggest is storing spell_checker and language as variables, but default them to None.
    
    Then when you need to use spell_checker, compare the current language set in siteconfig to the last stored one. If it changed, replace spell_checker.
  11. reviewboard/diffviewer/filters.py (Diff revision 2)
     
     
     
     
    Two blank lines.
  12. 
      
DO
DO
Review request changed
Status:
Discarded