WordPress.org

Make WordPress Core

Ticket #188: 0000188-default-lang-full.diff

File 0000188-default-lang-full.diff, 10.9 KB (added by Kitten, 14 years ago)
  • index.php

    RCS file: /cvsroot/cafelog/wordpress/index.php,v
    retrieving revision 1.78
    diff -u -3 -r1.78 index.php
     
    33require('./wp-blog-header.php');
    44?>
    55<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    6 <html xmlns="http://www.w3.org/1999/xhtml">
     6<html xmlns="http://www.w3.org/1999/xhtml"  <?php blog_language(); ?>>
    77
    88<head profile="http://gmpg.org/xfn/1">
    99        <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
     
    3939         <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    4040        <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    4141       
    42         <div class="storycontent">
     42        <div class="storycontent" <?php the_language() ?>>
    4343                <?php the_content(); ?>
    4444        </div>
    4545       
  • wp-admin/edit-form-advanced.php

    RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-form-advanced.php,v
    retrieving revision 1.28
    diff -u -3 -r1.28 edit-form-advanced.php
     
    4646$saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="' . __('Save and Continue Editing') . '" />';
    4747
    4848if (empty($post_status)) $post_status = 'draft';
     49if (empty($post_language)) $post_language = get_settings('default_blog_language');
    4950
    5051?>
    5152
     
    9394<legend><?php _e('Post Slug') ?></legend>
    9495<div><input name="post_name" type="text" size="17" id="post_name" value="<?php echo $post_name ?>" /></div>
    9596</fieldset>
     97<div style="clear:both">
    9698    <fieldset id="postpassworddiv">
    9799      <legend><a href="http://wordpress.org/docs/reference/post/#post_password" title="<?php _e('Help on post password') ?>"><?php _e('Post Password') ?></a></legend>
    98100          <div><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post_password ?>" /></div>
    99101    </fieldset>
    100 
     102    <fieldset id="postlanguagediv">
     103      <legend><a href="http://wordpress.org/docs/reference/post/#post_language" title="<?php _e('Help on post Language') ?>"><?php _e('Post Language') ?></a></legend>
     104          <div><input name="post_language" type="text" size="2" maxlength="2" id="post_language" value="<?php echo $post_language ?>" /></div>
     105    </fieldset>
     106</div>
    101107<br />
    102108<fieldset style="clear:both">
    103109<legend><a href="http://wordpress.org/docs/reference/post/#excerpt" title="<?php _e('Help with excerpts') ?>"><?php _e('Excerpt') ?></a></legend>
  • wp-admin/options-writing.php

    RCS file: /cvsroot/cafelog/wordpress/wp-admin/options-writing.php,v
    retrieving revision 1.21
    diff -u -3 -r1.21 options-writing.php
     
    4848  <h2>Writing Options</h2>
    4949  <form name="form1" method="post" action="options.php">
    5050    <input type="hidden" name="action" value="update" />
    51     <input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category', 'default_email_category'" />
     51    <input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category', 'default_email_category', 'default_blog_language'" />
    5252    <table width="100%" cellspacing="2" cellpadding="5" class="editform">
    5353      <tr valign="top">
    5454        <th scope="row"> <?php _e('When starting a post, show:') ?> </th>
     
    8787?>
    8888                        </select></td>
    8989                </tr>
     90                <tr valign="top">
     91                        <th scope="row"><?php _e('Default blog language:') ?></th>
     92                        <td><input name="default_blog_language" id="default_blog_language" value="<?php echo get_settings('default_blog_language') ?>" size="2" maxlength="2" /> <a href="http://www.oasis-open.org/cover/iso639a.html"><?php _e('Lookup your language code.')?></a>
     93                        </td>
     94                <tr>
    9095    </table>
    9196    <fieldset class="options">
    9297        <legend><?php _e('Update Services') ?></legend>
  • wp-admin/post.php

    RCS file: /cvsroot/cafelog/wordpress/wp-admin/post.php,v
    retrieving revision 1.70
    diff -u -3 -r1.70 post.php
     
    7171                $ping_status = $_POST['ping_status'];
    7272                if (empty($ping_status)) $ping_status = get_settings('default_ping_status');
    7373                $post_password = $_POST['post_password'];
     74                if (empty($post_language)) $post_language = get_settings('default_blog_language');
    7475               
    7576                if (empty($post_name))
    7677                        $post_name = sanitize_title($post_title, $post_ID);
     
    111112
    112113        if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
    113114        $postquery ="INSERT INTO $wpdb->posts
    114                         (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)
     115                        (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt,  post_status, comment_status, ping_status, post_password, post_language, post_name, to_ping, post_modified, post_modified_gmt)
    115116                        VALUES
    116                         ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
     117                        ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_language', '$post_name', '$trackback', '$now', '$now_gmt')
    117118                        ";
    118119        } else {
    119120        $postquery ="INSERT INTO $wpdb->posts
    120                         (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)
     121                        (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_language, post_name, to_ping, post_modified, post_modified_gmt)
    121122                        VALUES
    122                         ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
     123                        ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_language', '$post_name', '$trackback', '$now', '$now_gmt')
    123124                        ";
    124125        }
    125126
     
    229230                $comment_status = $postdata->comment_status;
    230231                $ping_status = $postdata->ping_status;
    231232                $post_password = $postdata->post_password;
     233                $post_language = $postdata->post_language;
    232234                $to_ping = $postdata->to_ping;
    233235                $pinged = $postdata->pinged;
    234236                $post_name = $postdata->post_name;
     
    302304                if (empty($ping_status)) $ping_status = 'closed';
    303305                //if (!$_POST['ping_status']) $ping_status = get_settings('default_ping_status');
    304306                $post_password = $_POST['post_password'];
     307                $post_language = $_POST['post_language'];
    305308                $post_name = sanitize_title($_POST['post_name'], $post_ID);
    306309                if (empty($post_name)) $post_name = sanitize_title($post_title);
    307310                $trackback = $_POST['trackback_url'];
     
    357360                        comment_status = '$comment_status',
    358361                        ping_status = '$ping_status',
    359362                        post_password = '$post_password',
     363                        post_language = '$post_language',
    360364                        post_name = '$post_name',
    361365                        to_ping = '$trackback',
    362366                        post_modified = '$now',
  • wp-admin/upgrade-functions.php

    RCS file: /cvsroot/cafelog/wordpress/wp-admin/upgrade-functions.php,v
    retrieving revision 1.64
    diff -u -3 -r1.64 upgrade-functions.php
     
    877877        $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_description, option_admin_level) VALUES('default_email_category', 1, '1', 'by default posts by email will have this category', 8)");
    878878    }
    879879
     880        if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'default_blog_language'")) {
     881        $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_description, option_admin_level) VALUES('default_blog_language', 1, 'en', 'by default this will identify the language of your blog', 8)");
     882    }
     883       
     884        maybe_add_column($wpdb->posts, 'post_language', "ALTER TABLE `$wpdb->posts` ADD `post_language` VARCHAR( 2 ) DEFAULT 'en' NOT NULL ;");
     885       
    880886        if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'recently_edited'")) {
    881887        $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('recently_edited', 3, '', 8)");
    882888    }
  • wp-admin/wp-admin.css

    RCS file: /cvsroot/cafelog/wordpress/wp-admin/wp-admin.css,v
    retrieving revision 1.58
    diff -u -3 -r1.58 wp-admin.css
     
    426426        width: 10.4em;
    427427}
    428428
    429 #titlediv, #poststatusdiv, #commentstatusdiv, #slugdiv, #postpassworddiv, #namediv, #uridiv, #emaildiv {
     429#titlediv, #poststatusdiv, #commentstatusdiv, #slugdiv, #postpassworddiv, #postlanguagediv, #namediv, #uridiv, #emaildiv {
    430430        float: left;
    431431        height: 6em;
    432432        margin-right: 5px;
  • wp-includes/functions.php

    RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
    retrieving revision 1.133
    diff -u -3 -r1.133 functions.php
     
    18651865    return $wp_query_state->home;
    18661866}
    18671867
     1868function blog_language() {
     1869        $lang = get_settings('default_blog_language');
     1870        // This is for XHTML 1.0:
     1871        echo 'lang="'.$lang.'" xml:lang="'.$lang.'"';
     1872        // This is for XHTML 1.1:
     1873        //      echo 'xml:lang="'.$lang.'"';
     1874}
     1875function the_language() {
     1876        global $post;
     1877        echo 'lang="'.$post->post_language.'"';
     1878}
    18681879?>
     1880 No newline at end of file