This module is ported to Drupal 8.

For now, Languagefield only allows to select a subset from the list of 'predefined languages'.

Functionalities

Languagefield introduced a Field type, Widgets and Formatters.

Things to do (patches are welcome :-) ):

Things removed from module:

  • Port function hook_field_prepare_view() to LanguageFormatter::prepareView();
  • the 'group help' in LanguageItem::storageSettingsForm(); - a link to a list should suffice; a fresh patch is welcome.
  • Feeds support; - a fresh patch is welcome.

Things removed from Drupal core:
- disabled languages are no longer possible. See:
#1314250: Allow filtering/configuration of which languages apply to what (UI, nodes, files, etc)
#1539072: Support for disabled languages broken, drop it

New features added:
#2358913: Add options for site/user/interface language as default value

The scope of this module might change, due to ongoing changes in D8 core:
- #2230637: Create a Language field widget and the related formatter
- #2397729: Content language settings cannot be configured for non-translatable types on the one page configuration form
- #2143729: Entity definitions miss a language entity key

    This module implements a FieldItem.
  • Drupal Core has a Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem. But it has no Field UI and cannot be added as an extra field on entities. This module does not use/override core's LanguageItem.
  • This issue is an initiative to add a Widget for core language property, that every entity has by default. We might reuse that one day.
  • Symphony2 is now included in Drupal 8. It contains a 'Language' too. We might reuse that one day.
    -- See http://symfony.com/doc/current/reference/forms/types/language.html
    -- See core\vendor\symfony\validator\Symfony\Component\Validator\Constraints
  • Comments

    • johnv committed 9be559d on 8.x-1.x
      Issue #2350069 by johnv: Ported languagefield to Drupal 8.
      
    johnv’s picture

    Issue summary: View changes

    • johnv committed 2c21791 on 8.x-1.x
      Issue #2350069 by johnv: Removed references to languageicons.
      
    johnv’s picture

    Issue summary: View changes

    • johnv committed f44bddf on 8.x-1.x
      Issue #2350069 by johnv: Renamed LangueWidget to LanguageSelectWidget.
      

    • johnv committed efb6176 on 8.x-1.x
      Issue #2350069 by johnv: Fixed hook_help.
      

    • johnv committed bc76c36 on 8.x-1.x
      Issue #2350069 by johnv: Added getConstraints().
      
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Issue summary: View changes

    • johnv committed 3490cdb on 8.x-1.x
      Issue #2350069: Added widget for configurable languages.
      
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Version: 7.x-1.x-dev » 8.x-1.x-dev
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Assigned: johnv » Unassigned
    Issue summary: View changes
    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    Issue summary: View changes
    penyaskito’s picture

    With at least Drupal core beta-14 you can add an entity reference to a config entity (e.g. languages) to any content entity.
    This means that the feature of adding fields referencing active languages is present.
    This module is probably useful for referencing not-enabled languages, but wanted to leave a note at least.

    johnv’s picture

    @penyaskito , indeed. This module is not needed, when you only need the installed languages.

    • johnv committed 91256a6 on 8.x-1.x
      Issue #2350069: Port Language field to D8 - test with D8rc1
      

    • johnv committed 318c936 on 8.x-1.x
      Issue #2350069: Port Language field to D8 - test with D8rc1
      
    francewhoa’s picture

    Issue tags: +Drupal 8

    We would be happy to contribute testing patch, quality assurance, documentation, and agile project management services if needed

    Any additional volunteers to port Language field module from Drupal 7 to 8?

    Related pages

    francewhoa’s picture

    That related ticket shows the D8 porting status on the module project page under "Recommended releases" section at https://www.drupal.org/project/languagefield

    Which invites additional contributors to join the efforts

    Details at https://www.drupal.org/project/contrib_tracker

    johnv’s picture

    Issue summary: View changes
    johnv’s picture

    I declare this complete. There are some tasks left, for which separate issues are filed. Patches are welcome!

    johnv’s picture

    Status: Active » Fixed
    johnv’s picture

    Issue summary: View changes

    • johnv committed 88849ee on 8.x-1.x
      Issue #2350069: Remove superfluous module file
      
    gábor hojtsy’s picture

    Yay! Thanks for bringing this up to Drupal 8. Would be amazing to note that this may not be needed, if only configured languages are to be used on the project page. Also explaining how this is different form the Drupal 8 core provided language field/formatter/widget would also be useful :)

    johnv’s picture

    Hi Gábor, please see the project page. I updated it. Improvement suggestions are welcome. (The core formatter has more settings, but I don't get the working.)

    The languagefield widget/formatter are not intended to be used for the language property, but I'll test it. Feel free to copy code to the core.

    johnv’s picture

    I just tested using both the widget and the formatter on the language property. It does not work:
    - the widget needs a OptionProviderInterface on the Item.
    - the formatter need getNativeName() on the Item.

    Status: Fixed » Closed (fixed)

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