When you have a new D8 installation there is no sites/default/files/translations directory automatically available yet.

This directory is required by the "Import translation file" function at the user interface translation configuration page. See attached print screen for error messages which are not very helpfull for a beginner.

Temporary solution: file system configuration page has to be saved once so that the missing directory gets created.

CommentFileSizeAuthor
ImportTranslation.png53.94 KBcirage
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Issue tags: +language-ui

I've seen this one as well. Thanks for the report. Found the same temporary solution as well :) We should either (a) create the directory when the locale module is enabled (I would say do this) or (b) create it when attempting to first use it (but we don't really know when it is going to be). Alternately, we can also stop saving the uploaded files in that directory, but I think this changed when the import process changed to work with the built-in localization update.

Sutharsan’s picture

I would suggest that, once the built-in localization update is realised, we only save when the directory is available and if the uploaded filename matches the l.d.o pattern of {project name}-{version}.{language code}.po.

Gábor Hojtsy’s picture

Well, I think even if the first thing you do is import a .po file on the UI, the directory should be created for consistency. As-is currently, people cannot import a .po file without first going and saving the file settings screen.

YesCT’s picture

Issue tags: +medium, +needs initial patch

I think we can create the translations directory like we did in #1848490: Import translations automatically during installation

Not novice, but medium to copy the small bit of relevant code and make a new patch here.

Sutharsan’s picture

Gábor raised the question, but we did not answer it. Should we or should we not make the translations directory required?

  • Translation import is using it to allow re-importing. But do we still need re-importing, or should we make it optional?
  • Interface translation update is using it to store downloaded files. This is handy for deployment, but not required for the download/import.
  • Will configuration translation will be using it? Probably required for translation deployment, but can it be optional?
  • Any parts I overlooked?

Making the directory required will make the code easier, but it means that translation files will be stored regardless of them being used a second time.

Gábor Hojtsy’s picture

@Sutharsan: I don't think its a problem if files are stored even if not used anymore. It could serve as a good track-back of what sources were used to set up the site's translations. Config translation will not need the files any more than locale module itself.

YesCT’s picture

Status: Needs work » Active
Sutharsan’s picture

Status: Active » Closed (fixed)

In the meantime the translations directory did become required. This issue will no longer occur. Closing the issue.