Code Duplication    Length = 11-11 lines in 2 locations

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

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

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

@@ 466-476 (lines=11) @@
463
464
	}
465
466
	protected function get_locale( $key ) {
467
		if ( 'lang' == $key ) {
468
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
469
				return (string) get_blog_lang_code();
470
			} else {
471
				return get_locale();
472
			}
473
		}
474
475
		return false;
476
	}
477
478
	protected function get_google_analytics () {
479
		$option_name = defined( 'IS_WPCOM' ) && IS_WPCOM ? 'wga' : 'jetpack_wga';