Cache language packs#3595
Conversation
| return $package; //must be a local file.. | ||
|
|
||
| if ( empty( $package ) ) | ||
| return new WP_Error( 'no_package', $this->strings['no_package'] ); |
There was a problem hiding this comment.
This needs the same namespace fix.
Prevents a fatal error if `$package` is empty.
| Then the wp-content/languages/admin-en_GB.po file should exist | ||
| And the wp-content/languages/en_GB.po file should exist | ||
| And the {SUITE_CACHE_DIR}/translation/core-default-([\d\.]+)-en_AU-([\d]+).zip file should exist | ||
| And the {SUITE_CACHE_DIR}/translation/core-default-([\d\.]+)-en_GB-([\d]+).zip file should exist |
There was a problem hiding this comment.
This test is still failing locally:
@require-wp-4.0
Scenario: Core translation CRUD # features/core-language.feature:4
Given a WP install # features/steps/given.php:47
And an empty cache # features/steps/given.php:14
When I run `wp core language list --fields=language,english_name,status` # features/steps/when.php:29
Then STDOUT should be a table containing rows: # features/steps/then.php:44
| language | english_name | status |
| ar | Arabic | uninstalled |
| az | Azerbaijani | uninstalled |
| en_US | English (United States) | active |
| en_GB | English (UK) | uninstalled |
When I run `wp core language install en_GB` # features/steps/when.php:29
And I run `wp core language install en_AU` # features/steps/when.php:29
Then the wp-content/languages/admin-en_GB.po file should exist # features/steps/then.php:149
And the wp-content/languages/en_GB.po file should exist # features/steps/then.php:149
And the {SUITE_CACHE_DIR}/translation/core-default-([\d\.]+)-en_AU-([\d]+).zip file should exist # features/steps/then.php:149
$ wp core language install en_AU
Downloading translation from https://downloads.wordpress.org/translation/core/4.6.1/en_AU.zip...
Unpacking the update...
Installing the latest version...
Translation updated successfully.
Success: Language installed.
cwd: /var/folders/vr/z6wqt2xs6ys87x5rl53_xc900000gn/T/wp-cli-test-run-5835a8892966f0.10018847/
exit status: 0
There was a problem hiding this comment.
@ocean90 the file should exist step doesn't accept regex for the filename, afaik.
You could instead run grep on the translation cache dir to verify the files are there. Pseudo code:
When I run `ls {SUITE_CACHE_DIR}/translation | grep core-default-`
Then STDOUT should contain:
"""
en_AU
"""
And STDOUT should contain:
"""
en_GB
"""
|
@danielbachhuber The output of the install command is now more verbose. Example: The upgrader is currently using the |
Great!
I don't see it as a problem either. In fact, it may be the eventual solution for #1501 |
`file should exist` doesn't support regex.
This accommodates the now more verbose output of the commands due to the change of the upgrader skin.
|
@ocean90 Happy with this? |
|
@danielbachhuber I'm happy if you are! :) Code styling could be improved a bit, but this should probably be done in a separate PR because it affects |
Yep, looks good :)
Sounds good. I'm generally fine with code style changes as long as there's good test coverage around code being changed. |
Fixes #3594.