本文整理汇总了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
示例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>