mirror of
https://github.com/typecho/typecho.git
synced 2025-04-21 18:21:53 +02:00
change build target
This commit is contained in:
parent
efc5bf5c51
commit
d0cedde7c0
2
.github/workflows/Typecho-dev-Ci.yml
vendored
2
.github/workflows/Typecho-dev-Ci.yml
vendored
@ -47,5 +47,5 @@ jobs:
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: typecho_build
|
||||
name: typecho
|
||||
path: ./build/
|
||||
|
@ -14,18 +14,16 @@ define('__TYPECHO_MB_SUPPORTED__', function_exists('mb_get_info') && function_ex
|
||||
/**
|
||||
* I18n function
|
||||
*
|
||||
* @param ...$args 需要翻译的文字
|
||||
* @param string $string 需要翻译的文字
|
||||
* @param mixed ...$args 参数
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function _t(...$args)
|
||||
function _t(string $string, ...$args): string
|
||||
{
|
||||
[$string] = $args;
|
||||
|
||||
if (count($args) <= 1) {
|
||||
if (empty($args)) {
|
||||
return Typecho_I18n::translate($string);
|
||||
} else {
|
||||
array_shift($args);
|
||||
return vsprintf(Typecho_I18n::translate($string), $args);
|
||||
}
|
||||
}
|
||||
@ -33,12 +31,12 @@ function _t(...$args)
|
||||
/**
|
||||
* I18n function, translate and echo
|
||||
*
|
||||
* @param ...$args 需要翻译的文字
|
||||
*
|
||||
* @return void
|
||||
* @param string $string 需要翻译的文字
|
||||
* @param mixed ...$args 参数
|
||||
*/
|
||||
function _e(...$args)
|
||||
function _e(string $string, ...$args)
|
||||
{
|
||||
array_unshift($args, $string);
|
||||
echo call_user_func_array('_t', $args);
|
||||
}
|
||||
|
||||
@ -51,7 +49,7 @@ function _e(...$args)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function _n($single, $plural, $number)
|
||||
function _n(string $single, string $plural, int $number): string
|
||||
{
|
||||
return str_replace('%d', $number, Typecho_I18n::ngettext($single, $plural, $number));
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class Widget_Options extends Typecho_Widget
|
||||
*/
|
||||
public function __construct($request, $response, $params = null)
|
||||
{
|
||||
parent::__construct($request, $response, null);
|
||||
parent::__construct($request, $response);
|
||||
|
||||
if (!empty($params)) {
|
||||
// 使用参数初始化而不使用数据库
|
||||
|
Loading…
x
Reference in New Issue
Block a user