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


PHP Translate::isFileTranslated方法代码示例

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


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

示例1: foreach

     include MODELS . 'locale_model.php';
     $json = [];
     if ($request['store'] == 'google') {
         $json = ['title' => $app_title($translate), 'short_desc' => $short_desc($translate), 'long_desc' => str_replace(["\r", "\n"], "\n", $description($translate))];
     }
     if ($request['store'] == 'apple') {
         $json = ['title' => $app_title($translate), 'description' => strip_tags(br2nl($description($translate))), 'keywords' => $keywords($translate), 'screenshots' => $screenshots_api];
     }
     break;
 case 'done':
     $done = [];
     $view = 'api';
     foreach ($project->getFirefoxLocales($request->query['store'], $request->query['channel']) as $lang) {
         $translate = new Translate($lang, $project->getLangFile($request->query['store'], $request->query['channel']));
         $translate::$log_errors = false;
         if ($translate->isFileTranslated()) {
             $set_limit = function ($limit, $string) {
                 return mb_strlen(trim(strip_tags($string))) <= $limit;
             };
             // The Google Store has string lengths constraints
             if ($request->query['store'] == 'google') {
                 // Include the current template
                 require TEMPLATES . $project->getTemplate('google', $request->query['channel']);
                 $desc = $set_limit(4000, $description($translate));
                 $title = $set_limit(30, $app_title($translate));
                 $short_desc = $set_limit(80, $short_desc($translate));
                 if ($desc && $title && $short_desc) {
                     $done[] = $lang;
                 }
             } elseif ($request->query['store'] == 'apple') {
                 // Include the current template
开发者ID:TheoChevalier,项目名称:stores_l10n,代码行数:31,代码来源:api_model.php

示例2: function

<?php

namespace Stores;

// Compute the completion status for all locales
$status = [];
// Don't log missing lang files
\Langchecker\DotLangParser::$log_errors = false;
$get_status = function ($lang_file, $store_locales) {
    foreach ($store_locales as $lang) {
        $obj = new Translate($lang, $lang_file);
        $status[$lang] = $obj->isFileTranslated() ? 'translated' : '';
    }
    return $status;
};
$status['google']['release'] = $get_status($project->getLangFile('google', 'release'), $project->getGoogleMozillaCommonLocales('release'));
$status['google']['beta'] = $get_status($project->getLangFile('google', 'beta'), $project->getGoogleMozillaCommonLocales('beta'));
$status['google']['next'] = $get_status($project->getLangFile('google', 'next'), $project->getGoogleMozillaCommonLocales('next'));
$status['apple']['release'] = $get_status($project->getLangFile('apple', 'release'), $project->getAppleMozillaCommonLocales('release'));
$html_table = function ($table_id, $table_title, $store, $channel) use($status, $project) {
    ob_start();
    ?>
        <table id="<?php 
    echo $table_id;
    ?>
" class="table table-bordered table-condensed table-striped">
        <tr>
            <th class="text-center" colspan="5"><?php 
    echo $table_title;
    ?>
</th>
开发者ID:TheoChevalier,项目名称:stores_l10n,代码行数:31,代码来源:home_model.php


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