As part of #ldodomination, add support for downloading the XML file generated in #568984: Define language list export format, set it up on ldo and show the available languages based on that. It should be possible that there is no internet connection or someone wants to skip remote downoloads (for build management or deployment purposes for example), so all the local file support should be intact. Support for grabbing the language list from remote would be a new thing.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pp’s picture

Assigned: Unassigned » pp
Sutharsan’s picture

Assigned: pp » Sutharsan

Preliminary specification

Check for XML at l.d.o
fail: check for local po-file
success:
Compose a list of available languages in po-files
Display selection form for installation language
languages: english + languages found
> 5 languages: select list
<= 5 langs: checkboxes
first po-language is the default
fail:
Display form (existing installer step 2): Install in English, Learn how to install ... other languages)
success:
get XML
fail: error message
store temp file
fail: error message
read temp file
fail: error message
language selection (see: load po success)

install profile .info file may contain a setting to override the l10n-server path
install profile may contain po files for one or more languages

seutje’s picture

subscribing

Sutharsan’s picture

Status: Active » Needs review
FileSize
4.11 KB

Attached patch is a partial solution. Still work in progress and for review only.

Status: Needs review » Needs work

The last submitted patch failed testing.

Sutharsan’s picture

Status: Needs work » Needs review
FileSize
3.34 KB
Gábor Hojtsy’s picture

@Sutharsan worked much more on this, and will post an updated patch later. Just in the interest of keeping others updated :)

Jose Reyero’s picture

This is looking good.

About the first step, fetching language list from server, we should add some exception handling and results checking there so in case the server is down, there's no network connection, or anything went wrong during the request it fails gracefully, moving on to the next step (English, Other languages) but with a 'Retry' option...

pp’s picture

I had a dream. :) We should store the install profile's translation in the $_SESSION array. Is it a good idea?

pp

Sutharsan’s picture

FileSize
1.35 KB

@Gábor Hojtsy: I worked on it too and did not your message. I traveled off-line ;) I attach a patch which now also includes storing of the localization file in the system temp directory, and handles exceptions like service is not available or temp file can not be written.

TODO: rewrite the instructions of how to install Drupal in other languages.

@pp: We considered this too but _locale_import_read_po(), used in st(), uses a file. Using a string instead requires a rewrite of this function too.

To test the code you need to add a line to the install profile .info file to override the default server path. Example:

localization_server = http://localhost/l10n_server

With this path the code expects the following files:
http://localhost/l10n_server/languages.xml (file generated by code in #568984: Define language list export format, set it up on ldo)
http://localhost/l10n_server//path_to_po_files/drupal_version/install.nl.po (nl = example language code, as selected in step 2)

Sutharsan’s picture

FileSize
9.9 KB

oops, wrong attachment.

moshe weitzman’s picture

Huge usability improvement.

The localization server should not use a define to drupal.org. Other profiles might want to do this differently. Please use variable_get() or some other pluggable solution that defaults to ldo.

Gábor Hojtsy’s picture

@Moshe: the idea is that the install profile could define the server in the .info file, which would then be carried on as a default. The module needs to have a define for cases, when neither the install profile, neither individual projects (modules, themes) define this, so we need a fallback. If you look at the patch, it overrides the define from the .info file at the start and as soon as it can save variables permanently (DB is set up), it also saves it as a variable in the DB.

Sutharsan’s picture

The patch has an option to add a variable to the profile's .info file to define an alternative translation service.

localization_server = http://example.com/loc_server

Is this what you mean?

Jose Reyero’s picture

About the server, I think if the profile doesn't specify a server, we should go without one, so no default server. We don't want to push the full language list on any profile you are using, specially before this one gets in: #559294: Allow more control for install profiles: override full task list

@Gabor, could you set up some static files somewhere in the server so we can move on and test (languages.xml, a pair profiles po)?

One open question is what happens when the list from the server is not consistent when our predefined language list.

Also, we should be building some locale_remote api not in install libraries but in locale.inc so they can be reused later. This should be part of #568986: Dynamically update standard language list from localization server (I think I will be working on that one)

Status: Needs review » Needs work

The last submitted patch failed testing.

Gábor Hojtsy’s picture

Project: Drupal core » Localization client
Version: 7.x-dev » 7.x-1.x-dev
Component: language system » Code

Ok, since we are not getting this into Drupal 7 due to time constraints, we should regroup to get this in as contrib functionality. This means that this issue might need to be broken down to two things. One is installation time support, where we'd ideally deliver a "component" people could put in their install profiles, so that this functionality can live on in multiple install profiles easily. Most of the functionality though should live in a module, for which l10n_client seems to be the most logical candidate. I'd imagine it growing into a module suite instead of one monolithic module.

seutje’s picture

yea it makes sense that $name_client is the module that connects with $name_server :P

but I guess this would (eventually) require it to be broken up into submodules, or not?

Gábor Hojtsy’s picture

Project: Localization client » Localization update
Version: 7.x-1.x-dev »
Assigned: Sutharsan » Unassigned

Moving to newly added l10n_update.

Jose Reyero’s picture

Version: » 6.x-1.x-dev

Related, #644916: Add drush make command for pulling core installer translations from l.d.o
(This may be the preferred solution for Drupal 6 language list because the installer makes it really difficult to dinamically change the language list if there's no po file)

So I think on this module we just add some basic API to fetch the language list, that may or may not be used by the installer.

Btw, the server language list is now here, http://localize.drupal.org/l10n_server.xml

Gábor Hojtsy’s picture

Issue tags: +localized install
hass’s picture

+

Freso’s picture

Does anyone have a patch, in whatever state, for the current specification? Gábor? Sutharsan?

Perhaps one could start a sandbox project, where we could work on it together? (Instead of sending patches back-and-forth - this seems like the kind of issue that would benefit a lot from that kind of workflow. :))

Gábor Hojtsy’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue tags: +Usability, +D8MI

Tagging for D8MI and usability for inclusion in core in Drupal 8. Moving to 7.x for l10n_update module.

podarok’s picture

subscribe

Gábor Hojtsy’s picture

good_man’s picture

Status: Needs work » Needs review
FileSize
1.3 KB

We can get a very simplified code (thanks to the great work by l10n_update team) like this.

Gábor Hojtsy’s picture

Title: Grab language list from localize.drupal.org for installer selection » Update standard language list from localization server
Project: Localization update » Drupal core
Version: 7.x-1.x-dev » 8.x-dev
Component: Code » language system
Status: Needs review » Needs work

Moving to core queue for Drupal 8. The localization update module in itself has not much use for this functionality as far as I see, but Drupal 8 does need this. Unfortunately I think this is going to be a bit farther off, since

(a) we do have a standard language list in standard.inc now
(b) this issue would be about being able to "update that" from localize.drupal.org (so the installer and admin UI uses the most up to date language list)

BUT we are not going to write PHP files in the includes dir. We could make up our own format and storage for this, but the config initiative is about to introduce a standard format/API for this and IMHO we should use that. So I think this is basically postponed on that overall.

In the meantime we can work through what kind of information we need to expose for this list on the localization server (eg directionality is not yet exposed, see http://localize.drupal.org/l10n_server.xml). We also might want to expose the overall percentage of the "featured project" (Drupal core on localize.drupal.org) for each language to display as a guide on the installer (might not end up being used but the data will be useful to potentially hide some languages, see #1337628: Enhance language select form with textbox and other tools). So I think we should work on the underlying plumbing in related issues while the config initiative gets to to a point to provide us with a storage layer for these languages, when

(1) we'll migrate the standard.inc language list to that
(2) can update it from localize.drupal.org, since we'll have all the data needed exposed there

Makes sense?

Gábor Hojtsy’s picture

Opened #1344540: Extend language list to include direction and percentage of featured project for the localization server to add more needed information to the language list.

Gábor Hojtsy’s picture

Title: Update standard language list from localization server » Dynamically update standard language list from localization server
Issue tags: +language-base

Tagging for base language system.

clemens.tolboom’s picture

Just a side note: while working on #1189184: OOP & PSR-0-ify gettext .po file parsing and generation I was tempted to allow _all_ available languages to try download the install-langcode.po when selected as the POFileReader accepts an URI to download.
(POFileWriter could write it to public://translations/ and POMemoryWriter facilitates the installer to read it)

Gábor Hojtsy’s picture

Status: Needs work » Closed (won't fix)

Found no support in #1632236: Convert built-in language list to CMI to move the language list out of a static PHP array dump, so this is unlikely to happen. We have bigger fish to fry to finish the .po file import system anyway.

Pancho’s picture

Status: Closed (won't fix) » Postponed

I don't know. I think that it's still a valid issue that might be more easy to solve at a later point, maybe in D9. So I'm reopening and postponing this.

mgifford’s picture

Issue summary: View changes

Could it come in 8.1? Or should we just bump this issue to D9 and set the status to Active?

mgifford’s picture

Version: 8.0.x-dev » 8.1.x-dev

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.