Importing multiple files into the stage

Importing multiple files into the stage

by Fadi Mansour -
Number of replies: 15

Hi,

I have a moodle installation where I have customized the language, as the official version had serveral issues.

As a result I now have several files in the local language folder, that I wish to contribute.

I tried to use AMOS (this is my first attempt), but I found that I was unable to import more that a single file to the stage.

To import all the files that I had to:

  1. Upload a file.
  2. Stash the changes.
  3. Return to the stage.
  4. Un-stage all.
  5. Import a second file.
  6. Go to my stashes list.
  7. Pop the last stash.
  8. In the stage, stash the resulting combined changes into a new stash.
  9. repeat (goto step 3).
  10. ...

As I have 60 files, I figuered, this can't be right.

Am I doing this wrong? Is there a better way.

Would it be Ok to combine all the files into one before importing? (I might have to give the resulting a dummy, but suitable filename to be accepted).

Any suggestions?

Thanks

In reply to Fadi Mansour

Re: Importing multiple files into the stage

by koen roggemans -
Picture of Language pack maintainers

I'm affraid I don't have any suggestions. Upload files is intended for occacional use, since the recommended way is to use the translation interface.

The drag and drop function of Moodle 2.3 will at least make the upload a little faster.

In reply to koen roggemans

Re: Importing multiple files into the stage

by Mikael Kurula -

Interesting! We have a bit of the same problem. Are there concrete plans for approximately when Amos will be upgraded to Moodle 2.3?

In reply to Mikael Kurula

Re: Importing multiple files into the stage

by koen roggemans -
Picture of Language pack maintainers

It is on 2.3.1 (zie big blue arrow for file upload smile)

In reply to koen roggemans

Re: Importing multiple files into the stage

by Mikael Kurula -
Ah, thanks, that's good news! Sorry for asking stupid questions; have not translated anything in a couple of months.
In reply to koen roggemans

Re: Importing multiple files into the stage

by Mikael Kurula -
Ah, thanks, that's good news! Sorry for asking stupid questions; have not translated anything in a couple of months.
In reply to koen roggemans

Re: Importing multiple files into the stage

by Fadi Mansour -

Ok, thank you for replying, but you do you have any idea what would happen if I consolidated all the files into one, and uploaded it?

From what I see, there's no actual reference to which file each string belongs. So I'm not sure, if this relationship is there, but not apparent on the interface, or that it doesn't matter.

Do you recommend that I go on and try doing that, or would that break something?

Thanks again.

In reply to Fadi Mansour

Re: Importing multiple files into the stage

by koen roggemans -
Picture of Language pack maintainers

I don't think it would break something, I think it just wouldn't work. The filename is part of the identifiction of the string.

David could give you an accurate answer to that.

In reply to koen roggemans

Re: Importing multiple files into the stage

by Fadi Mansour -
So from what I understand: the file name used for the uploaded file actually identifies the string to AMOS. AND if I did what I was suggesting I would be adding new but totally independent strings that would never affect the originals. Ok, so I'll have to do it manually file by file. Thanks for the feedback.
In reply to Fadi Mansour

Re: Importing multiple files into the stage

by David Mudrák -
Picture of Language pack maintainers
Correct. The name of the uploaded file determines the component of the string. It must match the filename of the original English file.

I can see the use case of uploading whole local customization though. Please vote for MDLSITE-1539.
In reply to David Mudrák

Re: Importing multiple files into the stage

by Mikael Kurula -

Hi, the zip upload feature seems to have been disabled again? I tried to upload a zip, but only get the message "No valid string found in the file. Make sure the file has correct filename and is properly formatted."

I'll attach the zip in question in case somobody wants to check it. The target language is Finland_Swedish.

Off-topic: I also have a .php-file for hsuforum, but AMOS doesn't find any useful strings there. Is there a way to contribute our local translation of hsuforum?

In reply to Mikael Kurula

Re: Importing multiple files into the stage

by David Mudrák -
Picture of Language pack maintainers

Hello Mikael. I am sorry for the experienced troubles.

zip upload feature seems to have been disabled again?

No, the feature still works. But the files are supposed to be directly in the root of the ZIP archive. In your ZIP, they have been put into a "moo_local" subdirectory. Please create a new ZIP in a way that all PHP files are directly in root of the archive and it should work well.

In reply to David Mudrák

Re: Importing multiple files into the stage

by Mikael Kurula -

Ah, I fixed the .zip file and now it worked. Thanks a lot!

Is the possibility of uploading a zip by the way documented somewhere, including the precise structure of the zip file? I'm afraid I'll forget this until next time I want to upload some local translations.

The problem with contributing hsuforum.php seems to have been that I selected Moodle 3.3, with which hsuforum is not officially compatible (althought it works fine in practice). I uploaded the translations as Moodle 3.2 and propagated them, and now it seems to have worked fine.

A final comment, off topic again: I am a maintainer of the Finland-Swedish language pack, and earlier I could send my contributions for quality review to another of the maintainers. Now, however, I could not find any such option, but rather I had to commit my contributions directly.

In reply to Mikael Kurula

Re: Importing multiple files into the stage

by koen roggemans -
Picture of Language pack maintainers
In reply to koen roggemans

Re: Importing multiple files into the stage

by Mikael Kurula -
Thanks! I don't understand why I didn't see that, but now that the answer and the link are in this forum thread, I'll find the way next time.
In reply to Mikael Kurula

Re: Importing multiple files into the stage

by koen roggemans -
Picture of Language pack maintainers

Well, it's a small detail and there is a lot of documentation - i'ts easy to mis.