Tags vocabulary could be created by importing config file

Files: 
CommentFileSizeAuthor
#2 tags-standard-profile.png21.46 KBandypost
tags-standard-profile.patch3.86 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 53,280 pass(es). View

Comments

andypost’s picture

Status: Active » Needs review

Patch also removes useless "help-property" usage.

Interesting case for D8MI
Suppose language of the tags should be English by default because of name and description.
But would we loose the ability to translate them in install time...

+++ b/core/profiles/standard/config/taxonomy.vocabulary.tags.ymlundefined
@@ -0,0 +1,7 @@
+langcode: en

+++ b/core/profiles/standard/standard.installundefined
@@ -95,27 +95,16 @@ function standard_install() {
-  $description = st('Use tags to group articles on similar topics into categories.');
...
-  $vocabulary = entity_create('taxonomy_vocabulary', array(
-    'name' => st('Tags'),
-    'description' => $description,
-    'vid' => 'tags',
-    'langcode' => language_default()->langcode,

Suppose language of the tags should be English language by default because of name and description

andypost’s picture

FileSize
21.46 KB

Manual testing shows that Vocabulary stays untranslated
tags-standard-profile.png

+++ b/core/profiles/standard/config/taxonomy.vocabulary.tags.ymlundefined
@@ -0,0 +1,7 @@
+langcode: en

shipped with English

Gábor Hojtsy’s picture

Yes, you can change the vocabulary name and description as well as the language of the vocabulary after install (on the screen demonstrated). Then there is #1905152: Integrate config schema with locale, so shipped configuration is translated and the various schema issues being written (http://www.drupal8multilingual.org/issues/schema) to put an understanding of the structure of config files for use within the locale system to identify translatable strings and make it possible to save translations for them based on software-pre-translation from localize.drupal.org.

As for the patch: For translation, it is not really different whether the .yml file is created in the installation process is already shipped with core. Also, including langcode: en for shipped config files is indeed best practice.

andypost’s picture

@Gabor so what you can recommend about the patch about it's time to be commited? I think most of things from (profile).install should be moved to their config files and Tags name is a nice example to start with

Gábor Hojtsy’s picture

It should end up being translatable either way. The config translation system is still being built as demonstrated, but Drupal 8 will need that to work to avoid major regressions anyway. So it should be fine as config files, yup. I agree it is cleaner to include config "exports" in the profile instead of creating the config programatically unless something really depends on user input or other conditions.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

As I see it, this is RTBC

xjm’s picture

tags-standard-profile.patch queued for re-testing.

xjm’s picture

+1, this is an excellent cleanup.

xjm’s picture

Issue tags: +Quick fix
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Lovely!

Committed and pushed to 8.x. Thanks!

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