'az', // Azerbaijani (Turkey) 'zh_HK' => 'zh_TW', // Chinese (Hong Kong) 'fr_BE' => 'fr_FR', // French (Belgium) 'nn_NO' => 'nb_NO', // Norwegian (Nynorsk) 'fa_AF' => 'fa_IR', // Persian (Afghanistan) 'ru_UA' => 'ru_RU', // Russian (Ukraine) ); if ( isset( $langs[ $locale ] ) ) { $locale = $langs[ $locale ]; } /** * Filters the determined local. * * @date 8/1/19 * @since 5.7.10 * * @param string $locale The local. */ return apply_filters( 'acf/get_locale', $locale ); } /** * acf_load_textdomain * * Loads the plugin's translated strings similar to load_plugin_textdomain(). * * @date 8/1/19 * @since 5.7.10 * * @param string $locale The plugin's current locale. * @return void */ function acf_load_textdomain( $domain = 'acf' ) { /** * Filters a plugin's locale. * * @date 8/1/19 * @since 5.7.10 * * @param string $locale The plugin's current locale. * @param string $domain Text domain. Unique identifier for retrieving translated strings. */ $locale = apply_filters( 'plugin_locale', acf_get_locale(), $domain ); $mofile = $domain . '-' . $locale . '.mo'; // Load from plugin lang folder. return load_textdomain( $domain, acf_get_path( 'lang/' . $mofile ) ); } /** * _acf_apply_language_cache_key * * Applies the current language to the cache key. * * @date 23/1/19 * @since 5.7.11 * * @param string $key The cache key. * @return string */ function _acf_apply_language_cache_key( $key ) { // Get current language. $current_language = acf_get_setting( 'current_language' ); if ( $current_language ) { $key = "{$key}:{$current_language}"; } // Return key. return $key; } // Hook into filter. add_filter( 'acf/get_cache_key', '_acf_apply_language_cache_key' );