File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ class LanguageService {
15
15
* @return array List of language data
16
16
*/
17
17
public static function get_all_languages () {
18
- // Get available languages
19
- $ languages = \get_available_languages ();
20
-
21
18
// Load translation-install.php if the function doesn't exist
22
19
if ( ! function_exists ( 'wp_get_available_translations ' ) ) {
23
20
require_once ABSPATH . 'wp-admin/includes/translation-install.php ' ;
@@ -41,15 +38,12 @@ public static function get_all_languages() {
41
38
);
42
39
43
40
// Add translated languages with proper format
44
- foreach ( $ languages as $ locale ) {
45
- if ( isset ( $ translations [ $ locale ] ) ) {
46
- $ translation = $ translations [ $ locale ];
47
- $ formatted_languages [] = array (
48
- 'code ' => $ locale ,
49
- 'name ' => $ translation ['english_name ' ],
50
- 'native_name ' => $ translation ['native_name ' ],
51
- );
52
- }
41
+ foreach ( $ languages as $ locale => $ translation ) {
42
+ $ formatted_languages [] = array (
43
+ 'code ' => $ locale ,
44
+ 'name ' => $ translation ['english_name ' ],
45
+ 'native_name ' => $ translation ['native_name ' ],
46
+ );
53
47
}
54
48
55
49
return $ formatted_languages ;
You can’t perform that action at this time.
0 commit comments