当前位置: 首页>>代码示例>>PHP>>正文


PHP i18n::get_js_i18n方法代码示例

本文整理汇总了PHP中i18n::get_js_i18n方法的典型用法代码示例。如果您正苦于以下问题:PHP i18n::get_js_i18n方法的具体用法?PHP i18n::get_js_i18n怎么用?PHP i18n::get_js_i18n使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在i18n的用法示例。


在下文中一共展示了i18n::get_js_i18n方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_i18n_javascript

 /**
  * Add i18n files from the given javascript directory.  Sapphire expects that the given directory
  * will contain a number of java script files named by language: en_US.js, de_DE.js, etc.
  * @param $langDir The javascript lang directory, relative to the site root, e.g., 'sapphire/javascript/lang'
  */
 public function add_i18n_javascript($langDir)
 {
     if (i18n::get_js_i18n()) {
         // Include i18n.js even if no languages are found.  The fact that
         // add_i18n_javascript() was called indicates that the methods in
         // here are needed.
         $this->javascript(SAPPHIRE_DIR . '/javascript/i18n.js');
         if (substr($langDir, -1) != '/') {
             $langDir .= '/';
         }
         $this->javascript($langDir . i18n::default_locale() . '.js');
         $this->javascript($langDir . i18n::get_locale() . '.js');
         // Stub i18n implementation for when i18n is disabled.
     } else {
         $this->javascript[SAPPHIRE_DIR . '/javascript/i18nx.js'] = true;
     }
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:22,代码来源:Requirements.php

示例2: add_i18n_javascript

 /**
  * Add i18n files from the given javascript directory.  SilverStripe expects that the given directory
  * will contain a number of java script files named by language: en_US.js, de_DE.js, etc.
  * 
  * @param String The javascript lang directory, relative to the site root, e.g., 'framework/javascript/lang'
  * @param Boolean Return all relative file paths rather than including them in requirements
  * @param Boolean Only include language files, not the base libraries
  */
 public function add_i18n_javascript($langDir, $return = false, $langOnly = false)
 {
     $files = array();
     if (i18n::get_js_i18n()) {
         // Include i18n.js even if no languages are found.  The fact that
         // add_i18n_javascript() was called indicates that the methods in
         // here are needed.
         if (!$langOnly) {
             $files[] = FRAMEWORK_DIR . '/javascript/i18n.js';
         }
         if (substr($langDir, -1) != '/') {
             $langDir .= '/';
         }
         $files[] = $langDir . i18n::default_locale() . '.js';
         $files[] = $langDir . i18n::get_locale() . '.js';
         // Stub i18n implementation for when i18n is disabled.
     } else {
         if (!$langOnly) {
             $files[] = FRAMEWORK_DIR . '/javascript/i18nx.js';
         }
     }
     if ($return) {
         return $files;
     } else {
         foreach ($files as $file) {
             $this->javascript($file);
         }
     }
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:37,代码来源:Requirements.php


注:本文中的i18n::get_js_i18n方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。