Code Duplication    Length = 11-11 lines in 2 locations

json-endpoints/class.wpcom-json-api-site-settings-endpoint.php 1 location

@@ 239-249 (lines=11) @@
236
237
	}
238
239
	protected function get_locale( $key ) {
240
		if ( 'lang' == $key ) {
241
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
242
				return (string) get_blog_lang_code();
243
			} else {
244
				return get_locale();
245
			}
246
		}
247
248
		return false;
249
	}
250
251
252
	/**

json-endpoints/class.wpcom-json-api-site-settings-v1-2-endpoint.php 1 location

@@ 30-40 (lines=11) @@
27
	}
28
29
30
	protected function get_locale( $key ) {
31
		if ( 'locale' == $key ) {
32
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
33
				return (string) get_blog_lang_code();
34
			} else {
35
				return get_locale();
36
			}
37
		}
38
39
		return false;
40
	}
41
42
	public function return_locale( $settings ) {
43
		return $settings + array( 'locale' => $this->get_locale( 'locale' ) );