Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19832 closed defect (bug) (maybelater)

Splitting translation files for better performance

Reported by: pavelevap's profile pavelevap Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: I18N Keywords: close
Focuses: Cc:

Description (last modified by nacin)

Originally suggested by Chouby: 17128#comment:15

Localization file is bigger and bigger with every new release. It would be very helpfull to split it into several files:

1) Frontend - There are only several strings which are needed on frontend side, but localization file is loaded as a whole.

2) Backend

3) Akismet - Please remove Akismet strings from default localization file. I understand that there is any reason to bundle Akismet with WordPress, no problem, but why all users have to load many strings when they do not need them? Akismet is not updated with WordPress anymore, but strings are still available...

4) Consider About page and Help tabs. There are many long strings and not all users need them translated. They would be much more happier when they could save 2 - 3 MB of memory_limit. It could be help textdomain which would be enabled by default, but could be turned off for example by plugin.

Together with Language packs it would be real improvement for 3.4.

Related: #17128

Change History (12)

#1 @SergeyBiryukov
12 years ago

See #19597 for Akismet.

#2 @wet
12 years ago

  • Cc r.wetzlmayr@… added

#3 @pavelevap
12 years ago

Thank you, I thought that this ticket is especially for header information, but you are right, there is also special textdomain mentioned.

#4 @DrewAPicture
12 years ago

  • Cc xoodrew@… added

#5 @jottlieb
12 years ago

  • Cc jottlieb@… added

#6 @knutsp
12 years ago

  • Cc knut@… added

#7 @nacin
12 years ago

  • Description modified (diff)

Akismet will get pulled out, #19597.

Isolating the About strings is interesting, but how much are we really talking? Let's assume only about.php, credits.php, freedoms.php. What's our memory actually saved? I doubt much.

Removing the help strings would require a manual textdomain. And since help appears almost everywhere in the admin, it'd be loaded on every page. No huge benefit here. Ideas?

Splitting the admin and the frontend is worthy. We would need to load the admin textdomain in includes/admin.php if it isn't already loaded, in the case of including the admin includes bootstrap on the frontend (admin-ajax, just one core example).

I think the idea of tagging strings in is_multisite() branches with an explicit, manual textdomain is additionally intriguing.

Since this ticket proposes a number of ideas I am going to spin off the admin/frontend split and mark it as a task.

#8 @nacin
12 years ago

  • Keywords close added

Akismet: #19597

Admin/frontend: #19852

Multisite: #19831

About and help strings: no ticket. Suggesting we skip this, and close this ticket as a duplicate for the other three. pavelevap?

#9 @scribu
12 years ago

Removing the help strings would require a manual textdomain. And since help appears almost everywhere in the admin, it'd be loaded on every page. No huge benefit here. Ideas?

The idea was that a plugin could disable the loading of the 'help' textdomain (leaving those strings untranslated). I'm not sure if that's something we should cater for. I seriously doubt that those strings alone account for 2-3 MB of memory usage.

#10 @pavelevap
12 years ago

Great, almost everything is blessed for 3.4 :-)

Ad Help strings: There are several hundreds help strings (links, about, etc.) which are usually longer than other strings, so there could be really significant memory savings. I think it would be helpfull for many experienced users to turn off Help tabs (and save memory), but I am not sure if it is even possible. Is there any way to disable Help tabs throughout the whole WordPress? But it does not solve this problem, because strings will be still loaded. And when we use special help textdomain, what about strings which are multisite and also help?

#11 @nacin
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

I find disabling help tabs to be a non-starter, and doubt they would save much memory. Just over 3% of the new wordpress-admin.pot file (raw line count) is for about.php, credits.php, freedoms.php. While I think this is a potential idea, let's put it in our pocket and see how #19852 turns out in the wild. Closing this ticket as maybelater.

#12 @scribu
12 years ago

  • Summary changed from Optimization of loaded translations to Splitting translation files for better performance
Note: See TracTickets for help on using tickets.