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 :-) ):
Add option to add self-defined languages in LanguageItem::storageSettingsForm();fixed as per the patch in comment #11Add option to add both predefined and self-defined languages in LanguageItem;see #2116687: Using new (custom) languages AND predefined languagesPort function hook_field_widget_info_alter(); see #2270891-4: Language field should depend on Options- #2636144: [D8-port] add languageicons support
- #2619446: Integration with Views (D8);
- Extend hook_help, explaining the new StorageSettingsForm (or on the project page, even if this is core behaviour.)
- function LanguageItem::getNativeName() should be added to \Drupal\Core\Language\Language.
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.
-- See http://symfony.com/doc/current/reference/forms/types/language.html
-- See core\vendor\symfony\validator\Symfony\Component\Validator\Constraints
Comments
Comment #2
johnvComment #4
johnvComment #8
johnvComment #9
johnvComment #10
johnvComment #12
johnvComment #13
johnvComment #14
johnvComment #15
johnvThe following is added to the D8 version: #2358913: Add options for site/user/interface language as default value
Comment #16
johnvComment #17
johnvComment #18
johnvComment #19
johnvComment #20
johnvComment #21
penyaskitoWith 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.
Comment #22
johnv@penyaskito , indeed. This module is not needed, when you only need the installed languages.
Comment #25
francewhoaWe 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
Comment #26
francewhoaThat 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
Comment #27
johnvComment #28
johnvI declare this complete. There are some tasks left, for which separate issues are filed. Patches are welcome!
Comment #29
johnvComment #30
johnvComment #32
gábor hojtsyYay! 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 :)
Comment #33
johnvHi 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.
Comment #34
johnvI 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.