Menu Item Save and Translate (MIST) is a small companion module to i18n_menu providing a Save and Translate button on a menu's Add link page when the menu translation mode is set to Translate and Localize.
The normal i18n_menu translation process requires manually finding again which menu link to translate, 3 clicks and 2 pages loads making the process very slow, painful and error prone.
MIST fixes that by cycling through all languages during link creation allowing a very fast translation process when manually adding menu links. When clicking on Save and Translate, MIST will load the "add link" form with the next language pre-selected, in weighted order.
UI configuration
MIST's default behavior is to cycle through all untranslated languages in their weighted order. There is a UI configuration to change this behavior and load the Translation overview page instead of the next language.
Similar modules
I was not able to find a module that did this, so I created it. While i18n provides a Save And translate button for taxonomies and blocks, it doesn't provide one for menu links.
Project links
Project page: https://www.drupal.org/sandbox/ptsimard/2403577
Git access: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ptsimard/2403577.git
Comments
Comment #1
ptsimard commentedComment #2
ptsimard commentedComment #3
ptsimard commentedComment #4
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #5
mihai_brb commentedHello ptsimard,
Manual Review
This review uses the Project Application Review Template.
Thank you,
Comment #6
jepster_Automated Review
Review of the 7.x-1.x branch (commit a35e618):
No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.
Manual Review
This review uses the Project Application Review Template.
Comment #7
ptsimard commentedThanks for the feedback!
@mihai_brb:
From your feedback, I implemented the 2 following changes:
I also tweaked the readme a bit.
As for
I'm not sure I understand your issue. I tried to replicate it but I get the correct behavior (the button is there) when translating an existing menu item in a menu set to "Translate and Localize".
Comment #8
ptsimard commentedAlso fixed a refactoring regression, see: commit eef614a
Comment #9
PA robot commentedGit clone failed for http://git.drupal.org/sandbox/ptsimard/2403577.git while invoking http://pareview.sh/pareview/httpgitdrupalorgsandboxptsimard2403577git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #10
ptsimard commentedGot home PA robot, you're drunk.
Comment #11
stefan.r commentedI have installed this module and confirmed it works as described. Seems like it could be useful for content/menu managers!
Automated Review
[Review of the 7.x-1.x branch (commit 9ed9514):
No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.
Manual Review
However: do you intended to submit this as a patch to i18n_menu once it's stable? (given that apparently blocks and taxonomies do have this functionality already)
Just a nitpick: menu_link_load($_GET['translation']); <-- menu_link_load already does an is_numeric() check, but it's good practice to sanitize raw _GET input before feeding it to drupal core functions anyway.
$translations = $form['translation_set']['#value']->get_translations();<-- check that you can actually run the get_translations() method on the object, just in case the API changes in the futureThis review uses the Project Application Review Template.
Comment #12
stefan.r commentedComment #13
ptsimard commentedThank stefan.r for your helpful review!
I want to let you know I improved the module greatly today and committed the changes. Here is a rundown of your comments and my improvements:
Yes, I would like to do that eventually but I still want to submit this as an add-on module for now as it might be simpler to customize the behavior.
Added a
is_numeric($_GET['translation'])check in the conditional before the menu_link_load(). It should fail before getting to that function.Changed the text.
Added a helper function checking that the method exists or logging to watchdog. Also helped streamline the code. Not certain if method_exists() is the recommended for this but it seems to work.
Added the 'edit' mode functionality. The button will now appear when editing an existing link. This was a bit trickier than I expected and ad repercussion with my use of
$_GET['translation']elsewhere in the code. Added a stored value in form_state to mitigate that.Comment #14
stefan.r commentedCool, just reiterating RTBC status.
If you want one of the git admins to have a look at this, go get that Review bonus :)
Comment #15
cweagansThanks for your contribution!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #16
ptsimard commentedAwesome! Thank you very much!