Opened 20 years ago
Closed 20 years ago
#188 closed enhancement (wontfix)
Add default language attributes to HTML tag.
Reported by: | Kitten | Owned by: | matt |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
This patch adds the language attributes to the HTML tag and provides a option on the options-writing page for easy setting of the language attribute.
See: http://diveintomark.org/archives/2002/06/18/day_7_identifying_your_language for more info.
Attachments (3)
Change History (5)
Note: See
TracTickets for help on using
tickets.
default-lang-full.diff
This is a revision of my earlier patch. It adds the default language information to the blog, but also adds a per-post default language setting.
I think this is a simple and complete solution that should be rolled into 1.3 for multi-language support. I think this is important enough to be part of the WP core, and shouldn't be left to a plugin.
If there's interest, I'll prepare a patch file for v1.2. Just ask.
If anyone is interesting in applying this patch, (Linux instructions) cd to your wordpress folder (current CVS only), then type the command:
patch -p0 < /path/to/.diff/file
And you should see a report of the following files patched:
-index.php
Adds template tags for default language, and post language.
-wp-admin/edit-form-advanced.php
Adds the editing box for the per-post language.
-wp-admin/options-writing.php
Adds the admin editing box for setting the default blog language.
-wp-admin/post.php
Adds the necessary code so that the per-post language can be saved.
-wp-admin/upgrade-functions.php
Adds the code to add the default option, and the column to the posts table to store the language. DB default is English.
-wp-admin/wp-admin.css
Changes so that the 'Post Language' box looks the same as the others.
-wp-includes/functions.php
Adds function 'blog_language()' for displaying the default language in the <HTML> tag. A XHTML 1.1 compatible output is commented out for future use.
Adds function 'the_language()' for adding language info to the storycontent div.
Examples:
Old index.php:
<html xmlns="http://www.w3.org/1999/xhtml">
<div class="storycontent">
New index.php:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<div class="storycontent" lang="fr">