Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
in i18nmenu.module there is a little typo that prevents the menu strings from being refreshed on the "Translate interface" page. The following patch replaces "profile" by "menu" in hook_locale.
Comment | File | Size | Author |
---|---|---|---|
i18nmenu.locale_refresh.patch | 374 bytes | Frank Steiner |
Comments
Comment #1
Frank Steiner CreditAttribution: Frank Steiner commentedOk, I see that this is actually not enough because even if the locale hook is now running, it fails to find menu strings that were created when creating a new page. If you select a menu title for the page, it will be stored with the
customized=false
so the checkif ($link['customized'])
ini18nmenu_localize_tree
will fail. Therefore such menu strings won't be found when refreshing the strings.customized
is only set to true if a menu entry is somehow edited on the Site Building>>Menus pages, but of course this is not nice. A user usually creates a page with a menu entry and a language, then goes to "Translate interface" and expects to find the menu title there, so that it can be localized before translating the page.So we have two options: Remove the
if ($link['customized'])
fromi18nmenu_localize_tree
or define$item['customized']=1;
in the function18nmenu_menu_link_alter
. Maybe that's what you plan todo with// @ TO DO: Refresh texts
that's noted in this function.I'm not sure what's the right solution, so I don't offer a patch here. For my purposes I've removed the check in
i18nmenu_localize_tree
which seems to work fine. Now I can immediately find and translate every new menu that I've created when creating a new page.Comment #2
AaronCollier CreditAttribution: AaronCollier commentedEither of those solutions sounds complicated (I mean maybe effecting other things as well). Not sure which way I'd vote. Could you do a patch for both and we could try testing both?
Comment #3
Frank Steiner CreditAttribution: Frank Steiner commentedHmm, I don't now what's wrong at the moment, but I cannot attach the patches. They just don't show up after atacching and posting the comment. I will try again later :-)
Comment #4
Frank Steiner CreditAttribution: Frank Steiner commentedOk, I don't know what's wrong with those files :-( I can attach other patches in other posts, but not the i18n patches here, so I post them.
Patch 1:
Patch 2:
Comment #5
AaronCollier CreditAttribution: AaronCollier commentedGenerally, when providing patches, you can assign issues to yourself.
Comment #6
Frank Steiner CreditAttribution: Frank Steiner commentedAh, I didn't know that!
Comment #7
Jose Reyero CreditAttribution: Jose Reyero commentedApplied the first patch, about the typo in locale hook.
About the second part, menu items for nodes (is it what we are talking about?) don't need to go through menu translation as the menu system will just show the menu items for the nodes in the current language.
So I mark this one as fixed, please reopen if you want to follow up with the second part.
(Frank, you can assign issues to yourself any time you are willing to work and follow up on them, just to let us know someone's taking care of the issue....)
Thanks
Comment #8
Frank Steiner CreditAttribution: Frank Steiner commentedHi Jose,
> menu items for nodes (is it what we are talking about?) don't need to go through
> menu translation as the menu system will just show the menu items for the nodes in the current language.
yes, we are talking about menu items for nodes. And with what you just stated, I'm even more confused what exactly "Localized menus" should be :-) Maybe you can say sth. about it in this thread: http://drupal.org/node/230868
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.