[wp-trac] [WordPress Trac] #39639: Increase cache time on wp_get_available_translations()

WordPress Trac noreply at wordpress.org
Thu Jan 19 20:11:21 UTC 2017


#39639: Increase cache time on wp_get_available_translations()
-------------------------+------------------------------
 Reporter:  leewillis77  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  I18N         |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------
Changes (by leewillis77):

 * keywords:  reporter-feedback =>


Comment:

 Replying to [comment:2 ocean90]:

 > What's your actual use case?

 I have a plugin that needs to let people enter information, and as part of
 that choose which "language" it applies to. So - I want to have a dropdown
 of all possible languages. That dropdown is shown on the admin pages of
 the plugin, so if someone is working with the plugin there's the potential
 for it to cause the API to be hit more frequently that you might expect.

 > We use the function only on install and on the settings page. Having a
 short cache time makes it possible to switch to a new language without
 having to wait too long.

 Will someone really be likely to want to switch to a new language within 3
 hours of it being released? Would 24 hours not be just a reasonable?
 Especially since the data will only be in the cache if they've visited the
 admin page, or installed within the last 24hrs anyway...

 There's potentially another couple of issues that could be raised about
 this, namely about moving it out of its current home, and into somewhere
 that's included already so anyway wanting to use it doesn't have to
 include translation-install.php, and also making sure it always returns
 all languages as currently `en_US` isn't included. [I get that en_US is
 the default, and not a "translation"...]. Happy to raise separate tickets
 if you think it makes sense to do so?

 Does that make sense?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39639#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list