Hi..pls help.

I have a question about the way drupal uses translations. From what i understand,
all translated strings are saved in the database, which (IMHO) might slow down
sites with a LOT of traffic.
I'm just wondering if how can i alter drupal's behavior so that instead of looking up the
translated string in the DB, it would look it up in a file. This way, once the file cached on the server,
things should run faster.


Sun, 02/21/2010 - 06:40

I'm not sure if using a file would be any better than a database. If you have a lot of translations on a high traffic website, PHP will need to parse the file on it's own using what ever algorithm you develop for searching through the said file. These searches won't be cached.

MySQL caches results for queries in RAM and the queries themselves would be faster than having PHP search through a file. With a database you are having the MySQL server look up the string's translation once using an already optimized algorithm. With a file, you would have PHP search through the file line by line (depending on your search algorithm) each time the string's translation is requested.