开发者

PHP: Performance PLIST/XML vs. MySQL?

I wantet to ask about the performance of MySQL vs. PLIST (apple XML standard).

I'm realising a localization class for my website. Now, I have two possible variants:

-a file localization.plist, where some labels and texts of the website gets saved, as follows:

<dict>
    <key>testmessage</key>
    <dict>
        <key>en</key>
        <string>Test-message-string</string>
        <key>de</key>
        <string>Test-Nachricht</string>
        <key>fr</key>
        <string>C'est une teste</string>
    </dict>
</dict>

Then, there is the alternative with using MySQL and selecting labels from a database, as follows:

SELECT LABEL FROM LABELS WHERE ID = $id AND LANGUAGE_COD开发者_开发问答E = 'en';

Now, which one would be better with its performance? MySQL has a connection to establish, which may be a bit a long time, and plist is quite more complex...

Thanks for your inputs :)

Regs, flo


Well i wouldnt use either.. if you want to use something with human readable XML based storage then use XLIFF or TMX. If it doesnt need to be human readable then use gettext.

Also typically you have a file for every language and your key is the phrase in the source language, and your value is the translate phrase to the language of the file in question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜