zend framework - How to build an inline translation system similar to Magento's -


I am working on a Zend Framework, MVC, Enterprise website project. I would like to develop a friendly translation system that can be translated according to the context of each word (sometimes a single word has a different translation).

The Z Framework uses Z10 for localization of I18n and localization. We have also seen the inline translation system of Magento (ZF), where users can.

We want to know how the inline translation system works, so that we can create a uniform system with improvement.

  1. Where are the translations stored in the database or in the CSV file?

  2. How to know how to bring a translation for the same word to the different pages by user different transclusions set?

  3. How can we create a page to support inline translation?

  4. How does the system handle static text versus dynamic (database-driven) text?

  5. Inline translation seems like this site will be very slow, how does Magento solve this problem?

Please write to them if you have more points that should be explained. Thanks

From the beginning here (in the future, this is probably more than one rational question):

  1. Magnets store basic translations (provided by programmers) in CSV files, but inline translations are stored in the database.

  2. Magento's translations work on the whole string, not the word. By providing a complete sentence value reference for translation, you can get idiomatic translations. It is certain that every sentence should be translated instead of each word.

  3. To do this, Magento responds to the localizer to wrap all localized strings in one call. Generally Magento templates look something like this (Double-underscore function map for "Translate to the current locale"):

    Print $ this-> __ ("Please translate this string");

  4. Dynamic text (according to product specifications) is not often translated into Magento, but if you want to do this, then it's going to be right Is the string for the translator, like this:

    print $ the-> __ ($ some string);

  5. It's unlikely that translation will create or break your site (see your DB questions for most performance issues), but still it's a legitimate The question is. Magento does a few things to help Firstly, it stores the sorted versions of the CSV files in the cache, so that the CSV can be made more efficient by reading. Secondly, Mageto provides page caching so that the output of the whole page can be stored (it is believed that it will present uniformly), as well as block-level caching for small bits of a page. Among them you are in good condition for the most part.

Hope that helps!

Thanks, Jo


Comments