I was not sure where to file this request, but maybe this can be done from l10n_server using some kind of hook of project module? ...or maybe this would have to be done from project module itself?

It would be nice if project pages here at d.o. had a links to the project page at l.d.o.

An image is better than thousand words, to please see the attached image.

Comments

markus_petrux’s picture

Title: Integrate with Project module to add a link to "Translate this module" to project pages » Integrate localize.drupal.org with Project module to add a link to "Translate this module" to project pages
gábor hojtsy’s picture

Title: Integrate localize.drupal.org with Project module to add a link to "Translate this module" to project pages » Cross-link projects with localize.drupal.org
Project: Localization server » Drupal.org customizations
Version: 6.x-1.x-dev »
Component: User interface » Code

Project module and l10n_server module are not running on the same Drupal instance, so we have no way to influence the links of project module from localize.drupal.org or the localization server. Also, your suggestions are drupal.org specific changes to project module links. Those are maintained in drupalorg.module, specifically in drupalorg_project_page_link_alter() on the DRUPAL-6--1 branch which we are running with ATM:

/**                                                                                                                                           
 * Implemenation of hook_project_page_link_alter().                                                                                           
 */                                                                                                                                           
function drupalorg_project_page_link_alter(&$links, $node) {                                                                                  
  // Link to security handbook page.                                                                                                          
  $links['development']['links']['report_security_issue'] = l(t('Report a security issue'), 'security-team');                                 
}

We'd need to add such links there. Also, I've been working a little on the source code warnings, which might be something we'd want to link in from the project page to let people easier improve their code quality. Where the project translation overview is at http://localize.drupal.org/translate/projects/cck the warnings are at http://localize.drupal.org/translate/projects/cck/warnings

Retitled so that it does not say we need work on ldo. Also, ldo already cross-links to drupal.org project pages, so we have no work to do there in terms of cross-linking.

markus_petrux’s picture

Thanks for addressing the issue. I had something to ask, but I had little idea on how to, nor where to. Thanks.

gábor hojtsy’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

Here is an initial patch for drupalorg module. There are a few things we need to clean up here:

- we can only link to the same page for view and contribute because we don't know whether the user is member of any team (we could check whether they are logged in at least though, but that does not help that much)
- I've also included the source code warnings interlink, up for discussion

dww’s picture

Mostly looks fine to me. All projects are automatically synced on l.d.o, right? The only question is which language teams exist, no? So, it's not really the case that the link brings you to all the translations for a project (yet). Some translations might only exist in CVS, etc. Not sure if we really care, but I thought I'd mention it. Otherwise, no objections here.

Thanks!
-Derek

gábor hojtsy’s picture

Yes, all projects are synched. When a project does not have stable releases available for Drupal 5, 6 or 7, then we have "No data available." We probably need better guidance / help text for project developers then to let them know how to fix this issue, and why it happens. Example: http://localize.drupal.org/translate/projects/aBeesParadise

markus_petrux’s picture

How about showing these links only when the project has at least one supported release?

I haven't tested, but the patch could be:

 function drupalorg_project_page_link_alter(&$links, $node) {
   // Link to security handbook page.
   $links['development']['links']['report_security_issue'] = l(t('Report a security issue'), 'security-team');
+  // Localization cross-links for projects with at least one supported release.
+  if (!empty($node->project_release['releases'])) {
+    $has_supported = db_result(db_query_range(db_rewrite_sql('SELECT 1 FROM {project_release_supported_versions} WHERE nid = %d AND supported = 1'), $node->nid, 0, 1));
+    if ($has_supported > 0) {
+      $links['resources']['links']['view_translations'] = l(t('View project translations'), 'http://localize.drupal.org/translate/projects/'. $node->project['uri']);
+      $links['development']['links']['source_warnings'] = l(t('Review translation source wanings'), 'http://localize.drupal.org/translate/projects/'. $node->project['uri'] .'/warnings');
+      $links['development']['links']['help_translate'] = l(t('Help translate this project'), 'http://localize.drupal.org/translate/projects/'. $node->project['uri']);
+    }
+  }
 }
dww’s picture

@markus_petrux: Very good point. I especially like the check that releases are enabled on the project. These links would be silly at http://drupal.org/project/infrastructure for example. ;)

pasqualle’s picture

StatusFileSize
new1.55 KB

fixed typo "wanings"

gábor hojtsy’s picture

Status: Needs review » Patch (to be ported)

Wups, looks like I forgot about this one and already committed #827704: Provide translation download links in resources, which took care of one issue this did not handle: translation projects on d.o, but did not take care of things like no releases found. I also don't think we should include the contribution links yet, it seems like duplication and makes it harder to find the useful stuff. Committing this to DRUPAL-6--1 since it was approved above, and setting to be ported to HEAD.

mgifford’s picture

Version: » 7.x-3.x-dev
Issue summary: View changes
Issue tags: +i18n

Would be nice to see this.

pasqualle’s picture

Status: Patch (to be ported) » Closed (duplicate)
Related issues: +#827704: Provide translation download links in resources

The missing check for "no release found" was already implemented in #827704: Provide translation download links in resources