Problem/Motivation
I have installed a second language after installation and set that language as default. I now see that one of the two shortcut links is translated but the other one isn't. I can't find faults in the code for now and haven't had time for debug. See screenshot as well.
I also checked, and the string is translated for this language (i checked the po file and the translate interface config page)
Reproduce:
Install drupal, add second language (dutch) and set second language as default.
Steps to reproduce
Proposed resolution
TBA
Remaining tasks
Patch, with test
Add before/after images available from the issue summary
User interface changes
TBA
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#16 | 1028538_translate_shortcut_menu.patch | 619 bytes | kkalashnikov |
#7 | findcontent.png | 24.42 KB | drupalcms.ir |
Screen shot 2011-01-16 at 04.30.25.png | 698.18 KB | daften |
Comments
Comment #1
montesq CreditAttribution: montesq commentedSame here.
When I go to the part "translate interface", the string "Find content" is not found.
I've tried with the normal profile and the minimal profile -> same issue
I've tried to replace the $t() by st() in shortcut.install -> same issue
I'm disappointed! Has someone got an idea?
Comment #2
droplet CreditAttribution: droplet commentedShortcuts should not translatable in this way.
You can never find the string because SHORTCUT is manually edit. someone like to add "Find Content" as their link then "FJWIFEWI" in other language.
So, the problem is why "Add Content" is translated ??
That's because "Add Content" is linking to a page and that page title is also "Add Content", so Drupal think this is really "Add Content" than custom name.
"Find Content" is linking to a page named "Content" as title.
Comment #3
daften CreditAttribution: daften commentedQuestion: So you should create different shortcut sets based on language?
Then is there a way to automatically assign a shortcut set to a language? If not, there is still something wrong with the design.
Comment #4
droplet CreditAttribution: droplet commented@daften,
yes. it's something wrong with design.
#549698: Prepare field label and description for DDT (translatable queries)
shortcuts works like menu (menu is also not transable), try i18n or custom modules.
Comment #5
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedI marked my issue #1052478: 'Find content' not translated in Content shortcut bar as a duplicate. I also have the problem of 'Find content' not being translated, but 'Add content' is translated. After droplet's explanation and link to the real issue, I understand why.
Comment #6
sahuni CreditAttribution: sahuni commentedWe still cannot translate the link "Find content" in toolsbar.
I just activated l10n_update, but no change for that link (D 7.12)
Comment #7
drupalcms.ir CreditAttribution: drupalcms.ir commentedsame problem here on version 7.15 too.
we tried to find this problem but nothing !
Comment #8
webatelier CreditAttribution: webatelier commentedThis is a workaround and doesn't make the "find content" item in the toolbar translatable.
Go to Administration => Configuration => User Interface => Shortcuts
Click on 'List Links' for the shorcut you wish to change and
edit the name of the link to what you want, i.c. 'Find Content' to your desired name
Comment #9
drupalcms.ir CreditAttribution: drupalcms.ir commentedWhy the other links are translated by default?
For example 'Add content' has translated after import .po file , but 'Find content' still not translated.
Comment #10
designinmotion CreditAttribution: designinmotion commentedI found a possibility to solve this. Click on
Edit shortcuts
on the right. Click onEdit
near theFind content
link. Change inContent
. Now it's translated correctly to the language you're working in.Comment #11
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedThe value 'Find content' is set in the .install file.
If you don't already have too much custom shortcuts set, you can disable Shortcut module, uninstall it, then enable it back (re-install). The text should now be translated.
Nick
Comment #12
nicolasg CreditAttribution: nicolasg commentedI too came across this problem, what I ended up doing was modifying the core module to pass the link titles thru the t() function; then I could use the entity translation functions to translate the text as needed.
In modules/shortcut/shortcut.module.
Line 715 the function shortcut_toolbar_pre_render($toolbar)
Added code after the first line. As follows:
Its not the nicest approach, but it works for me.
Im sure there must be a way to do a similar fix outside the core but I dont have time right now to try it. (Tried theme_menu_tree hook but that doesnt do what I want/need)
Comment #13
nicolasg CreditAttribution: nicolasg commentedAlright well after thinking some more, I figured out a non-core-hack way of doing what I posted before.
Making use of the theme_menu_link hook.
If you just want to apply the translation to the default shortcut set (like me), you can make a very specific hook in your theme template because the default shortcut set has a set menu name 'shortcut-set-1'
Comment #14
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedI just encountered the same problem again.
#12 or similar code should be committed to core.
Shortcuts must be translatable through the admin/config/regional/translate/translate screen.
Many of us don't let end-users actually create custom shortcuts. We, site builders, create shortcuts for them and we need those to be displayed in the end-user's preferred language.
Comment #15
MariaIoann CreditAttribution: MariaIoann commented#12 code fixes the problem, but I would put it inside the shortcut_renderable_links method, in order to apply to the shortcuts block too.
Comment #16
kkalashnikov CreditAttribution: kkalashnikov commentedThis patch work for me
Comment #17
gge CreditAttribution: gge commented#16 works for me too.
Comment #18
daften CreditAttribution: daften commentedIt's not just this patch. When you install a site with e.g. dutch as the default language, the shortcuts are always in dutch. It's a shortcoming in the shortcut system itself which doesn't support multilingual properly it seems.
Comment #19
GoddamnNoise CreditAttribution: GoddamnNoise commentedThe patch in #16 works. I agree with #18 and that won't be the only problem you'll get if you install Drupal 7 with another language different from english as default language.
Comment #20
Senthil Kumar Kumaran CreditAttribution: Senthil Kumar Kumaran as a volunteer commentedI'm facing the same issue in Drupal 8. My problem is, i'm using Drupal composer to update core and contributed modules after each deployment. Hence, applying the patch #16 will be a hack of code for me. Can someone please validate the patch and apply the fix in Drupal core?
Comment #21
Senthil Kumar Kumaran CreditAttribution: Senthil Kumar Kumaran as a volunteer commentedComment #22
Senthil Kumar Kumaran CreditAttribution: Senthil Kumar Kumaran as a volunteer commentedAny update on this issue? or any plan when will this be addressed? or Any action needed?
Comment #29
quietone CreditAttribution: quietone at PreviousNext commentedI tested this on Drupal 10.1.x, standard install with Italian as a second language. The shortcut links were not translated or translatable from the UI. It does seem that that ability should be added. In fact one of the shortcuts is now 'Add content' which is already translated.