Changes between Version 9 and Version 10 of UnicodeBranch
- Timestamp:
- May 14, 2007, 5:57:57 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UnicodeBranch
v9 v10 28 28 The branch was created on April 7, 2007. 29 29 30 Reported 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 30 32 == Todo Items == 31 33 … … 45 47 We also need to look at the i18n support functions (in django.utils.translation): 46 48 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). 48 50 * Look at rewriting gettext_lazy() so that it acts as a better string and unicode proxy. 49 51 … … 52 54 == Porting Applications (The Quick Checklist) == 53 55 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 thi gns that developers should be aware of when writing applications designed to handle international input.56 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 things that developers should be aware of when writing applications designed to handle international input. 55 57 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 :58 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 (if you only use ASCII strings, none of these changes are necessary): 57 59 58 60 1. Change the {{{__str__}}} methods on your models to be {{{__unicode__}}} methods. Just change the name. Usually, nothing else will be needed. … … 60 62 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}}}). 61 63 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. 63 65 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. 65 69 66 70 That is all. Enjoy!