fix #3910 javascriptの外部モジュールの英語対応#4408
Open
kaburk wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
本PRは、locale に応じて JavaScript の外部モジュール(jQuery UI datepicker の日本語 i18n、jQuery validate の日本語メッセージ、CKEditor 言語/プラグイン文言)を切り替え、英語環境でも 404 等で初期化失敗しないようにする対応です。併せて、各レイアウトの <html lang> を現在の locale から導出した言語コードに追従させています。
Changes:
- 日本語 locale のときだけ
ui.datepicker-ja/jquery.validate_jaを読み込むよう、各レイアウト・テンプレートの JS 読み込みを条件分岐 <html lang>をBcBaserHelper::getHtmlLang()で動的に設定- CKEditor の言語を locale ベースで決定し、未対応 locale は
jaにフォールバック(テスト追加、CKEditor en 言語ファイル追加、draft プラグインの多言語化)
Reviewed changes
Copilot reviewed 13 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/BcThemeSample/templates/layout/default.php | locale に応じて datepicker 日本語 i18n の読込を切替、<html lang> を動的化 |
| plugins/BcColumn/templates/plugin/BcMail/Mail/default/index.php | 日本語 locale のときのみ datepicker 日本語 i18n を追加読込 |
| plugins/BcColumn/templates/plugin/BcMail/Mail/default/confirm.php | 日本語 locale のときのみ datepicker 日本語 i18n を追加読込 |
| plugins/bc-front/templates/layout/default.php | locale に応じて datepicker 日本語 i18n の読込を切替、<html lang> を動的化 |
| plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/plugin.js | draft プラグインのボタン文言を CKEditor の言語リソース参照に変更(en/ja 対応) |
| plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/ja.js | draft プラグイン日本語リソースを追加 |
| plugins/bc-admin-third/webroot/js/vendor/ckeditor/plugins/draft/lang/en.js | draft プラグイン英語リソースを追加 |
| plugins/bc-admin-third/webroot/js/vendor/ckeditor/lang/en.js | CKEditor 本体の英語言語ファイルを追加(language=en で 404 回避) |
| plugins/bc-admin-third/templates/Admin/layout/error.php | 日本語 locale のときのみ datepicker 日本語 i18n を読込、<html lang> を動的化 |
| plugins/bc-admin-third/templates/Admin/layout/default.php | 日本語 locale のときのみ datepicker/validate 日本語リソースを読込、<html lang> を動的化 |
| plugins/baser-core/tests/TestCase/View/Helper/BcCkeditorHelperTest.php | CKEditor 言語が locale に追従すること/未対応 locale で ja に落ちることのテスト追加 |
| plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php | getHtmlLang() / isJapaneseLocale() のテスト追加 |
| plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php | getLocaleLanguageCode() / isJapaneseLocale() のテスト追加、コメントの全角スペース修正 |
| plugins/baser-core/src/View/Helper/BcCkeditorHelper.php | locale から CKEditor language を決定し、言語JSが無い場合は ja にフォールバック |
| plugins/baser-core/src/View/Helper/BcBaserHelper.php | getHtmlLang() / isJapaneseLocale() を追加(BcUtil ラップ) |
| plugins/baser-core/src/Utility/BcUtil.php | locale から言語コード取得・日本語判定ユーティリティを追加 |
| plugins/baser-core/resources/locales/en/baser_core.po | 英訳の誤り修正(タイポ、プレースホルダ形式の整合) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
よろしくお願いします!