According to the demo video https://vimeo.com/46140797 at approx 35 sec into it, it shows a "Request Translation" button so that you can do a one-off translation request for a node. I currently have Microsoft Translator as my translation tool and it works well to create bulk jobs at /admin/config/regional/tmgmt/node but I can't seem to do the request directly from the node's "Translate" tab (as per the video).

Thoughts?

Comments

ethanethan’s picture

nigelw’s picture

StatusFileSize
new41.79 KB

Unfortunately that's not the issue :(

I am using the core seven admin theme, main content block is there. Here is a screenshot so you can see what I have.

screenshot

miro_dietiker’s picture

Status: Active » Postponed (maintainer needs more info)

This is a clash with a different module that alters the translate tab.. Possibly i18n with modified weight?

Note there are multiple modules that reimplement the translate tab instead of extend it.

If we try to modify the translate tab ... and it's getting replaced by a different module by its own implementation, that's the result.

Alternatively you didn't enable the node source at all.
We'll need a list of enabled modules to help you more.

ethanethan’s picture

Status: Postponed (maintainer needs more info) » Active

Yes you have the main content block, but is it configured properly?

nigelw’s picture

Thanks for pointing me into the right direction. I finally tracked it down. The Context module was the culprit. I had a sitewide context that was overriding core block placement for the seven theme. It was placing the main content block correctly but it looks like tmgmt doesn't modify the Translation Screen if the block is placed by the context module. Not sure if this is then a bug, feature request or works as designed. Providing support for the context module would be great though.

nigelw’s picture

Obviously I can add ~node/*/translate to remove sitewide context from that path (as I don't really have a need to use context for admin screens and node/edit, but it might be better to add something to support Context (Others may still wish to use context to place the block).

berdir’s picture

Title: Missing "Request Translation" button on node » Better integration with context
Category: support » feature
Priority: Normal » Minor

I'm not sure if there is a clean way to integrate with context. If you have an infos about hooks or so, please link to it.

Changing this to a minor feature request, we can keep it open and maybe someone will try to improve it, but don't expect too much :)

The problem is that there is no clean way to do what we'e doing. There is no real API, our only choices are altering the global $page array in hook_page_alter() (which is what we're doing right now and doesn't work in some cases) or overwriting the page callback of translation.module completely, which be complicated as i18n_translation is already doing that too.

bforchhammer’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

I have the same problem of the translation overview not being altered... for me the main content ended up being nested one level deeper under an extra 'content' key.

Attached patch supports this case. Alternatively, adding the following snippet to a custom module should also do the job:

/**
 * Implements hook_page_alter().
 *
 * Fixes faulty behavior of tmgmt_entity_ui_page_alter(), which does not work    
 * properly because we are reordering the system_main block.
 * 
 * @see http:// drupal.org/node/1859340
 */
function MYMODULE_page_alter(&$page) {
  if (module_exists('tmgmt_entity_ui') && isset($page['content']['system_main']['content']['entity_translation_overview'])) {
    module_load_include('inc', 'tmgmt_entity_ui', 'tmgmt_entity_ui.pages');
    $page['content']['system_main']['content']['entity_translation_overview'] = drupal_get_form('tmgmt_entity_ui_translate_form', $page['content']['system_main']['content']);
  }
}

Note: the snipped above and patch are only for the entity_translation overview; for node translation the keys look slightly different (node_translation_overview instead of entity_translation_overview, I think).

Status: Needs review » Needs work

The last submitted patch, context-fix-1859340-8.patch, failed testing.

berdir’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev

Hm, not sure why that didn't apply, wrong version maybe?

Can you add the same snippet to tmgmt_node.module?

berdir’s picture

Status: Needs work » Needs review

#8: context-fix-1859340-8.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, context-fix-1859340-8.patch, failed testing.

bforchhammer’s picture

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

Hm, not sure why that failed. Here's a reroll.

I also noticed that the entity translation one does not have an access check tmgmt_access('create', 'tmgmt_job'). Is that an oversight or on purpose?

bforchhammer’s picture

StatusFileSize
new3.03 KB

Patch with access check.

Status: Needs review » Needs work

The last submitted patch, tmgmt-context-fix-1859340-14.patch, failed testing.

berdir’s picture

+++ b/sources/node/ui/tmgmt_node_ui.moduleundefined
@@ -11,11 +11,18 @@
-  if ($node = menu_get_object()) {
-    if (isset($page['content']['system_main']['translation_node_overview']) && entity_access('create', 'tmgmt_job')) {
+  if ($node = menu_get_object() && entity_access('create', 'tmgmt_job')) {
+    if (isset($page['content']['system_main']['translation_node_overview'])) {
       module_load_include('inc', 'tmgmt_node_ui', 'tmgmt_node_ui.pages');

Doing an assignment and another check on the same line is tricky, because what happens is this: $node = (menu_get_object() && entity_access('create', 'tmgmt_job')) when you don't set the () yourself.

bforchhammer’s picture

Status: Needs work » Needs review
StatusFileSize
new3.03 KB

Let's see what the bot says about this one. :)

berdir’s picture

Status: Needs review » Fixed

Works for me. Pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.