Drupal 7 Classic Connector FAQs
How do I debug Smartling Drupal Connector for Drupal 7?
Over the last 2 years D7 connector proved to be a pretty stable solution that is used by several large companies in production with no complaints. And while there certainly might be some bugs in the connector we will be happy to fix, but from our experience more often problems with translations are caused by either connector or environment misconfiguration. It is also worth mentioning that at this point D7 connector is more of a maintenance status right now, and no major features are being developed here.
At high level D7 connector could be split in 4 major subsystems: the one that extracts source content and applies translations back, queues, network, module/site configs.
- To Test Network: Go to the modules main setting page and press “Test connection” button. You should get a list of green locales and the top of the page. If you don’t get it - either locales are not configured properly or there is a network issue. Right now we do not support proxies or any other workarounds for firewall issues. So the network should work straightforward for the connector to function well. We use CURL as a low-level library and support for https should be enabled for it.
- Queues: Because of some limitations of PHP we run queues by cron. And by default 95% of the processing happens during cron run. As a result if cron is triggered rarely, it might take a while for the content to arrive to Smartling or be downloaded back.
The easiest way to check if we are facing some issue with queues is to disable them on Advanced settings of Smartling module. In order to do that, please, uncheck “Asynchronous mode” checkbox on that page. After this you should be able to trigger upload/download operation immediately from any UI option you prefer.
For test purpose I usually enable “Pseudo” translation mode on the settings tab. Then upload a new piece of content and download back right after that. After that you need to check if translation was applied. If it was, then it is worthwhile to look deeper into the queues and if it didn’t then there might be an issue with some other subsystem.
- Module Settings: On the Drupal status page there should be a green background for the line about Smartling filesystem. It means that module is allowed to write files with source/translations on disk.
Languages need to be set correctly according to the Smartling dashboard.
Check if there is no message at the bottom of Smartling config page stating that “The following field(s) should be disabled for translation: ...”. If there is one, it means that one of the fields is translated both “by nodes” and “by fields” which is prohibited.
When translating field_collections, make sure that the node containing it is translated with “by nodes” method and that fields inside field collection are checked for translation on the Entities tab.
- Subsystem that extracts source content and applies translations back: Everything is pretty complicated here. So if you didn’t find any issues in the subsystems above - the issue should be passed to a developer.
- Logs: It is always a good thing to take a look at logs and see if you see anything strange there. Usually it is a good practice to filter messages by “Smartling” and “PHP” type. In many cases these messages will contain a tip for an answer.
And we (developers) highly appreciate when the customers issue that is passed to us contains text from logs that might be related to the issue (with “Smartling” or “PHP” type). Our recommendation for the info needed to understand what’s going on on the site:
- Screenshot of site config
- Steps to reproduce the issue (if available)
- Result of checks of the subsystems mentioned above
What source languages do we support?
Drupal 7 connector can support any source language as long as it is the site’s default language. No other language can be set as the source language for the connector. And we do not support and 99% will not support in the future multiple source languages within a single site.
So in case of extreme need the only way the customer might have multiple source languages is with some sort of multisite approach (which is essentially a way of making separate sites): https://www.drupal.org/docs/7/multisite-drupal/multi-site-sharing-the-same-code-base
Note: On the Smartling side, there can only be one source language per Smartling project.
How can I ensure that context works properly?
smartling_translation_context module at
/admin/modules page if it's disabled.
- Go to the Smartling settings page at
/admin/config/regional/smartlingto the Context Settings tab.
- Set up the user name. It's usually the name of a user that has at least the permissions for viewing pages on a site.
- Open Debug fields fieldset and put the url of a node into the Page URL field (for example: http://*your.site*/en/node/1). Check "Preview" option and click Save.
After these steps, you will see a generated context. If not, and if it's just a blank page or page with “Unauthorized” text, it may be due to a Basic auth set up on your web server. Set up basic auth credentials on the Smartling settings page.
Can I disable context for some content/entity types?
Yes. You can exclude needed entities from being contextualized at the
/admin/config/regional/smartling page via the Context Settings tab.