Translation Management - Automatic Link Translation
Drupal pages often link to one another. When you translate them, translated pages need to link to other translated pages and not the originals.
Translation Management includes a handy feature that does just that. It makes sure that any translated pages link to each-other.
The cool part is how it works. Unlike "post-processing" solutions, such as Multilink, Translation Management does the link updates in the database, when saving the nodes.
Supposing Page.A links to Page.B. The translator might first translate Page.A or Page.B. The way this link update works, it doesn't matter. When both pages are translated, the links will be updated as well.
This feature is enabled by default. You can control it by going to:
Admin -> Content Management -> Translation Management -> Translation Setting

Step 1) Check links to other pages when saving
If a page includes links to other pages, we check if these other pages have translations to the same language (as the page being saved). If so, we update the links so that they go to the translations.
In case there are links to pages that are not translated yet, we mark the page as dirty.
Step 2) Check all Dirty pages and update links in them
Next, we go through all pages marked as dirty. Remember, this means we scan all pages that link to other pages which were not translated before.
And, if there are no more links to other untranslated pages, we clear the dirty status.
Performance
This has minimal performance impact. All checks are done when saving pages, not when displaying them.
The changes are saved to the database, so nothing is needed when rendering.
Because we only scan dirty pages and not all of them, the processing time during each save is small too. As the translation progresses, older pages are all clean (only link to other translated pages) and we only need to rescan the last few pages.
Handling paths
This processing takes into account the paths module. When we see a link, we first convert it to the default URL. Then, we check if there's any translation and eventually, we reapply the path of the translation.
Works the same no matter who's translating
The link update operation is done when translations are saved in the module. It happens the same way if you translate from within Drupal (from the Unified translation editor or if you're sending out translations to a translation service (such as our ICanLocalize interface).
The end result - easier translation
This whole mechanism makes it easier to translate and to administer a multilingual site. Without it, someone needs to manually go through translations and update links in them. It's especially time consuming when you translate a page that has many incoming links.

Comentarios
Post new comment