Code

Changes between Version 9 and Version 10 of UnicodeBranch


Ignore:
Timestamp:
05/14/07 03:57:57 (7 years ago)
Author:
mtredinnick
Comment:

Added list of fixed tickets and gettext->ugettext change.

Legend:

Unmodified
Added
Removed
Modified
  • UnicodeBranch

    v9 v10  
    2828The branch was created on April 7, 2007. 
    2929 
     30Reported bugs from trunk that have been fixed and will be closed once the branch is merged back into trunk can be [http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&keywords=%7Eunicode-branch&order=priority viewed here]. 
     31 
    3032== Todo Items == 
    3133 
     
    4547We also need to look at the i18n support functions (in django.utils.translation): 
    4648 
    47  * Decide on usage of gettext() versus ugettext() in a number of places. 
     49 * Decide on usage of gettext() versus ugettext() in a number of places ('''Done'''. Recommended to use {{{ugettext()}}} and friends everywhere). 
    4850 * Look at rewriting gettext_lazy() so that it acts as a better string and unicode proxy. 
    4951 
     
    5254== Porting Applications (The Quick Checklist) == 
    5355 
    54 One of the design goals of the Unicode branch is that very litte significant changes to existing third-party code should be required. However, there are some thigns that developers should be aware of when writing applications designed to handle international input. 
     56One of the design goals of the Unicode branch is that very litte significant changes to existing third-party code should be required. However, there are some things that developers should be aware of when writing applications designed to handle international input. 
    5557 
    56 A detailed list of things you might wish to think about when writing your code is given below. However, for the programmer on a deadline, here is the cheatsheet version: 
     58A detailed list of things you might wish to think about when writing your code is given below. However, for the programmer on a deadline, here is the cheatsheet version (if you only use ASCII strings, none of these changes are necessary): 
    5759 
    5860 1. Change the {{{__str__}}} methods on your models to be {{{__unicode__}}} methods. Just change the name. Usually, nothing else will be needed. 
     
    6062 2. Look for any {{{str()}}} calls in your code that operate on model fields. These should almost always be changed to {{{smart_unicode()}}} calls (which is imported from {{{django.utils.encoding}}}). 
    6163 
    62  3. Make sure your database can store all the data you will send to it. Usually, this means ensuring it is using UTF-8 (or similar) encoding internally. 
     64 3. Use the unicode versions of the {{{django.utils.translation.*}}} functions. Replace {{{gettext}}} and {{{ngettext}}} with {{{ugettext}}} and {{{ungettext}}} respectively. There are also {{{ugettext_lazy}}} and {{{ungettext_lazy}}} functions if you use the lazy versions. 
    6365 
    64  4. Use the {{{FILE_CHARSET}}} setting if your on-disk template files are not UTF-8 encoded. 
     66 4. Make sure your database can store all the data you will send to it. Usually, this means ensuring it is using UTF-8 (or similar) encoding internally. 
     67 
     68 5. Use the {{{FILE_CHARSET}}} setting if your on-disk template files are not UTF-8 encoded. 
    6569 
    6670That is all. Enjoy!