Closed (fixed)
Project:
Easy Breadcrumb
Version:
8.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Nov 2016 at 10:08 UTC
Updated:
18 Feb 2017 at 19:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
greg boggsIn the case of Drupal 8, different from Drupal 7, the home string is a configuration, which I believe should be translatable out of the box by configuration translation. Here is the relevant line of code. If I've made a mistake, patches or pull requests are welcome.
Comment #3
ollu commentedThat was my thought as well, that the translation would end up on the User translation page.
I tried this ugly fix:
$this->t($this->config->get(EasyBreadcrumbConstants::HOME_SEGMENT_TITLE));But it didn't show up on the User interface translation page in drupal after I had visit a page were the string were visible.
Comment #4
ollu commentedGot it working, aparently I forgot to clear cache after I made the changes (see attached file).
Comment #5
greg boggsThat looks reasonable. But, I was really hopeful that it wouldn't be needed in D8 config. I'm going to ping some folks to make sure I'm not going too far off base before committing this one.
Comment #6
greg boggsSpecifically, this documentation leads me to believe t() is not needed for configuration:
https://www.drupal.org/docs/8/multilingual/translating-configuration
Comment #7
ollu commentedAs far as I can understand from the page the sentence "Content Translation module in Drupal core, while the built-in user interface (such as registration forms, content submission and administration interfaces)" should cover that as you say.
I agree that it seems redundant to have the t() wrapped around the string for it to be translatable.
For now I will stick with my solution and if I stumble upon a better solution I sure will let you know.
I think that you have done a nice job with the module!
Comment #8
fabianx commentedt() should indeed not be needed for translation of config entities, so this is a bug.
That means we will need a test for this.
----
Code review:
nit - spacing
Comment #9
alexpottIn order for this to be translatable and deployable via configuration we need a configuration schema for the simple config provided by the module. Not too tricky given that the config only has 4 keys. The lack of a schema also hints that the module might not have any tests since if you have tests your config is automatically checked against any schema you provide :)
For more about configuration see https://www.drupal.org/docs/8/api/configuration-api/configuration-schema...
Comment #10
greg boggsThanks Alex! I've updated the Config Translation documentation with this info! https://www.drupal.org/docs/8/multilingual/translating-configuration, and I'll get this fixed shortly. Now that the module has passed 1,000 installs, I should work on tests. I'll see what I can do.
Comment #11
stella commentedPatch for this. It should work I think, but isn't being picked up as a translatable string for me.
Comment #12
stella commentedNew version of the patch, this time with an easy_breadcrumb.config_translation.yml file, but still not working yet.
Comment #13
greg boggsThe patch looks great.
I'll do some more testing and see if I can figure out how to make it work.
~Greg
Comment #14
stella commentedThis patch works! A links.task.yml file needed to be added for the configuration page in order for the 2nd tab for translation to appear.
Comment #15
stella commentedComment #16
greg boggsThanks for your contribution on this fix Stella and Ollu! This will be in the next release.