Making WordPress.org

Opened 4 weeks ago

Last modified 2 weeks ago

#7824 new defect (bug)

Localized installation packages issues

Reported by: haozi's profile haozi Owned by:
Milestone: Priority: high
Component: International Sites (Rosetta) Keywords:
Cc:

Description

There seems to be some issue with the localized installation packages.

First sign was that the number of installation packages was exactly the same as the number of released translations.

Next the Chinese team noted that their adapted files didn't get included, https://make.wordpress.org/polyglots/2024/11/13/wordpress-6-7-zh_cn-packaging-issues/
then after a discussion on Slack, other teams reported the same issue.

Slack archives:
https://wordpress.slack.com/archives/C02RP50LK/p1731482153067179
https://wordpress.slack.com/archives/C02RP50LK/p1731482693041029

Can anyone here help confirm what the problem is?

Change History (4)

#1 @haozi
4 weeks ago

According to the manual https://make.wordpress.org/polyglots/handbook/for-editors/packaging-localized-wordpress/automated-release-packages/#minor-custom-changes-for-the-current-stable-version description, wp-content/languages/$locale.php file will not be automatically packaged in.

However, the Chinese team uses this file to meet government compliance requirements (These two licenses are required to host a website in mainland China) and provide video embedding for websites in mainland China that do not support oEmbed.

Can Meta team fix this to allow wp-content/languages/$locale.php to be packaged into core (like wp-config-simple.php etc)?

The following is the content of the wp-content/languages/zh_CN.php file created by Chinese team in previous versions:

<?php
/**
 * WordPress 简体中文本地化支持
 *
 * @since 6.5.0
 * @updated 2024-04-13
 */

defined( 'ABSPATH' ) || exit;

/**
 * 哔哩哔哩嵌入
 *
 * @since 6.5.0
 */
function cn_embed_handler_bilibili( $matches, $attr, $url, $rawattr ) {
        $width  = "100%";
        $height = 500;
        if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
                $width  = $rawattr['width'];
                $height = $rawattr['height'];
        }

        $av = $matches['id'];
        $bv = $matches['id'];
        if ( strpos( $matches['id'], 'BV' ) === 0 ) {
                $av = "";
        } else {
                $av = substr( $av, 2 );
                $bv = "";
        }

        $embed = sprintf(
                '<iframe src="//player.bilibili.com/player.html?aid=%1$s&bvid=%2$s&p=1" width="%3$s" height="%4$s" frameborder="0" allowfullscreen></iframe>',
                esc_attr( $av ), esc_attr( $bv ), esc_attr( $width ), esc_attr( $height ) );

        return apply_filters( 'embed_bilibili', $embed, $matches, $attr, $url, $rawattr );
}

wp_embed_register_handler( 'bilibili',
        '#https?://(?:www\.)?bilibili\.com/video/(?<id>[A-Za-z0-9]+)#i',
        'cn_embed_handler_bilibili' );

/**
 * 优酷视频嵌入
 *
 * @since 6.5.0
 */
function cn_embed_handler_youku( $matches, $attr, $url, $rawattr ) {
        $width  = "100%";
        $height = 500;
        if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
                $width  = $rawattr['width'];
                $height = $rawattr['height'];
        }

        $embed = sprintf(
                '<iframe src="//player.youku.com/embed/%1$s" width="%2$s" height="%3$s" frameborder="0" allowfullscreen></iframe>',
                esc_attr( $matches['id'] ), esc_attr( $width ), esc_attr( $height ) );

        return apply_filters( 'embed_youku', $embed, $matches, $attr, $url, $rawattr );
}

wp_embed_register_handler( 'youku',
        '#https?://v\.youku\.com/v_show/id_(?<id>[A-Za-z0-9=]+).html#i',
        'cn_embed_handler_youku' );

/**
 * 腾讯视频嵌入
 *
 * @since 6.5.0
 */
function cn_embed_handler_qq( $matches, $attr, $url, $rawattr ) {
        $width  = "100%";
        $height = 500;
        if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
                $width  = $rawattr['width'];
                $height = $rawattr['height'];
        }

        $embed = sprintf(
                '<iframe src="//v.qq.com/txp/iframe/player.html?vid=%1$s" width="%2$s" height="%3$s" frameborder="0" allowfullscreen></iframe>',
                esc_attr( $matches['id'] ), esc_attr( $width ), esc_attr( $height ) );

        return apply_filters( 'embed_qq', $embed, $matches, $attr, $url, $rawattr );
}

wp_embed_register_handler( 'qq',
        '#https?://v\.qq\.com/x/page/(?<id>[A-Za-z0-9]+)\.html#i',
        'cn_embed_handler_qq' );


/**
 * ICP 备案号及公安备案号
 *
 * 为了遵守电信管理条例。可以在 wp-config.php 中关闭。
 *
 * @since 6.5.0
 */
function cn_settings_init() {
        if ( defined( 'CN_ICP' ) && CN_ICP ) {
                add_settings_field( 'cn_icp',
                        'ICP 备案号',
                        'cn_icp_callback',
                        'general' );
                register_setting( 'general', 'cn_icp' );
        }
        if ( defined( 'CN_GA' ) && CN_GA ) {
                add_settings_field( 'cn_ga',
                        '公安备案号',
                        'cn_ga_callback',
                        'general' );
                register_setting( 'general', 'cn_ga' );
        }
}

add_action( 'admin_init', 'cn_settings_init' );

function cn_icp_callback() {
        echo sprintf(
                '<input name="cn_icp" type="text" id="cn_icp" value="%s" class="regular-text ltr" />' .
                '<p class="description">仅对部分支持的主题生效。</p>',
                esc_attr( get_option( 'cn_icp' ) )
        );
}

function cn_ga_callback() {
        echo sprintf(
                '<input name="cn_ga" type="text" id="cn_ga" value="%s" class="regular-text ltr" />' .
                '<p class="description">仅对部分支持的主题生效(需自行添加公安图标)。</p>',
                esc_attr( get_option( 'cn_ga' ) )
        );
}

// 带链接的 ICP 备案号
function cn_icp(): string {
        if ( defined( 'CN_ICP' ) && CN_ICP &&
             get_option( 'cn_icp' ) ) {
                return sprintf(
                        '<a target="_blank" href="https://beian.miit.gov.cn/" rel="nofollow">%s</a>',
                        esc_attr( get_option( 'cn_icp' ) )
                );
        }

        return '';
}

// 纯文本 ICP 备案号
function cn_icp_text(): string {
        if ( defined( 'CN_ICP' ) && CN_ICP &&
             get_option( 'cn_icp' ) ) {
                return esc_attr( get_option( 'cn_icp' ) );
        }

        return '';
}

// 带链接的公安备案号
function cn_ga(): string {
        if ( defined( 'CN_GA' ) && CN_GA &&
             get_option( 'cn_ga' ) ) {
                $ga = preg_replace( '/\D/', '', get_option( 'cn_ga' ) );

                return sprintf(
                        '<a target="_blank" href="https://beian.mps.gov.cn/#/query/webSearch?code=%s" rel="nofollow">%s</a>',
                        esc_attr( $ga ),
                        esc_attr( get_option( 'cn_ga' ) )
                );
        }

        return '';
}

// 纯文本公安备案号
function cn_ga_text(): string {
        if ( defined( 'CN_GA' ) && CN_GA &&
             get_option( 'cn_ga' ) ) {
                return esc_attr( get_option( 'cn_ga' ) );
        }

        return '';
}

// 注册简码
add_shortcode( 'cn_icp', 'cn_icp' );
add_shortcode( 'cn_icp_text', 'cn_icp_text' );
add_shortcode( 'cn_ga', 'cn_ga' );
add_shortcode( 'cn_ga_text', 'cn_ga_text' );

Last edited 4 weeks ago by haozi (previous) (diff)

#2 @LidiaLAB
4 weeks ago

Italian zip file for WordPress 6.7 has this problem too.

We usually create our new SVN branch for each major release with the Italian version of readme.html and wp-config-sample.php files a few days before the official release date.

We did the last one on 4th November. You can see it here: https://i18n.svn.wordpress.org/it_IT/branches/6.7/dist/

I also checked the zip files of the lastest Italian releases of WP from 6.7 up to version 6.0. These are the packages that don't have the Italian version of readme.html and wp-config-sample.php:

wp 6.7
wp 6.6.2
wp 6.6.1
wp 6.6
wp 6.5.5
wp 6.4.5
wp 6.3.5
wp 6.2.6
wp 6.1.7
wp 6.0.9

We will also follow this ticket to know what to do to solve the problem and find out if we need to do something different next time.

Thanks!

This ticket was mentioned in Slack in #meta by haozi. View the logs.


3 weeks ago

This ticket was mentioned in Slack in #meta by haozi. View the logs.


2 weeks ago

Note: See TracTickets for help on using tickets.