Some languages doesn't declare it's native name in _locale_get_predefined_list(). In this case the original name matches the native name (ej: English, Aymara,..), and it should be used, instead of the empty string.

It doesn't happen in D8 version of the module.

CommentFileSizeAuthor
#1 languagefield-2451967.patch1.32 KBjonhattan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonhattan’s picture

Status: Active » Needs review
FileSize
1.32 KB

This patch has two changes:

-            $predefined[$langcode][$subset][$language->langcode]['native'] = isset($language->native) ? $language->native : '';
+            $predefined[$langcode][$subset][$language->langcode]['native'] = $language->native;

This is because $language->native is always available. See locale_add_language() for reference.

-          $predefined[$langcode][$subset][$id]['native'] = isset($language[1]) ? $language[1] : '';
+          $predefined[$langcode][$subset][$id]['native'] = isset($language[1]) ? $language[1] : $language[0];

This is the fix to the bug report. See also locale_add_language() for reference.

jonhattan’s picture

@johnv please respect commit autorship and use following commit line, with --author. (generated with dreditor).

git commit -m 'Issue #2451967 by jonhattan: Use language name when there'\''s no native' --author="jonhattan <jonhattan@49817.no-reply.drupal.org>"

johnv’s picture

Status: Needs review » Postponed (maintainer needs more info)

Sorry, I don't see a difference.
Can you show some printscreens?

  • johnv committed 838a41b on 7.x-1.x authored by jonhattan
    Issue #2451967 by jonhattan: Use language name when there's no native
    
johnv’s picture

Version: 7.x-1.x-dev » 7.x-1.5
Status: Postponed (maintainer needs more info) » Fixed

I only committed the second part.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.