Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #28577, comment 17


Ignore:
Timestamp:
07/02/2014 11:14:30 PM (10 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28577, comment 17

    v1 v2  
    66Been thinking what we can do in these cases. One possibility is translating from JS (similar to how TinyMCE does it). We do a JSONP request that returns an translation object `{ 'English string': 'Translated string', ... }`. Then on DOM ready we walk the DOM and replace (may wrap all strings in something like `<span class="wp-translate">` to make that a bit easier/faster). This may make the page flicker a bit.
    77
    8 Another (better?) possibility would be to get an installation-only .mo file from the WordPress.org API on each request and use it directly (keep it in memory). Yes, it's expensive and will slow down the 3-4 page loads while installing, but will work in all cases.
     8Another (better?) possibility would be to get an installation-only .mo file from the WordPress.org API on each page load and use it directly (keep it in memory). Yes, it's expensive and will slow down the 3-4 page loads while installing, but will work in all cases.
    99
    1010This can also be used on the FTP setup screen (right after we are up and running) so the user can install the language pack.