Code Duplication    Length = 21-21 lines in 2 locations

core/services/assets/I18nRegistry.php 1 location

@@ 219-239 (lines=21) @@
216
     * @param  string $domain Translation domain.
217
     * @return array
218
     */
219
    private function getJedLocaleData($domain)
220
    {
221
        $translations = get_translations_for_domain($domain);
222
223
        $locale = array(
224
            '' => array(
225
                'domain' => $domain,
226
                'lang' => is_admin() ? EEH_DTT_Helper::get_user_locale() : get_locale(),
227
            ),
228
        );
229
230
        if (!empty($translations->headers['Plural-Forms'])) {
231
            $locale['']['plural_forms'] = $translations->headers['Plural-Forms'];
232
        }
233
234
        foreach ($translations->entries as $msgid => $entry) {
235
            $locale[$msgid] = $entry->translations;
236
        }
237
238
        return $locale;
239
    }
240
}
241

core/domain/services/admin/events/editor/AdvancedEditorData.php 1 location

@@ 654-674 (lines=21) @@
651
     * @param  string $domain Translation domain.
652
     * @return array
653
     */
654
    public static function getJedLocaleData($domain)
655
    {
656
        $translations = get_translations_for_domain($domain);
657
658
        $locale = array(
659
            '' => array(
660
                'domain' => $domain,
661
                'lang'   => is_admin() ? EEH_DTT_Helper::get_user_locale() : get_locale()
662
            ),
663
        );
664
665
        if (! empty($translations->headers['Plural-Forms'])) {
666
            $locale['']['plural_forms'] = $translations->headers['Plural-Forms'];
667
        }
668
669
        foreach ($translations->entries as $msgid => $entry) {
670
            $locale[ $msgid ] = $entry->translations;
671
        }
672
673
        return $locale;
674
    }
675
}
676