Skip to content

Manage language files#1382

Merged
danielbachhuber merged 14 commits intomasterfrom
lang-command
Sep 10, 2014
Merged

Manage language files#1382
danielbachhuber merged 14 commits intomasterfrom
lang-command

Conversation

@danielbachhuber
Copy link
Copy Markdown
Member

See #714, #1357, #1381

@danielbachhuber
Copy link
Copy Markdown
Member Author

@nacin how do you feel about wp core i18n (list|install|uninstall)? also, is there no API for removing language packs?

@danielbachhuber danielbachhuber added this to the next milestone Sep 8, 2014
@nacin
Copy link
Copy Markdown

nacin commented Sep 8, 2014

wp_download_language_pack() only works with core. You should probably use Language_Pack_Upgrader directly anyway. I can help with this.

get_available_languages() is old-school API that is only for core languages. The newer, better version of this is wp_get_installed_translations(), which accepts a $type argument.

There is no uninstall API for language packs at the moment. I guess there could be. We don't actually (yet) remove them when deleting a theme or plugin, though that will probably come in 4.1 (cc @ocean90). Simply removing the file is sufficient.

Translations can be updated, as well. It's not as obvious because this happens at the same time as core, plugin, and theme updates. A translation can be updated (say, to fix a typo) and still be the same version (of the core/plugin/theme) — the difference is in the PO file creation dates, which are compared API-side.

It's actually all super complicated, the more I think about it. No wonder it took this long to do...

@danielbachhuber
Copy link
Copy Markdown
Member Author

Chatted with @johnbillion today and we came to a couple of decisions:

  • Commands will be named as wp core language (list|install|uninstall|activate)
  • We're skipping support for plugins / themes this time around. When core supports plugins / themes in a more substantial way, we'll likely move wp core language * to a top-level wp language command.

danielbachhuber added a commit that referenced this pull request Sep 10, 2014
@danielbachhuber danielbachhuber merged commit 768c0c8 into master Sep 10, 2014
@danielbachhuber danielbachhuber deleted the lang-command branch September 10, 2014 15:31
@gerardjp
Copy link
Copy Markdown

Hi All,

Not sure if this issue #1374 (posted by me) resulted in this conversation getting lively, nevertheless.

I run a dutch hosting company and manage a decent amount of websites. Beyond a staging area I have enough websites where I can inventory behaviour of the above command. Should any help be needed, feel free to get in touch.

Cudo's on the work!!

Kind regards,

Gerard.

@danielbachhuber
Copy link
Copy Markdown
Member Author

Should any help be needed, feel free to get in touch.

Thanks for the offer! Mind installing the master branch of WP-CLI and giving it some testing? We're hoping to release in the next day or so.

@gerardjp
Copy link
Copy Markdown

Sure, I assume the nightly phar installed from "https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar" is the Master branch you're referring to or is that a distinct deploy branch?

@danielbachhuber
Copy link
Copy Markdown
Member Author

That build is out of date (and doesn't include wp core language). Installing via Composer is your best bet: https://github.com/wp-cli/wp-cli/wiki/Alternative-Install-Methods#installing-via-composer

@nacin
Copy link
Copy Markdown

nacin commented Sep 10, 2014

What about translation updates? Left for later?

@gerardjp
Copy link
Copy Markdown

Typically I think you should add those. However, if I'm correct, Wordpress updates these when themes or plugins are installed. I see the "updating languages" as a new phenomenon in my terminals more often these days ... So since more frequently updated less of a priority for now I think.

Moreover, if you want to control updates, then you should also be able to check whether updates are available. And this sounds like handling language update as complete as plugin or theme updates.

Ofc, correct me if I'm wrong :)

@gerardjp
Copy link
Copy Markdown

@danielbachhuber thanx for the info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants