diff --git a/plugins/BcColumn/templates/plugin/BcMail/Mail/default/confirm.php b/plugins/BcColumn/templates/plugin/BcMail/Mail/default/confirm.php index 26d17f025f..c16b75a595 100755 --- a/plugins/BcColumn/templates/plugin/BcMail/Mail/default/confirm.php +++ b/plugins/BcColumn/templates/plugin/BcMail/Mail/default/confirm.php @@ -3,7 +3,11 @@ * メールフォーム確認ページ */ $this->BcBaser->css('admin/jquery-ui/jquery-ui.min', true); -$this->BcBaser->js(array('vendor/jquery-ui-1.11.4.min', 'vendor/i18n/ui.datepicker-ja'), false); +$jsFiles = ['vendor/jquery-ui-1.11.4.min']; +if ($this->BcBaser->isJapaneseLocale()) { + $jsFiles[] = 'vendor/i18n/ui.datepicker-ja'; +} +$this->BcBaser->js($jsFiles, false); if ($freezed) { $this->Mailform->freeze(); } diff --git a/plugins/BcColumn/templates/plugin/BcMail/Mail/default/index.php b/plugins/BcColumn/templates/plugin/BcMail/Mail/default/index.php index 94bd53190a..be69a16101 100755 --- a/plugins/BcColumn/templates/plugin/BcMail/Mail/default/index.php +++ b/plugins/BcColumn/templates/plugin/BcMail/Mail/default/index.php @@ -3,7 +3,11 @@ * メールフォーム */ $this->BcBaser->css('admin/jquery-ui/jquery-ui.min', true); -$this->BcBaser->js(array('vendor/jquery-ui-1.11.4.min', 'vendor/i18n/ui.datepicker-ja'), false); +$jsFiles = ['vendor/jquery-ui-1.11.4.min']; +if ($this->BcBaser->isJapaneseLocale()) { + $jsFiles[] = 'vendor/i18n/ui.datepicker-ja'; +} +$this->BcBaser->js($jsFiles, false); ?> diff --git a/plugins/BcThemeSample/templates/layout/default.php b/plugins/BcThemeSample/templates/layout/default.php index a7b9f2bbf8..8e2383f9ad 100755 --- a/plugins/BcThemeSample/templates/layout/default.php +++ b/plugins/BcThemeSample/templates/layout/default.php @@ -18,9 +18,13 @@ $request = $this->getRequest(); $attributes = $request->getAttributes(); $base = $attributes['base']; +$jsFiles = []; +if ($this->BcBaser->isJapaneseLocale()) { + $jsFiles[] = 'vendor/i18n/ui.datepicker-ja'; +} ?> - + BcBaser->charset() ?> @@ -35,14 +39,13 @@ 'editor' ]) ?> BcBaser->declarationI18n() ?> - BcBaser->js([ + BcBaser->js(array_merge([ 'vendor/jquery-1.11.3.min', 'vendor/jquery-ui-1.11.4.min', 'vendor/jquery.bxslider-4.12.min', 'vendor/jquery.colorbox-1.6.1.min', - 'vendor/i18n/ui.datepicker-ja', 'vendor/jquery-accessibleMegaMenu', - ]); ?> + ], $jsFiles)); ?> BcBaser->js('common.bundle', true, [ 'id' => 'AdminScript', 'data-baseUrl' => h($base), diff --git a/plugins/baser-core/resources/locales/en/baser_core.mo b/plugins/baser-core/resources/locales/en/baser_core.mo index bb0f72aac1..95f37425b1 100644 Binary files a/plugins/baser-core/resources/locales/en/baser_core.mo and b/plugins/baser-core/resources/locales/en/baser_core.mo differ diff --git a/plugins/baser-core/resources/locales/en/baser_core.po b/plugins/baser-core/resources/locales/en/baser_core.po index f79065315a..355c0b1948 100755 --- a/plugins/baser-core/resources/locales/en/baser_core.po +++ b/plugins/baser-core/resources/locales/en/baser_core.po @@ -8577,7 +8577,7 @@ msgstr "Table" #: plugins/bc-admin-third/templates/plugin/BcCustomContent/Admin/element/CustomContents/form.php:54 msgid "テーブルを選択してください" -msgstr "SPlease select Table" +msgstr "Please select Table" #: plugins/bc-admin-third/templates/plugin/BcCustomContent/Admin/element/CustomContents/form.php:58 msgid "コンテンツに紐付けるテーブルを選択します。" @@ -9882,7 +9882,7 @@ msgstr "Received Emails" #: plugins/bc-admin-third/templates/plugin/BcMail/Admin/element/Dashboard/mail_messages.php:34 msgid "{0} 件" -msgstr "%s Items" +msgstr "{0} Items" #: plugins/bc-admin-third/templates/plugin/BcMail/Admin/element/MailContents/form.php:27 msgid "メールフォーム説明文" @@ -15099,15 +15099,10 @@ msgstr "Widgets" #~ msgid "更新日に不正な文字列が入っています。" #~ msgstr "There are invalid strings in Update Date." -#, fuzzy -#~| msgid "PHPの構文エラーが発生しました。" -#~ msgid "草稿欄でPHPの構文エラーが発生しました。" -#~ msgstr "PHP syntax error occured." - #~ msgid "PHPの構文エラーが発生しました。" #~ msgstr "PHP syntax error occured." -#, fuzzy +#~#, fuzzy #~| msgid "このURLの登録は許可されていません。" #~ msgid "スクリプトの入力は許可されていません。" #~ msgstr "This URL's registration is not allowed." diff --git a/plugins/baser-core/src/Utility/BcUtil.php b/plugins/baser-core/src/Utility/BcUtil.php index bed3249eb7..71aee884b4 100644 --- a/plugins/baser-core/src/Utility/BcUtil.php +++ b/plugins/baser-core/src/Utility/BcUtil.php @@ -2317,4 +2317,34 @@ public static function isDevelopmentVersion(): bool return is_dir(ROOT . DS . 'plugins' . DS . 'baser-core'); } + /** + * locale から言語コードを取得する + * + * @param string|null $locale + * @param string $default + * @return string + * @checked + * @noTodo + * @unitTest + */ + public static function getLocaleLanguageCode(?string $locale = null, string $default = 'ja'): string + { + $locale = strtolower((string) ($locale ?? \Cake\I18n\I18n::getLocale())); + return preg_replace('/[_-].*$/', '', $locale) ?: $default; + } + + /** + * 現在の locale が日本語かどうか判定する + * + * @param string|null $locale + * @return bool + * @checked + * @noTodo + * @unitTest + */ + public static function isJapaneseLocale(?string $locale = null): bool + { + return self::getLocaleLanguageCode($locale) === 'ja'; + } + } diff --git a/plugins/baser-core/src/View/Helper/BcBaserHelper.php b/plugins/baser-core/src/View/Helper/BcBaserHelper.php index bf019fe469..6af83e05f1 100755 --- a/plugins/baser-core/src/View/Helper/BcBaserHelper.php +++ b/plugins/baser-core/src/View/Helper/BcBaserHelper.php @@ -2885,4 +2885,30 @@ public function getFullUrl(string $url): string return BcUtil::fullUrl($url); } + /** + * html の lang 属性に使う言語コードを取得する + * + * @return string + * @checked + * @noTodo + * @unitTest + */ + public function getHtmlLang(): string + { + return BcUtil::getLocaleLanguageCode(); + } + + /** + * 現在の locale が日本語かどうか判定する + * + * @return bool + * @checked + * @noTodo + * @unitTest + */ + public function isJapaneseLocale(): bool + { + return BcUtil::isJapaneseLocale(); + } + } diff --git a/plugins/baser-core/src/View/Helper/BcCkeditorHelper.php b/plugins/baser-core/src/View/Helper/BcCkeditorHelper.php index dcc8d10422..29e300eea4 100755 --- a/plugins/baser-core/src/View/Helper/BcCkeditorHelper.php +++ b/plugins/baser-core/src/View/Helper/BcCkeditorHelper.php @@ -11,6 +11,7 @@ namespace BaserCore\View\Helper; +use BaserCore\Utility\BcUtil; use Cake\Core\Plugin; use Cake\View\Helper; use Cake\Utility\Inflector; @@ -207,8 +208,21 @@ public function initialize($config): void */ protected function build($fieldName, $options = []) { + static $langExistsCache = []; + + $editorLanguage = BcUtil::getLocaleLanguageCode(); + + if (!isset($langExistsCache[$editorLanguage])) { + // CKEditor の言語JSがない場合、要求すると 404 で初期化が失敗するため ja にフォールバック + $editorLanguagePath = Plugin::path('BcAdminThird') . 'webroot' . DS . 'js' . DS . 'vendor' . DS . 'ckeditor' . DS . 'lang' . DS . $editorLanguage . '.js'; + $langExistsCache[$editorLanguage] = file_exists($editorLanguagePath); + } + if (!$langExistsCache[$editorLanguage]) { + $editorLanguage = 'ja'; + } + $options = array_merge([ - 'editorLanguage' => 'ja', // 言語 + 'editorLanguage' => $editorLanguage, // 言語 'editorSkin' => 'moono', // スキン 'editorToolType' => 'normal', // ツールバータイプ 'editorToolbar' => [], // ツールバータイプ diff --git a/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php b/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php index 784653bb5d..8951dae20b 100644 --- a/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php +++ b/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php @@ -179,6 +179,27 @@ public static function isInstallModeDataProvider() ]; } + /** + * locale から言語コードを取得する + */ + public function testGetLocaleLanguageCode(): void + { + $this->assertSame('ja', BcUtil::getLocaleLanguageCode('ja_JP')); + $this->assertSame('en', BcUtil::getLocaleLanguageCode('en_US')); + $this->assertSame('fr', BcUtil::getLocaleLanguageCode('fr-FR')); + $this->assertSame('ja', BcUtil::getLocaleLanguageCode('', 'ja')); + } + + /** + * 日本語 locale かどうか判定する + */ + public function testIsJapaneseLocale(): void + { + $this->assertTrue(BcUtil::isJapaneseLocale('ja_JP')); + $this->assertTrue(BcUtil::isJapaneseLocale('ja')); + $this->assertFalse(BcUtil::isJapaneseLocale('en_US')); + } + /** * Test getVersion * @return void @@ -1545,7 +1566,7 @@ public function testIsSameReferrerAsCurrent($referer, $expected) public static function isSameReferrerAsCurrentDataProvider() { return [ - // refererがnullの場合  + // refererがnullの場合 [null, false], // referer!=$siteDomainの場合 ["/baser/admin", false], diff --git a/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php b/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php index cb3b05d805..693cfc008e 100644 --- a/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php +++ b/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php @@ -458,6 +458,34 @@ public function testI18nScript() $this->assertStringContainsString($encoded2, $result); } + /** + * html lang 用の言語コードを取得する + */ + public function testGetHtmlLang(): void + { + $originalLocale = \Cake\I18n\I18n::getLocale(); + try { + \Cake\I18n\I18n::setLocale('ja_JP'); + $this->assertSame('ja', $this->BcBaser->getHtmlLang()); + } finally { + \Cake\I18n\I18n::setLocale($originalLocale); + } + } + + /** + * 現在の locale が日本語かどうか判定する + */ + public function testIsJapaneseLocale(): void + { + $originalLocale = \Cake\I18n\I18n::getLocale(); + try { + \Cake\I18n\I18n::setLocale('ja_JP'); + $this->assertTrue($this->BcBaser->isJapaneseLocale()); + } finally { + \Cake\I18n\I18n::setLocale($originalLocale); + } + } + /** * Test BcBaser->flashが適切なflashメッセージを出力してるかテスト * diff --git a/plugins/baser-core/tests/TestCase/View/Helper/BcCkeditorHelperTest.php b/plugins/baser-core/tests/TestCase/View/Helper/BcCkeditorHelperTest.php index d5b3d1167a..a5a5077e9a 100644 --- a/plugins/baser-core/tests/TestCase/View/Helper/BcCkeditorHelperTest.php +++ b/plugins/baser-core/tests/TestCase/View/Helper/BcCkeditorHelperTest.php @@ -14,6 +14,8 @@ use BaserCore\View\BcAdminAppView; use BaserCore\TestSuite\BcTestCase; use BaserCore\View\Helper\BcCkeditorHelper; +use Cake\Core\Plugin; +use Cake\I18n\I18n; use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; /** @@ -111,6 +113,50 @@ public function testBuild() $this->assertMatchesRegularExpression('/let config = JSON\.parse\(\'\{"ckeditorField/', $jsResult); } + /** + * Test build locale-aware editor language + */ + public function testBuildEditorLanguageByLocale() + { + $this->BcCkeditor->getView()->setTheme('BcAdminThird'); + $request = $this->BcCkeditor->getView()->getRequest()->withAttribute('formTokenData', ['dummy']); + $this->BcCkeditor->getView()->setRequest($request); + $this->BcCkeditor->BcAdminForm->create(); + + $originalLocale = I18n::getLocale(); + try { + I18n::setLocale('en_US'); + $this->execPrivateMethod($this->BcCkeditor, 'build', ['Page.contents', []]); + $jsResult = $this->BcCkeditor->getView()->fetch('script'); + $editorLanguagePath = Plugin::path('BcAdminThird') . 'webroot' . DS . 'js' . DS . 'vendor' . DS . 'ckeditor' . DS . 'lang' . DS . 'en.js'; + $this->assertFileExists($editorLanguagePath); + $this->assertStringContainsString('"language":"en"', $jsResult); + } finally { + I18n::setLocale($originalLocale); + } + } + + /** + * Test build falls back to ja for unsupported locale + */ + public function testBuildEditorLanguageFallbackToJa() + { + $this->BcCkeditor->getView()->setTheme('BcAdminThird'); + $request = $this->BcCkeditor->getView()->getRequest()->withAttribute('formTokenData', ['dummy']); + $this->BcCkeditor->getView()->setRequest($request); + $this->BcCkeditor->BcAdminForm->create(); + + $originalLocale = I18n::getLocale(); + try { + I18n::setLocale('fr_FR'); + $this->execPrivateMethod($this->BcCkeditor, 'build', ['Page.contents', []]); + $jsResult = $this->BcCkeditor->getView()->fetch('script'); + $this->assertStringContainsString('"language":"ja"', $jsResult); + } finally { + I18n::setLocale($originalLocale); + } + } + /** * Test setEditorToolbar */ diff --git a/plugins/bc-admin-third/templates/Admin/layout/default.php b/plugins/bc-admin-third/templates/Admin/layout/default.php index 5882d6f1d4..2539aa6526 100644 --- a/plugins/bc-admin-third/templates/Admin/layout/default.php +++ b/plugins/bc-admin-third/templates/Admin/layout/default.php @@ -24,9 +24,14 @@ $request = $this->getRequest(); $attributes = $request->getAttributes(); $base = $attributes['base']; +$jsFiles = []; +if ($this->BcBaser->isJapaneseLocale()) { + $jsFiles[] = 'vendor/i18n/ui.datepicker-ja'; + $jsFiles[] = 'vendor/jquery.validate_ja'; +} ?> - + @@ -68,18 +73,16 @@ 'bcConfirmAlertMessage1' => __d('baser_core', 'メッセージを指定してください。'), 'bcConfirmAlertMessage2' => __d('baser_core', 'コールバック処理が登録されていません。') ], ['block' => false]) ?> - BcBaser->js([ + BcBaser->js(array_merge([ 'admin/vendor.bundle', 'vendor/jquery-3.5.1.min', 'vendor/jquery.bt.min', 'vendor/jquery-contextMenu-2.2.0/jquery.contextMenu.min', 'vendor/jquery-ui-1.13.0.min', - 'vendor/i18n/ui.datepicker-ja', 'vendor/jquery.validate.1.19.3.min', - 'vendor/jquery.validate_ja', 'vendor/jquery.form-2.94', 'vendor/jquery.timepicker' - ]) ?> + ], $jsFiles)) ?> BcBaser->js('admin/common.bundle', true, [ 'id' => 'AdminScript', 'data-baseUrl' => h($base), diff --git a/plugins/bc-admin-third/templates/Admin/layout/error.php b/plugins/bc-admin-third/templates/Admin/layout/error.php index 4aa17681a2..4debab9e96 100644 --- a/plugins/bc-admin-third/templates/Admin/layout/error.php +++ b/plugins/bc-admin-third/templates/Admin/layout/error.php @@ -1,5 +1,11 @@ +BcBaser->isJapaneseLocale()) { + $jsFiles[] = 'vendor/i18n/ui.datepicker-ja'; +} +?> - + @@ -12,15 +18,14 @@ 'admin/style', ]) ?> fetch('css') ?> - BcBaser->js([ + BcBaser->js(array_merge([ 'admin/vendor.bundle', 'vendor/vue.min', 'vendor/jquery-3.5.1.min', 'vendor/jquery.bt.min', - 'vendor/jquery-ui-1.11.4.min.js', - 'vendor/i18n/ui.datepicker-ja', + 'vendor/jquery-ui-1.13.0.min', 'vendor/jquery.timepicker', - ]) ?> + ], $jsFiles)) ?> fetch('script') ?> diff --git a/plugins/bc-admin-third/webroot/js/vendor/ckeditor/lang/en.js b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/lang/en.js new file mode 100644 index 0000000000..f8d1a004b2 --- /dev/null +++ b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/lang/en.js @@ -0,0 +1,5 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.lang['en']={"wsc":{"btnIgnore":"Ignore","btnIgnoreAll":"Ignore All","btnReplace":"Replace","btnReplaceAll":"Replace All","btnUndo":"Undo","changeTo":"Change to","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Spell checker not installed. Do you want to download it now?","manyChanges":"Spell check complete: %1 words changed","noChanges":"Spell check complete: No words changed","noMispell":"Spell check complete: No misspellings found","noSuggestions":"- No suggestions -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"Not in dictionary","oneChange":"Spell check complete: One word changed","progress":"Spell check in progress...","title":"Spell Checker","toolbar":"Check Spelling"},"undo":{"redo":"Redo","undo":"Undo"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"templates":{"button":"Templates","emptyListMsg":"(No templates defined)","insertOption":"Replace actual contents","options":"Template Options","selectPromptMsg":"Please select the template to open in the editor","title":"Content Templates"},"table":{"border":"Border size","caption":"Caption","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Delete Cells","merge":"Merge Cells","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Cell padding","cellSpace":"Cell spacing","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Delete Columns"},"columns":"Columns","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Table Properties","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Delete Rows"},"rows":"Rows","summary":"Summary","title":"Table Properties","toolbar":"Table","widthPc":"percent","widthPx":"pixels","widthUnit":"width unit"},"stylescombo":{"label":"Styles","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"specialchar":{"options":"Special Character Options","title":"Select Special Character","toolbar":"Insert Special Character"},"sourcearea":{"toolbar":"Source"},"smiley":{"options":"Smiley Options","title":"Insert a Smiley","toolbar":"Smiley"},"showblocks":{"toolbar":"Show Blocks"},"selectall":{"toolbar":"Select All"},"scayt":{"btn_about":"About SCAYT","btn_dictionaries":"Dictionaries","btn_disable":"Disable SCAYT","btn_enable":"Enable SCAYT","btn_langs":"Languages","btn_options":"Options","text_title":"Spell Check As You Type"},"save":{"toolbar":"Save"},"removeformat":{"toolbar":"Remove Format"},"print":{"toolbar":"Print"},"preview":{"preview":"Preview"},"pastetext":{"button":"Paste as plain text","title":"Paste as Plain Text"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Paste from Word","toolbar":"Paste from Word"},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"newpage":{"toolbar":"New Page"},"maximize":{"maximize":"Maximize","minimize":"Minimize"},"magicline":{"title":"Insert paragraph here"},"liststyle":{"armenian":"Armenian numbering","bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","decimalLeadingZero":"Decimal leading zero (01, 02, 03, etc.)","disc":"Disc","georgian":"Georgian numbering (an, ban, gan, etc.)","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerGreek":"Lower Greek (alpha, beta, gamma, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"list":{"bulletedlist":"Insert/Remove Bulleted List","numberedlist":"Insert/Remove Numbered List"},"link":{"acccessKey":"Access Key","advanced":"Advanced","advisoryContentType":"Advisory Content Type","advisoryTitle":"Advisory Title","anchor":{"toolbar":"Anchor","menu":"Edit Anchor","title":"Anchor Properties","name":"Anchor Name","errorName":"Please type the anchor name","remove":"Remove Anchor"},"anchorId":"By Element Id","anchorName":"By Anchor Name","charset":"Linked Resource Charset","cssClasses":"Stylesheet Classes","emailAddress":"E-Mail Address","emailBody":"Message Body","emailSubject":"Message Subject","id":"Id","info":"Link Info","langCode":"Language Code","langDir":"Language Direction","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","menu":"Edit Link","name":"Name","noAnchors":"(No anchors available in the document)","noEmail":"Please type the e-mail address","noUrl":"Please type the link URL","other":"","popupDependent":"Dependent (Netscape)","popupFeatures":"Popup Window Features","popupFullScreen":"Full Screen (IE)","popupLeft":"Left Position","popupLocationBar":"Location Bar","popupMenuBar":"Menu Bar","popupResizable":"Resizable","popupScrollBars":"Scroll Bars","popupStatusBar":"Status Bar","popupToolbar":"Toolbar","popupTop":"Top Position","rel":"Relationship","selectAnchor":"Select an Anchor","styles":"Style","tabIndex":"Tab Index","target":"Target","targetFrame":"","targetFrameName":"Target Frame Name","targetPopup":"","targetPopupName":"Popup Window Name","title":"Link","toAnchor":"Link to anchor in the text","toEmail":"E-mail","toUrl":"URL","toolbar":"Link","type":"Link Type","unlink":"Unlink","upload":"Upload"},"language":{"button":"Set language","remove":"Remove language"},"justify":{"block":"Justify","center":"Center","left":"Align Left","right":"Align Right"},"indent":{"indent":"Increase Indent","outdent":"Decrease Indent"},"image":{"alt":"Alternative Text","border":"Border","btnUpload":"Send it to the Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"HSpace","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Image Info","linkTab":"Link","lockRatio":"Lock Ratio","menu":"Image Properties","resetSize":"Reset Size","title":"Image Properties","titleButton":"Image Button Properties","upload":"Upload","urlMissing":"Image source URL is missing.","vSpace":"VSpace","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"iframe":{"border":"Show frame border","noUrl":"Please type the iframe URL","scrolling":"Enable scrollbars","title":"IFrame Properties","toolbar":"IFrame"},"horizontalrule":{"toolbar":"Insert Horizontal Line"},"forms":{"button":{"title":"Button Properties","text":"Text (Value)","type":"Type","typeBtn":"Button","typeSbm":"Submit","typeRst":"Reset"},"checkboxAndRadio":{"checkboxTitle":"Checkbox Properties","radioTitle":"Radio Button Properties","value":"Value","selected":"Selected","required":"Required"},"form":{"title":"Form Properties","menu":"Form Properties","action":"Action","method":"Method","encoding":"Encoding"},"hidden":{"title":"Hidden Field Properties","name":"Name","value":"Value"},"select":{"title":"Selection Field Properties","selectInfo":"Select Info","opAvail":"Available Options","value":"Value","size":"Size","lines":"lines","chkMulti":"Allow multiple selections","required":"Required","opText":"Text","opValue":"Value","btnAdd":"Add","btnModify":"Modify","btnUp":"Up","btnDown":"Down","btnSetValue":"Set as selected value","btnDelete":"Delete"},"textarea":{"title":"Textarea Properties","cols":"Columns","rows":"Rows"},"textfield":{"title":"Text Field Properties","name":"Name","value":"Value","charWidth":"Character Width","maxChars":"Maximum Characters","required":"Required","type":"Type","typeText":"Text","typePass":"Password","typeEmail":"Email","typeSearch":"Search","typeTel":"Telephone Number","typeUrl":"URL"}},"format":{"label":"Format","panelTitle":"Paragraph Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Formatted"},"font":{"fontSize":{"label":"Size","voiceLabel":"Font Size","panelTitle":"Font Size"},"label":"Font","panelTitle":"Font Name","voiceLabel":"Font"},"flash":{"access":"Script Access","accessAlways":"Always","accessNever":"Never","accessSameDomain":"Same domain","alignAbsBottom":"Abs Bottom","alignAbsMiddle":"Abs Middle","alignBaseline":"Baseline","alignTextTop":"Text Top","bgcolor":"Background color","chkFull":"Allow Fullscreen","chkLoop":"Loop","chkMenu":"Enable Flash Menu","chkPlay":"Auto Play","flashvars":"Variables for Flash","hSpace":"HSpace","properties":"Flash Properties","propertiesTab":"Properties","quality":"Quality","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"Scale","scaleAll":"Show all","scaleFit":"Exact Fit","scaleNoBorder":"No Border","title":"Flash Properties","vSpace":"VSpace","validateHSpace":"HSpace must be a number.","validateSrc":"URL must not be empty.","validateVSpace":"VSpace must be a number.","windowMode":"Window mode","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"find":{"find":"Find","findOptions":"Find Options","findWhat":"Find what:","matchCase":"Match case","matchCyclic":"Match cyclic","matchWord":"Match whole word","notFoundMsg":"The specified text was not found.","replace":"Replace","replaceAll":"Replace All","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Replace with:","title":"Find and Replace"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Advisory Title","cssClassInputLabel":"Stylesheet Classes","edit":"Edit Div","inlineStyleInputLabel":"Inline Style","langDirLTRLabel":"Left to Right (LTR)","langDirLabel":"Language Direction","langDirRTLLabel":"Right to Left (RTL)","languageCodeInputLabel":" Language Code","remove":"Remove Div","styleSelectLabel":"Style","title":"Create Div Container","toolbar":"Create Div Container"},"contextmenu":{"options":"Context Menu Options"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"colorbutton":{"auto":"Automatic","bgColorTitle":"Background Color","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White"},"more":"More Colors...","panelTitle":"Colors","textColorTitle":"Text Color"},"clipboard":{"copy":"Copy","copyError":"Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).","cut":"Cut","cutError":"Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).","paste":"Paste","pasteArea":"Paste Area","pasteMsg":"Please paste inside the following box using the keyboard (Ctrl/Cmd+V) and hit OK","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"Paste"},"button":{"selectedLabel":"%1 (Selected)"},"blockquote":{"toolbar":"Block Quote"},"bidi":{"ltr":"Text direction from left to right","rtl":"Text direction from right to left"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strikethrough","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"about":{"copy":"Copyright © $1. All rights reserved.","dlgTitle":"About CKEditor","help":"Check $1 for help.","moreInfo":"For licensing information please visit our web site:","title":"About CKEditor","userGuide":"CKEditor User's Guide"},"editor":"Rich Text Editor","editorPanel":"Rich Text Editor panel","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protocol","upload":"Upload","uploadSubmit":"Send it to the Server","image":"Image","flash":"Flash","form":"Form","checkbox":"Checkbox","radio":"Radio Button","textField":"Text Field","textarea":"Textarea","hiddenField":"Hidden Field","button":"Button","select":"Selection Field","imageButton":"Image Button","notSet":"","id":"Id","name":"Name","langDir":"Language Direction","langDirLtr":"Left to Right (LTR)","langDirRtl":"Right to Left (RTL)","langCode":"Language Code","longDescr":"Long Description URL","cssClass":"Stylesheet Classes","advisoryTitle":"Advisory Title","cssStyle":"Style","ok":"OK","cancel":"Cancel","close":"Close","preview":"Preview","resize":"Resize","generalTab":"General","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"You have changed some options. Are you sure you want to close the dialog window?","options":"Options","target":"Target","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","styles":"Style","cssClasses":"Stylesheet Classes","width":"Width","height":"Height","align":"Alignment","alignLeft":"Left","alignRight":"Right","alignCenter":"Center","alignJustify":"Justify","alignTop":"Top","alignMiddle":"Middle","alignBottom":"Bottom","alignNone":"None","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1, unavailable"}}; \ No newline at end of file diff --git a/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/en.js b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/en.js new file mode 100644 index 0000000000..47d1db7ee6 --- /dev/null +++ b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/en.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang('draft', 'en', { + buttonDraft: 'Draft', + buttonPublish: 'Publish', + buttonCopyDraft: 'Copy Draft to Publish', + buttonCopyPublish: 'Copy Publish to Draft' +}); diff --git a/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/ja.js b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/ja.js new file mode 100644 index 0000000000..8cdf37e5f4 --- /dev/null +++ b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/ja.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang('draft', 'ja', { + buttonDraft: '草 稿', + buttonPublish: '本 稿', + buttonCopyDraft: '草稿を本稿にコピー', + buttonCopyPublish: '本稿を草稿にコピー' +}); diff --git a/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/plugin.js b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/plugin.js index 3557030c8b..0baf9be489 100755 --- a/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/plugin.js +++ b/plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/plugin.js @@ -19,6 +19,7 @@ */ CKEDITOR.plugins.add('draft', { + lang: 'en,ja', /** * 初期化処理 */ @@ -46,10 +47,10 @@ CKEDITOR.plugins.add('draft', if ( editor.ui.addButton ) { - editor.ui.addButton( 'Draft', { label : '草 稿', command : 'changeDraft'}); - editor.ui.addButton( 'Publish', { label : '本 稿', command : 'changePublish'}); - editor.ui.addButton( 'CopyDraft', { label : '草稿を本稿にコピー', command : 'copyDraft'}); - editor.ui.addButton( 'CopyPublish', { label : '本稿を草稿にコピー', command : 'copyPublish'}); + editor.ui.addButton( 'Draft', { label : editor.lang.draft.buttonDraft, command : 'changeDraft'}); + editor.ui.addButton( 'Publish', { label : editor.lang.draft.buttonPublish, command : 'changePublish'}); + editor.ui.addButton( 'CopyDraft', { label : editor.lang.draft.buttonCopyDraft, command : 'copyDraft'}); + editor.ui.addButton( 'CopyPublish', { label : editor.lang.draft.buttonCopyPublish, command : 'copyPublish'}); } editor.on('pluginsLoaded', function(event) { event.editor.draftMode = 'publish'; diff --git a/plugins/bc-front/templates/layout/default.php b/plugins/bc-front/templates/layout/default.php index 824e715936..664b4dbd3c 100755 --- a/plugins/bc-front/templates/layout/default.php +++ b/plugins/bc-front/templates/layout/default.php @@ -19,9 +19,13 @@ $request = $this->getRequest(); $attributes = $request->getAttributes(); $base = $attributes['base']; +$jsFiles = []; +if ($this->BcBaser->isJapaneseLocale()) { + $jsFiles[] = 'vendor/i18n/ui.datepicker-ja'; +} ?> - + BcBaser->charset() ?> @@ -36,14 +40,13 @@ 'editor' ]) ?> BcBaser->declarationI18n() ?> - BcBaser->js([ + BcBaser->js(array_merge([ 'vendor/jquery-1.11.3.min', 'vendor/jquery-ui-1.11.4.min', 'vendor/jquery.bxslider-4.12.min', 'vendor/jquery.colorbox-1.6.1.min', - 'vendor/i18n/ui.datepicker-ja', 'vendor/jquery-accessibleMegaMenu', - ]); ?> + ], $jsFiles)); ?> BcBaser->js('common.bundle', true, [ 'id' => 'AdminScript', 'data-baseUrl' => h($base),