Hello, it will be good to have ability to import language by url.
Can you realize it?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kala4ek’s picture

Status: Active » Needs review
FileSize
1.56 KB

I made a patch that allows import translations via url.

ndf’s picture

Status: Needs review » Needs work

It is currently possible to:
- Import translations for one specific language
- Import translations for one or more groups (views, panels, etc)

When importing a specific combination 'language + group" it is possible to specify the source *file*.
If you want to import multiple combinations ('1 language, multiple groups) it is possible to specify the source *directory*.
In the latter case a naming convention is used to get the specific source *file*.

Allright, so instead of using a disk-location (directory/file), this feature request is about using a URL as source.
Should be possible, but my main question is if it is desirable to expose translation files for one of your projects online.

ndf’s picture

+++ b/language.drush.inc
@@ -73,7 +73,7 @@ function language_drush_command() {
-			    'According to enabled modules this could be "blocks", "menu", "taxonomy", "countries", ...'),
+          'According to enabled modules this could be "blocks", "menu", "taxonomy", "countries", ...'),

If typos/formatting is still an issue, please do it a different issue.

+++ b/language.drush.inc
@@ -254,9 +254,16 @@ function drush_language_import() {
+      $file_path = drush_find_tmp() . 'drupal_language_import.po';

drupal_language_import.po should not be harcoded.

The valid_url should either point to one translation-file for a specified translation-group.
Or point to a 'directory' that contains translation-files that follow the naming convention: <translation-group>.<langcode>.po

Please also add help/instruction in the drush command language_translations_drush_command()

andrey.troeglazov’s picture

Assigned: Unassigned » andrey.troeglazov
imyaro’s picture

Assigned: andrey.troeglazov » imyaro
Status: Needs work » Needs review
FileSize
898 bytes

Hello,
Seems Andrey forgot about this task, I will finally finish it.

Please check this patch. For me it works well.
Thanks.

Status: Needs review » Needs work

The last submitted patch, 5: drush_language-import_by_url-2174065-5.patch, failed testing.

The last submitted patch, 5: drush_language-import_by_url-2174065-5.patch, failed testing.

imyaro’s picture

Hm.. Why test is started? As I know this project does not contains any tests.
Updated help of the drush command.

imyaro’s picture

Status: Needs work » Needs review

The last submitted patch, 1: drush_language-import_by_url-2174065-1.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 8: drush_language-import_by_url-2174065-7.patch, failed testing.

geek-merlin’s picture

Status: Needs work » Reviewed & tested by the community

Patch looks solid.

  • axel.rutz committed a5fa05b on 7.x-1.x authored by zvse
    Issue #2174065 by zvse, kala4ek: Language import by url
    
geek-merlin’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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