diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php
index b4c23a1d..7d322082 100644
--- a/app/Http/Controllers/AdminController.php
+++ b/app/Http/Controllers/AdminController.php
@@ -95,7 +95,11 @@ class AdminController extends Controller
$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)
{
@@ -205,11 +209,13 @@ class AdminController extends Controller
})->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();
-
- })->renderWithOutTable()->handle();
+ })->renderWithOutTable()->with('announcement',
+ 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)
{
diff --git a/app/helpers.php b/app/helpers.php
index 96972617..43922edb 100644
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -242,7 +242,9 @@ if (! function_exists('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()
{
- return app('parsedown')->text(option('announcement'));
+ $localizedAnnouncement = option('announcement_'.config('app.locale'), option('announcement'));
+
+ return app('parsedown')->text($localizedAnnouncement);
}
}
diff --git a/resources/lang/en/options.yml b/resources/lang/en/options.yml
index 31350faa..b0386010 100644
--- a/resources/lang/en/options.yml
+++ b/resources/lang/en/options.yml
@@ -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 FORBIDDEN. The author reserves the right to pursue relevant responsibilities.
copyright_text:
title: Custom Copyright Text
- description: Placeholders are available in custom copyright text. e.g. {site_name} & {site_url}
+ description: Placeholders are available in custom copyright text. e.g. {site_name} & {site_url}. 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:
title: Custom CSS/JavaScript
@@ -113,7 +113,7 @@ announ:
title: 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:
title: Resource Files
diff --git a/resources/lang/zh_CN/options.yml b/resources/lang/zh_CN/options.yml
index a7b1e8b2..4ac5db98 100644
--- a/resources/lang/zh_CN/options.yml
+++ b/resources/lang/zh_CN/options.yml
@@ -15,7 +15,7 @@ homepage:
description: 对于任何恶意修改页面右下角的版权信息(包括不限于删除、修改作者信息、修改链接指向)的用户,作者保留对其追究责任的权力。
copyright_text:
title: 自定义版权文字
- description: 自定义版权文字内可使用占位符,{site_name} 将会被自动替换为站点名称,{site_url} 会被替换为站点地址。
+ description: 自定义版权文字内可使用占位符,{site_name} 将会被自动替换为站点名称,{site_url} 会被替换为站点地址。每种支持的语言都可以对应不同的自定义版权文字,如果想要编辑某种特定语言下的版权文字,请在右上角切换至该语言后再提交修改。
customJsCss:
title: 自定义 CSS/JavaScript
@@ -113,7 +113,7 @@ announ:
title: 站点公告
announcement:
- description: 可使用 Markdown 进行排版
+ description: 可使用 Markdown 进行排版。每种支持的语言都可以对应不同的站点公告,如果想要编辑某种特定语言下的公告,请在右上角切换至该语言后再提交修改。
resources:
title: 资源文件配置