Needs review
Project:
Block Title Link [D7]
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Sep 2012 at 15:02 UTC
Updated:
10 Dec 2015 at 14:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
czigor commentedGiving variable support to the module kind of solves this issue.
The translation process is:
1. Apply the patch.
2. Give a Title link on the block configuration page (admin/structure/block/manage/xxx). It's only needed to make the block block_titlelink-aware.
3. Go to admin/config/regional/i18n/variable and select the titles you wish to translate.
4. Go to admin/config/system/variable/realm/language/edit and translate them. The link given here will overwrite the one given on the block config page.
The patch is quite ugly: the block form could be totally replaced by adding a hook_variable_update(). Maybe later.
Comment #2
adammaloneThanks - I'll look into this.
Comment #4
czigor commentedLine endings changed.
Comment #5
mgiffordThis does not seem to fix the problem. I tried it with this config on SimplyTest.me:
And I was not able to edit the Title Path or title attribute to localize anything but the actual title.
EDIT: This isn't where you'd translate this.... Just realized that today.
Comment #6
mgiffordJust tested this again as I didn't read the description in #1.
0. Make sure to enable Variable Administration UI.
I was trying to figure out why we didn't get a UI....
1. Apply the patch.
On STM
2. Give a Title link on the block configuration page (admin/structure/block/manage/#/configure).
We filled in the title & everything.
3. Go to admin/config/regional/i18n/variable and select the titles you wish to translate.
Only Menu blocks showed up.
4. Go to admin/config/system/variable/realm/language/edit and translate them. The link given here will overwrite the one given on the block config page.
The HTML block I created didn't show up in this list.
Comment #7
adammaloneRemoving myself as assigned for the time being.
Comment #8
zakxxi commented4: internationalize_block_titlelink-1775316-1.patch queued for re-testing.
Comment #9
rsvelko commentedThe patch above exposes translatable variables ONLY for menu blocks.
+ $varname = BLOCK_TITLELINK_VARIABLE_PREFIX . 'menu' .'_'. $result->delta;
Here is a better one that exposes title links for ALL modules.
Like this:
excerpt:
+
+/**
+ * Implements hook_variable_info().
+ */
+function block_titlelink_variable_info($options) {
+ $query = db_select('block', 'b')
+ ->fields('b', array('module', 'delta'))
+ ->execute()
+ ->fetchAll();
+
+ foreach ($query as $result) {
+ $varname = BLOCK_TITLELINK_VARIABLE_PREFIX . $result->module .'_'. $result->delta;
/end-of-excerpt
Use the attached patch to make the links translatable.
PS. If there are query parameters or fragments in your translated urls - they will be html/url-encoded and links wont work.
See this issue and patch to make them work: #2451009: query string in title link wont work.
Comment #10
anybody+1 for the idea behind this issue! Really great and helpful!! :)
Comment #11
anybodyCan we please get some more feedback for the patch in #9 so that we can include it into the next dev release, hopefully without issues ;)
Comment #12
ahillio commentedPatch in #9 applied to latest dev and works. I can translate the block paths via the variables translation interface (not the block translation interface, per comments above) now.
I was a little confused about the purpose of this patch, as I initially thought that block_titlelink broke with i18n_block but now I think I'm mistaken about that. I reverted to unpatched version of block_titlelink and when I set a block's title link in English the link address is appropriately receiving the "es/" prefix in Spanish mode, so that just works (for my case).
This patch allows to specify an altogether different link. I can't vouch for the code in the patch, but it does work. Not sure if RTBC needs more review in this case so leaving the status as-is...