Automattic / wp-cldr

Use CLDR localization data in WordPress
GNU General Public License v2.0
23 stars 6 forks source link

update unit tests to check for presence of JSON files for all wp locales #54

Closed stuwest closed 8 years ago

stuwest commented 8 years ago

let's add unit tests to confirm we have all needed files. at the moment, for example, get_cldr_locale() for the .org locale als returns gsw which is a valid CLDR language code but is one of the locales like pt-br which have a different language code than the locale they use for JSON files/trees ( 😡).

starting point that could be added to test_all_WordPress_locales():

        foreach ( $wp_locales as $wp_locale ) {
            $cldr_locale = $this->cldr->get_cldr_locale( $wp_locale );
            $this->assertNotEmpty( $cldr_locale );
            $cldr_json_file = dirname( __DIR__ ) . "/json/28.0.2/cldr-localenames-modern/main/$cldr_locale/territories.json";
            $this->assertFileExists( $cldr_json_file );
        }

but we don't want to have to update version number so probably call get_cldr_json_file() instead.

stuwest commented 8 years ago

added as part of the add/CLDR29-update branch will merge that in a few days once the CLDR release is official (that branch uses the beta at the moment).