Problem/Motivation

Localization Update currently does not download .po translation files if they are marked for an older version of a module or core than that which is installed. Sometimes the .po files could be just a few days out of date due to a recent module/core upgrade, but other times they can be many months out of date due to a failure in creating .po files at localize.drupal.org.
For example, at the time of this writing the current version Views Slideshow is 7.x-3.1, from almost 9 months ago, 10/24/13, but the .po file at localize.drupal.org/translate/downloads for every language is even older, for version 7.x-3.0.

Proposed resolution

Allow Localization Update to install older versions of .po translation files.

Remaining tasks

1) Alter code to allow Localization Update to install older versions of .po translation files.
2) Decide if accompanying changes should be made, such as adding a checkbox to allow/disallow this behavior, or post notices to the user that an older .po version has been installed.

User interface changes

Implement any UI changes decided upon from 2) above.

API changes

None (I think).

Original report by Mark_L6n

Hi!
This seems like it would be a known issue but I can't find an issue addressing it. I have a new Drupal 7.29 install with a small number of modules installed. I noticed that localization update gives a 'No available translations found' if the version number I have installed is newer than what is available at localize.drupal.org/translate/downloads. For example, the newest Drupal core listed is 7.28, so no .po files are downloaded for 7.29.
What is strange is that some of the modules are old (ex. Views Slideshow 7.x-3.1 from 8-9 months ago, 10/24/13) but the .po files at localize.drupal.org/translate/downloads for every language is even older (for Views Slideshow, 7.x-3.0). Ironically the Internationalization modules are another example, as well as Metatag.
1) Are some modules not getting translations anymore?
2) Is there a way to install a .po file through this module for older versions?
Thanks for any info!

Comments

Sutharsan’s picture

1) Are some modules not getting translations anymore?

No, but sometimes the creation of po files by localize.drupal.org fails. Check out the issue queue: https://www.drupal.org/project/issues/localizedrupalorg

2) Is there a way to install a .po file through this module for older versions?

Currently not.

jmsosso’s picture

Same problem here, also with some modules that have been recently updated. If you install a new module that have been updated some days ago you can't get automatic updates.

I think that if captcha-7.x-1.1.es.po can't be downloaded the module must download the latest file captcha-7.x-1.0.es.po (this is just one of the modules that updates some days ago and I must install captcha-7.x-1.0.es.po manually to get it translated to spanish).

In other sites, in which I have Captcha module before it updates to 1.1 the translations are ok.

The Captcha module is just an example, actually I have this issue with Drupal core (if I install a fresh one) and with some other recently updated modules.

jmsosso’s picture

Category: Support request » Feature request
Sutharsan’s picture

Version: 7.x-1.0 » 7.x-2.x-dev
Issue tags: +Needs issue summary update

Changing the version to 7.x-2.x. Feature request for 7.x-1.x will no longer be accepted.

@jmsosso, can you update the issue summary and title to match your feature request.

Mark_L6n’s picture

Title: Way to find current versions of .po files, or install older version .po files? » Enable Localization Update to install versions of .po translation files that are older than installed versions of modules/core
Priority: Normal » Major
Issue summary: View changes

Thanks for the responses! Please alter issue summary or title if they need improvement.
Also, Sutharsan, in reference to answer 1 in post 1, I couldn't find an issue in the queue at https://www.drupal.org/project/issues/localizedrupalorg about the failure to create po files at localize.drupal.org. I imagine folks managing things there are aware of the problem, but would it be good to post an official issue there about it?

Mark_L6n’s picture

FYI, I just filed a related issue for localize.drupal.org: Update project statistics to reflect current versions, about getting .po files for current versions.

PascalAnimateur’s picture

This is needed for the features translations module to work correctly (thus exporting all the translations instead of just the overridden ones)

What I usually do is import the .po file manually, copy it along the other .po files (if they are stored locally), and then add/adjust the l10n_* tables manually in the database.

Sutharsan’s picture

@PascalCanimateur, Can you explain what features translations module does with po files, how it relates to module versions and why you need this feature. I am not familiar with features translations module.

PascalAnimateur’s picture

From the features translations description page: "The module can use l10n_update to reduce the set of exported strings."

Say you want to export the translated strings from your site into a feature-based module in order to reproduce them on another site or simply have them version controlled using git.. Normally features would export ALL of the translated strings (even those imported from l.d.o), thus creating a huge module (1 Mb or more) for no practical reason. This is where features_translations comes in... You simply configure l10n_update to keep local copies of the .po files in files/translations (for example) and features_translations will automatically segregate imported strings from manually-translated ones, allowing you to export only the latter in a much smaller module.

This is why l10n_update's ability to import older .po files is so important to people depending on features_translations for their localization workflow.
To fix that problem manually, I add an entry in the l10n_update_file table as if the .po file had been successfully imported (you can get that entry from a site running the older, l.d.o translated version of the module) and another one in the l10n_update_project table associating the module's or core's actual version with the path of the .po file (which I copy manually in the same directory used by l10n_update)

Sutharsan’s picture

As far as I understand the original feature request, this issue is about downloading other translations than the ones currently installed on the site. For example:
* Installed: Views Slideshow is 7.x-3.1
* l10n_update can not find a translation for this version.
* l10n_update tries to download a translation for 7.x-3.0
* l10n_update download, import and registers Views Slideshow is 7.x-3.0 translation

This is why l10n_update's ability to import older .po files is so important to people depending on features_translations for their localization workflow.

@PacalAnimateur, sorry I fail to understand what l10n_update does not do, apart from the above scenario. If your site has 7.x-3.0 installed, it should again look for a 7.x-3.0 translation. It does not look for the latest version.

Gábor Hojtsy’s picture

@PacalAnimateur: reading the explanation of your functionality, it sounds like better would be to integrate with potx and parse the generated feature code for getting the exact strings shipped instead of trying to approximate that by removing strings from a huge set that are from elsewhere.

PascalAnimateur’s picture

@Sutharsan, the original feature request is exactly what I need... I was simply stating that it's also important in the context of features_translations.

@Gábor Hojtsy, I'm not sure I understand the approach you're proposing, but features_translations works great as it is (but a little slow to check / rebuild the feature... but I can live with that).

infojunkie’s picture

@PascalAnimateur: I think Gábor is talking about using potx to generate a po/pot file from the feature module, for example to work on translations in Poedit. I needed this ability, so I made a small commit to features_translations to support it: http://cgit.drupalcode.org/features_translations/commit/?id=ea0069f.

PascalAnimateur’s picture

@infojunkie: thanks for the clarification, I'm currently looking into the potx / potx_exportables modules to replace my current features_translation workflow ... but I find that potx doesn't export the context (msgctxt) which I need with localize_fields (features_translations does export the context correctly though). If I understand your patch correctly, it allows to export the non-translated (but translatable) strings along with the feature created using features_translation? Is there another, more relevant thread somewhere for this l10n_update / potx / features_translation stuff?

infojunkie’s picture

johnv’s picture

The same problem occurs after installing Drupal core, version 7.x-dev, with recommended release 7.38. After installing a non-English language, no translations are downloaded.

On page /admin/config/regional/translate/update, the following is shown:
Missing translations for: Drupal core (7.39). File not found at http://ftp.drupal.org/files/translations/7.x/drupal/drupal-7.39.nl.po nor at translations://drupal-7.39.nl.po

But the version 7.39 does not exist yet!

Sutharsan’s picture

Status: Active » Closed (won't fix)

No activity, no support for this feature. Closing the issue.