Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 459-469 (lines=11) @@
456
457
	}
458
459
	protected function get_locale( $key ) {
460
		if ( 'lang' == $key ) {
461
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
462
				return (string) get_blog_lang_code();
463
			} else {
464
				return get_locale();
465
			}
466
		}
467
468
		return false;
469
	}
470
471
	protected function get_google_analytics () {
472
		$option_name = defined( 'IS_WPCOM' ) && IS_WPCOM ? 'wga' : 'jetpack_wga';

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

@@ 133-143 (lines=11) @@
130
	}
131
132
133
	protected function get_locale( $key ) {
134
		if ( 'locale' == $key ) {
135
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
136
				return (string) get_blog_lang_code();
137
			} else {
138
				return get_locale();
139
			}
140
		}
141
142
		return false;
143
	}
144
145
	public function return_locale( $settings ) {
146
		return $settings + array( 'locale' => $this->get_locale( 'locale' ) );