Zend_Application-AvailableResources-Translate.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect2 id="zend.application.available-resources.translate">
  4. <title>Zend_Application_Resource_Translate</title>
  5. <para>
  6. <classname>Zend_Application_Resource_Translate</classname> will initialize a
  7. <classname>Zend_Translate</classname> adapter based on the options passed to it.
  8. </para>
  9. <para>
  10. The following configuration keys are recognized:
  11. </para>
  12. <itemizedlist>
  13. <listitem>
  14. <para>
  15. <emphasis><property>adapter</property></emphasis> : <classname>Zend_Translate
  16. </classname> adapter type. The default adapter is array if not specified.
  17. </para>
  18. </listitem>
  19. <listitem>
  20. <para>
  21. <emphasis><property>data</property></emphasis> : path to translation.
  22. </para>
  23. </listitem>
  24. <listitem>
  25. <para>
  26. <emphasis><property>locale</property></emphasis> : defining the locale to be used
  27. in translation. By default, the locale can be detected automatically or forcing
  28. with a <classname>Zend_Locale</classname> instance store in <classname>
  29. Zend_Registry</classname> with a single locale.
  30. </para>
  31. </listitem>
  32. <listitem>
  33. <para>
  34. <emphasis><property>options</property></emphasis> : the options are different for
  35. each adapter. See the section <xref linkend="zend.translate.additional.options" /> for
  36. more details.
  37. </para>
  38. </listitem>
  39. <listitem>
  40. <para>
  41. <emphasis><property>registry</property></emphasis> : the custom key to store the
  42. <classname>Zend_Translate</classname> instance in the registry. By default, the
  43. key is <property>Zend_Translate</property>.
  44. </para>
  45. </listitem>
  46. <listitem>
  47. <para>
  48. <emphasis><property>cache</property></emphasis> : the name of the cache template
  49. or an instance of <classname>Zend_Cache_Core</classname> to use as cache for
  50. <classname>Zend_Translate_Adapter</classname>. The goal is to accelerate the
  51. loading specialy for the <acronym>XML</acronym> based files.
  52. </para>
  53. </listitem>
  54. </itemizedlist>
  55. <example id="zend.application.available-resources.translate.configExample">
  56. <title>Sample translate adapter resource configuration</title>
  57. <para>
  58. Below is an example <acronym>INI</acronym> configuration that can be used to initialize
  59. the translate resource.
  60. </para>
  61. <programlisting language="ini"><![CDATA[
  62. resources.translate.adapter = tmx
  63. resources.translate.content = APPLICATION_PATH "/../data/locales"
  64. resources.translate.scan = Zend_Translate::LOCALE_DIRECTORY
  65. ; Optionally you can also the cache template to use for caching:
  66. resources.translate.cache = "languages"
  67. ]]></programlisting>
  68. </example>
  69. </sect2>