qTranslation-Xで謎のエラー
Wordpressの他言語化プラグインであるqTranslation Xをためそうと、
Vagrantでつくった環境でテストしてみた。
が、なぜか言語が有効化できない。。
Gettext not updated というエラーが表示されて言語ファイルがアップデートできないようだ。
散々悩んだあげく、ソースを追ってみると
wordpressのtranslations_apiのところでエラーがでており、
ダンプしてみると
name lookup timed out
というえらーメッセージが。
/etc/resolv.confにnameserver を指定し、httpdを再起動することで解決。
wordpressってresolv.conf関係あるんだ!?ってお話でした
追伸
どうやら、単なるタイムアウトだった可能性。
下記ファイルのtimeout を3から10にして解決!
wp-admin/includes/translation-install.php
--snip function translations_api( $type, $args = null ) { include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version if ( ! in_array( $type, array( 'plugins', 'themes', 'core' ) ) ) { return new WP_Error( 'invalid_type', __( 'Invalid translation type.' ) ); } /** * Allows a plugin to override the WordPress.org Translation Install API entirely. * * @since 4.0.0 * * @param bool|array $result The result object. Default false. * @param string $type The type of translations being requested. * @param object $args Translation API arguments. */ $res = apply_filters( 'translations_api', false, $type, $args ); if ( false === $res ) { $url = $http_url = 'http://api.wordpress.org/translations/' . $type . '/1.0/'; if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) { $url = set_url_scheme( $url, 'https' ); } $options = array( 'timeout' => 10, // <----------ここを変更 'body' => array( 'wp_version' => $wp_version, 'locale' => get_locale(), 'version' => $args['version'], // Version of plugin, theme or core ), ); --snip