Hello,
I've been trying to import the initial translation for Estonian language but keep on getting "File to import not found" error.
The file I'm trying to import is a all in one translation from the old translation server (drupal-all-et.po). Is this happening because of:
1. new suggestions were added before the translation was imported
2. I need to import each core module separately
3. some other reason not related to the translation whatsoever?

Comments

gábor hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

It could be that your file is too big to be saved by PHP even. What's the size of that file?

nonsie’s picture

Status: Postponed (maintainer needs more info) » Active

2.6 MB - should I try to import each core module separately?

gábor hojtsy’s picture

I think we have a general 2MB upload limit, not sure why it does not get you an error message of the upload error. Hm. Anyway, I'd import at most in 1MB chunks, but it would take an amazing amount of time. You can just chunk the file inbetween any msgstr "" and msgid "" (between two English - translated pairs). The l10n_server does not care about any of the header values, so it does not care if the header is missing.

paranojik’s picture

StatusFileSize
new27.51 KB

I get an error saying 'The translation file modules-node.po ended unexpectedly at line 982.'. No errors were reported by the msgfmt tool. See attached file.

gábor hojtsy’s picture

@paranojik: not sure why are you hijacking this issue, when you have nothing to do with @nonsie's report and your file gets uploaded but turns back with a parse error, so your neither your language, neither your error is common to @nonsie's. Your bug is a duplicate of #561296: Error message when importing .po file where the last string is untranslated.

paranojik’s picture

I'm sorry. I also got the error when importing the initial translation, so I posted here.

gábor hojtsy’s picture

Title: Error message when attempting to import initial translation » File to import not found when attempting to import translation

Retitled to not invite misleading follow ups.

nonsie’s picture

Kika helped me to split the translation into 4 batches, the largest one was 1.1 mb. One of them was successful, the rest failed with errors such as:
The translation file 1.po contains a syntax error on line 1794.
The translation file 3.po ended unexpectedly at line 8007.
The translation file 4.po ended unexpectedly at line 338.

I guess this means we could close this issue since it is related to the upload size or even better note somewhere that the upload max is 2MB?

gábor hojtsy’s picture

Project: Drupal.org site moderators » Localization server
Version: » 6.x-1.x-dev
Component: Localize.drupal.org » Code

Let's not close this, and make l10n_server intelligently tell you that there was an upload file size problem. My assumption is that it does not look at the file upload error and just assumes it worked and later finds that the file is not there. Moving to l10n_server.

Normally, a .po file above 2MB is too big, since you would not translate such big amounts at once to import. Also, due to the database load, we would not let bigger file uploads anyway.

gábor hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

Hm, amusingly, the file_save_upload() function we reuse does present error messages to the user when errors occur. Seen at http://api.drupal.org/api/function/file_save_upload/6

Are you sure you did not seen any other messages emitted by Drupal which would inform you on the size limitation?

nonsie’s picture

Status: Postponed (maintainer needs more info) » Active

"File to import not found" was the only error message I got.

gábor hojtsy’s picture

Status: Active » Fixed
StatusFileSize
new741 bytes
new33.98 KB

Hm. Trying to reproduce this on my local machine. If I pick no files, I get the l10n_server error you've seen. I had a 8MB post max size limit, and tried to upload bigger files. Uploading smaller and non-.po files did trigger the .po parser with an error on line 1. But uploading bigger files just thrown off the upload with a form reload but no feedback. Amusing. Even if the post max size did stop the file from uploading, at least the l10n_server checking should have kicked in. Amusing.

Anyway, the best I could do is to highlight the size limits in the upload form and in the error message. The UI for the import was already reworked in #610768: Clean up import UI, fix last string bug and add tests very recently. So what I'm doing here is a more detailed error report on our part. This is the best I could do to I guess.

I'm committing this and marking as fixed.

Status: Fixed » Closed (fixed)

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