Hi,

I have more of a "sysadmin" question: I have been wondering for quite a while if it is currently possible to clean up those tables without getting into trouble. I have a site here which consists of a 4-language-setup and roughly 30 contribs. Now, those two tables are growing quite large over time and I don't know how much of the strings are even in use and which aren't and the little sysadmin inside of me can't help but think that there's a lot of wasted resources. :-)

Does "String Refresh" actually accomplish that already? If so, is there a way to launch this function via drush?

Thanks,
Oliver

CommentFileSizeAuthor
#6 cleanup.zip590 bytespawel.traczynski

Comments

jose reyero’s picture

Status: Active » Fixed

String refresh does this only for i18n-string texts, not for other locale strings.
Nope, no drush command.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

adamtong’s picture

i also want to know this.

matsjacobsson’s picture

Hi,

I'm having about 18 000 tablerows in "locales_source". What is a normal value for this?

There are lots and lots of that seems to be empty and they and tend to repeat them self?

Thankful for any help or information...

Best regards,
Mats

Anonymous’s picture

On a Drupal 7 install with 2 languages (english + german) and about 30 active modules, a value between 13'000 and 15'000 strings seems to be normal, from what I've seen. Each additional language of course adds to the total of strings, depending on how much of all the modules are already translated for each of the languages.

MySQL handles that easily though and if caching and everything else works properly, there's no noticeable performance hit with this much strings (a Drupal page hit on a page with views, a couple of translated blocks, menus et cetera generates easily something in the region of 180 SQL queries). I have a number of sites running with 4-5 active languages and 30-40 active modules and no noticeable performance degradation. However, I run MySQL with 4Gigs of cache, APC, etc. on a box with an average load of 5-10%.

The only "beef" I have with that is that it doesn't seem incredibly efficient to me and there's no mechanism to get rid of dead rows. The only way - which is kinda "hardcore" - to get rid of unneeded strings is to remove all languages and readding them. Which of course adds a number of other problems, for example all custom translations also end up being kicked.

So, in the end, I just let them grow like the grass on my balcony because even if you get rid of them, they start growing again. :-)

pawel.traczynski’s picture

Issue summary: View changes
StatusFileSize
new590 bytes

You can use my attached cleanup.php to cleanup locales_source table.
Just put this file in drupal root and run it.
I will remove all locales_source enteries that are not translated.

kopeboy’s picture

Status: Closed (fixed) » Needs review

How to run it from the website?
Would it be possible?

Also, can I translate some new strings later? How to get back the sources strings?

joseph.olstad’s picture

Status: Needs review » Closed (won't fix)

If you have more details about this issue, feel free to continue adding them.

If at some point you develop a new functionality in the form of a patch, or see some sort of bug, or have some documentation to contribute to the README.txt submit a patch and I'll have a look.

rcodina’s picture

Script on #6 works for me. Thanks!