Add l10n support for announcement and copyright text, close #115
This commit is contained in:
parent
e7f95fe956
commit
f24aeb5a7a
|
|
@ -95,7 +95,11 @@ class AdminController extends Controller
|
||||||
|
|
||||||
$form->textarea('copyright_text')->rows(6)->description();
|
$form->textarea('copyright_text')->rows(6)->description();
|
||||||
|
|
||||||
})->handle();
|
})->with('copyright_text',
|
||||||
|
option('copyright_text_'.config('app.locale'), option('copyright_text'))
|
||||||
|
)->handle(function () {
|
||||||
|
Option::set('copyright_text_'.config('app.locale'), request('copyright_text'));
|
||||||
|
});
|
||||||
|
|
||||||
$customJsCss = Option::form('customJsCss', OptionForm::AUTO_DETECT, function($form)
|
$customJsCss = Option::form('customJsCss', OptionForm::AUTO_DETECT, function($form)
|
||||||
{
|
{
|
||||||
|
|
@ -205,11 +209,13 @@ class AdminController extends Controller
|
||||||
|
|
||||||
})->handle();
|
})->handle();
|
||||||
|
|
||||||
$announ = Option::form('announ', OptionForm::AUTO_DETECT, function($form)
|
$announ = Option::form('announ', OptionForm::AUTO_DETECT, function ($form) {
|
||||||
{
|
|
||||||
$form->textarea('announcement')->rows(10)->description();
|
$form->textarea('announcement')->rows(10)->description();
|
||||||
|
})->renderWithOutTable()->with('announcement',
|
||||||
})->renderWithOutTable()->handle();
|
option('announcement_'.config('app.locale'), option('announcement'))
|
||||||
|
)->handle(function () {
|
||||||
|
Option::set('announcement_'.config('app.locale'), request('announcement'));
|
||||||
|
});
|
||||||
|
|
||||||
$resources = Option::form('resources', OptionForm::AUTO_DETECT, function($form)
|
$resources = Option::form('resources', OptionForm::AUTO_DETECT, function($form)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,9 @@ if (! function_exists('bs_custom_copyright')) {
|
||||||
|
|
||||||
function bs_custom_copyright()
|
function bs_custom_copyright()
|
||||||
{
|
{
|
||||||
return Utils::getStringReplaced(Option::get('copyright_text'), ['{site_name}' => Option::get('site_name'), '{site_url}' => Option::get('site_url')]);
|
$localizedCopyrightText = option('copyright_text_'.config('app.locale'), option('copyright_text'));
|
||||||
|
|
||||||
|
return Utils::getStringReplaced($localizedCopyrightText, ['{site_name}' => Option::get('site_name'), '{site_url}' => Option::get('site_url')]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -250,7 +252,9 @@ if (! function_exists('bs_announcement')) {
|
||||||
|
|
||||||
function bs_announcement()
|
function bs_announcement()
|
||||||
{
|
{
|
||||||
return app('parsedown')->text(option('announcement'));
|
$localizedAnnouncement = option('announcement_'.config('app.locale'), option('announcement'));
|
||||||
|
|
||||||
|
return app('parsedown')->text($localizedAnnouncement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ homepage:
|
||||||
description: Any evil modification applied on the footer program copyright (including deleting, modifying author, changing link target) with out permission is <b>FORBIDDEN</b>. The author reserves the right to pursue relevant responsibilities.
|
description: Any evil modification applied on the footer program copyright (including deleting, modifying author, changing link target) with out permission is <b>FORBIDDEN</b>. The author reserves the right to pursue relevant responsibilities.
|
||||||
copyright_text:
|
copyright_text:
|
||||||
title: Custom Copyright Text
|
title: Custom Copyright Text
|
||||||
description: Placeholders are available in custom copyright text. e.g. <code>{site_name}</code> & <code>{site_url}</code>
|
description: Placeholders are available in custom copyright text. e.g. <code>{site_name}</code> & <code>{site_url}</code>. You can also specify a different footer for each language. To edit a specific language's corresponding footer, please switch to that language and submit your edit.
|
||||||
|
|
||||||
customJsCss:
|
customJsCss:
|
||||||
title: Custom CSS/JavaScript
|
title: Custom CSS/JavaScript
|
||||||
|
|
@ -113,7 +113,7 @@ announ:
|
||||||
title: Announcement
|
title: Announcement
|
||||||
|
|
||||||
announcement:
|
announcement:
|
||||||
description: Styling with Markdown is supported.
|
description: Styling with Markdown is supported. You can also specify a different announcement for each language. To edit a specific language's corresponding announcement, please switch to that language and submit your edit.
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
title: Resource Files
|
title: Resource Files
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ homepage:
|
||||||
description: 对于任何恶意修改页面<b>右下角</b>的版权信息(包括不限于删除、修改作者信息、修改链接指向)的用户,作者保留对其追究责任的权力。
|
description: 对于任何恶意修改页面<b>右下角</b>的版权信息(包括不限于删除、修改作者信息、修改链接指向)的用户,作者保留对其追究责任的权力。
|
||||||
copyright_text:
|
copyright_text:
|
||||||
title: 自定义版权文字
|
title: 自定义版权文字
|
||||||
description: 自定义版权文字内可使用占位符,<code>{site_name}</code> 将会被自动替换为站点名称,<code>{site_url}</code> 会被替换为站点地址。
|
description: 自定义版权文字内可使用占位符,<code>{site_name}</code> 将会被自动替换为站点名称,<code>{site_url}</code> 会被替换为站点地址。每种支持的语言都可以对应不同的自定义版权文字,如果想要编辑某种特定语言下的版权文字,请在右上角切换至该语言后再提交修改。
|
||||||
|
|
||||||
customJsCss:
|
customJsCss:
|
||||||
title: 自定义 CSS/JavaScript
|
title: 自定义 CSS/JavaScript
|
||||||
|
|
@ -113,7 +113,7 @@ announ:
|
||||||
title: 站点公告
|
title: 站点公告
|
||||||
|
|
||||||
announcement:
|
announcement:
|
||||||
description: 可使用 Markdown 进行排版
|
description: 可使用 Markdown 进行排版。每种支持的语言都可以对应不同的站点公告,如果想要编辑某种特定语言下的公告,请在右上角切换至该语言后再提交修改。
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
title: 资源文件配置
|
title: 资源文件配置
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user