Fix i18n issues with the diff viewer.

Review Request #4454 — Created Aug. 14, 2013 and submitted

Information

Review Board
master

Reviewers

Fix i18n issues with the diff viewer.

The diff viewer had several small issues which caused problems with i18n:
- Because the diff chunks can contain localizable strings, we need to make sure
  that we don't show someone cached data from when it was rendered in a
  different language. Add the language name to the cache keys.
- The "New File" and "New Change" strings used for the revisions on the right
  hand side were using _() at the top level of the file, which performed the
  localization when the file was evaluated. This meant we'd localize them to
  whatever LANGUAGE_CODE was set to.
- A few strings in diffutils.py weren't marked for translation.
- The "<n> lines" items in the expand blocks weren't properly marked for
  translation.
- Verified that we were using the correct cache keys.
- Tested changing my language at runtime and reloading and saw that the diff
  entries were rendered in other languages.
- Verified that the generated message catalogs contained a proper pluralized
  message extraction for "<n> lines".
Description From Last Updated

Might as well combine this into one statement.

chipx86chipx86

Add back the AJAX_SERIAL. That's actually still used for things. It's based on the templates, and guarantees that if a …

chipx86chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/diffviewer/renderers.py
        reviewboard/diffviewer/chunk_generator.py
        reviewboard/diffviewer/diffutils.py
      Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/diffviewer/renderers.py
        reviewboard/diffviewer/chunk_generator.py
        reviewboard/diffviewer/diffutils.py
      Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
    
    
  2. 
      
chipx86
  1. 
      
  2. reviewboard/diffviewer/renderers.py (Diff revision 1)
     
     
     
     
    Show all issues
    Might as well combine this into one statement.
  3. 
      
david
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/diffviewer/renderers.py
        reviewboard/diffviewer/chunk_generator.py
        reviewboard/diffviewer/diffutils.py
      Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/diffviewer/renderers.py
        reviewboard/diffviewer/chunk_generator.py
        reviewboard/diffviewer/diffutils.py
      Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
    
    
  2. 
      
david
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/diffviewer/renderers.py
        reviewboard/diffviewer/chunk_generator.py
        reviewboard/diffviewer/diffutils.py
      Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/diffviewer/renderers.py
        reviewboard/diffviewer/chunk_generator.py
        reviewboard/diffviewer/diffutils.py
      Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues
    Add back the AJAX_SERIAL. That's actually still used for things. It's based on the templates, and guarantees that if a template changes, the cache key will become invalid.
    1. Sorry, I thought I was at the other file. Nevermind!
  3. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (3b45579).