change build target

This commit is contained in:
joyqi 2021-08-19 16:56:59 +08:00
parent efc5bf5c51
commit d0cedde7c0
3 changed files with 11 additions and 13 deletions

View File

@ -47,5 +47,5 @@ jobs:
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: typecho_build
name: typecho
path: ./build/

View File

@ -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));
}

View File

@ -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)) {
// 使用参数初始化而不使用数据库