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

@@ 500-510 (lines=11) @@
497
	 *
498
	 * @param string $key Language.
499
	 */
500
	protected function get_locale( $key ) {
501
		if ( 'lang' === $key ) {
502
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
503
				return (string) get_blog_lang_code();
504
			} else {
505
				return get_locale();
506
			}
507
		}
508
509
		return false;
510
	}
511
512
	/**
513
	 * Get GA tracking code.