Today while trying to install Drupal 7 with a different language I followed the instructions in the installer only to come up empty and resort to digging into the code. The instructions read
If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.
Return to choose language using the second link below and select your desired language from the displayed list. Reloading the page allows the list to automatically adjust to the presence of new translation packages.
Note that it says Drupal root
After looking at the code the translations should be stored within a profile and within a translations folder.
/**
* Find all .po files for the current profile.
*/
function install_find_locales($profilename) {
$locales = file_scan_directory('./profiles/' . $profilename . '/translations', '/\.po$/', array('recurse' => FALSE));
array_unshift($locales, (object) array('name' => 'en'));
return $locales;
}
At this point I'm not sure if its the documentation that is incorrect or if this piece of drupal is being worked on. A look at CVS as well as the issues queue didn't show much work being done in this area and profiles seems to be the right way to go. This leads me to believe that this is just a documentation bug.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | drupal-7-translation-filename.patch | 858 bytes | gábor hojtsy |
Comments
Comment #1
damien tournoud commentedThe instructions are telling you to uncompress the translation tarball in the Drupal root directory, which is perfectly correct. The tarball will contain files like
modules/system/translations/fr.powhich will thus be in the correct folder.The instructions seems correct, but of course the process is not easy to get right.
Comment #2
jredding commentedbut this isn't what happens. The only 7 translation right now is in Ukrainian. When you download and uncompress the tarball you get a folder called uk-ua and not modules/system/translations/uk-ua.po
http://drupal.org/project/uk-ua
If the instructions are correct then the tarballs on d.o are incorrect. What am I missing here?
There were my steps.
1) CVS down the latest copy of D7 from head
2) Started the installation process
3) Went to http://drupal.org/project/translations and found a D7 translation (Ukranian)
4) Downloaded and put the tarball into the Drupal root directory
5) uncompressed it
6) discovered that the uk-ua tarball only created a uk-ua folder
Also you state
This is stating that translations should go into the root of the system folder; which is inconsistent with the code (at least I can't find how this would work) and doesn't work (if I put uk-ua.po within modules/system/translations it doesn't work)
I'm not attempting to translate a module, I'm trying to install a translation for the entire system during the installation process by following the instructions at /install.php?profile=default&localize=true
Comment #3
damien tournoud commentedLet's move to the infrastructure queue.
I'm not sure if this is a bug of the Urkranian translation, of if our packaging script needs to be reconfigured to generate proper file structures.
At the very least, you can try to download and install a D6 translation tarball, it should work pretty much the same at this stage of the Drupal 7 development.
Comment #4
jredding commentedOK now that makes sense. I downloaded several D6 stable translations and most of them contained the structure you outlined earlier. They weren't all consistent however.
For example
Filipino, Chinese Simplified & Traditional, Finnish, German, Greek and others were properly formatted
but Esperanto and Ukrainian were not properly formatted for Drupal 6.
http://drupal.org/project/uk
http://drupal.org/project/eo
Also both versions of the Ukrainian Drupal 7 release are incorrectly packaged.
http://drupal.org/project/uk
http://drupal.org/project/uk-ua
Is the packager doing the formatting or are we relying on the community developer(s) to create the proper structure (makes sense to me) in CVS (thus creating the tarball). If the latter is the case maybe we can (should?) write a script that checked for the folder structure for the obvious top level hierarchy (modules, profiles, themes, etc. ). A test so to speak.
Thanks for the quick responses btw
Comment #5
gábor hojtsyThe problem is that the packaging script only deals with Drupal 6 or other versions. The "other versions" it assumes to be "earlier", but with Drupal 7, that is not the case anymore. The simplest is to just fix the version check. We might also want to clean up function names to conform to these rules.
Packaging did not change from Drupal 6 to 7, so the same rules should apply. See attached patch.
Comment #6
dwwPatch looks good, thanks.
I ran the following query to find all existing D7 translation releases:
Luckily, both are just -dev snapshots. So, I moved the old tarballs out of the way, and reran packaging on these two projects.
Can someone who knows what they're looking for verify that the tarballs for the following are now correct:
uk-ua 7.x-1.x-dev
uk 7.x-1.x-dev
? Please report back here, and assuming everything looks fine, I'll officially commit and deploy this.
Thanks,
-Derek
p.s. Side note: what's up with http://drupal.org/project/uk vs. http://drupal.org/project/uk-ua ?
Comment #7
tstoecklerActually neither are in the correct format. What you expect is basically a replica of a typical Drupal install, at least from the directory structure, except that, of course, the only files are translation files. Just a note, for further verification.
Comment #8
gábor hojtsy@dww, @tstoeckler: the problem is with the source files not the packager (after the patch :). Look at http://cvs.drupal.org/viewvc.py/drupal/contributions/translations/uk-ua/... (which only has uk-ua.po which is not a dead/removed file) and http://cvs.drupal.org/viewvc.py/drupal/contributions/translations/uk/?hi... (which does not seem to have any file whatsoever on that branch).
Comment #9
dwwOk, committed to HEAD. This just needs to be deployed now.
Comment #10
dwwDeployed.