D8/D9: Improve recommended l10n process
(Prompted by the discussion in sysadmin!274 (merged))
On the D8/D9 install docs, there are red boxes and the workflow is awkward (e.g. manually re-download and sync files after every upgrade?!).
Unorganized braindumps:
(1) A slightly better workflow (which doesn't require patches or manual reinstalls) is to put this in the top-level composer.json
:
"extra": {
"downloads": {
"civi-l10n": {
"path": "vendor/civicrm/civicrm-core/l10n",
"url": "https://download.civicrm.org/civicrm-l10n-core/archives/civicrm-l10n-daily.tar.gz"
}
}
}
The only problem... it may cache the daily snapshot indefinitely. I guess you could add a nonce to the URL.
I almost did this for civicrm_download_composer_d8()
but wasn't sure how to make that change in composer.json
via bash. It'd be prettier with a CLI one-liner (composer require foo...
or composer download foo...
)
(2) Using the civicrm-X.Y.Z-l10n.tar.gz
would require patches somewhere b/c the paths don't match-up right.
(3) The steps about sync'ing SQL files aren't needed. With civicrm-setup and CLI usage, it gets translations direct from l10n/**.mo
files. (There are other use-cases which hit those SQL files - but if you use any of the current documented installers for Civi-D8/D9, they're not needed.)
(4) If there were an identifiable package (composer require civicrm/l10n
):
-
Then we could update
civicrm-asset-plugin
to wire it up. (To wit: ifcivicrm/l10n
is installed, thenvendor/composer/autoload_civicrm_asset.php
could set$civicrm_paths['civicrm.l10n']...
. Same as it does forcivicrm.packages
) -
Publishing a
civicrm/l10n
package fromlab.civicrm.org
would work - but may download slow per https://github.com/composer/packagist/issues/1126. But if the same were on Github, it should perform work alright.