It would be nice to have different links for different languages, (e.g. the different translations of the same node). I guess the block translation page would be the proper page for this.

Comments

czigor’s picture

Status: Active » Needs review
StatusFileSize
new2.89 KB

Giving 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.

adammalone’s picture

Assigned: Unassigned » adammalone

Thanks - I'll look into this.

Status: Needs review » Needs work

The last submitted patch, internationalize_block_titlelink-1775316-1.patch, failed testing.

czigor’s picture

Status: Needs work » Needs review
StatusFileSize
new2.87 KB

Line endings changed.

mgifford’s picture

StatusFileSize
new64.2 KB

This 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.

Simple Test Me screenshot

EDIT: This isn't where you'd translate this.... Just realized that today.

mgifford’s picture

Just 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.

adammalone’s picture

Assigned: adammalone » Unassigned

Removing myself as assigned for the time being.

zakxxi’s picture

rsvelko’s picture

Issue summary: View changes
StatusFileSize
new2.88 KB

The 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.

anybody’s picture

+1 for the idea behind this issue! Really great and helpful!! :)

anybody’s picture

Can 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 ;)

ahillio’s picture

Patch 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...