CakePHP4のメモ
![]() |
13 |
389 views
以下を実行する。
bin\cake i18n extract
以下のように回答していく。
c:\xampp\htdocs\cakeblog>bin\cake i18n extract
Current paths: None
What is the path you would like to extract?
[Q]uit [D]one
[C:\xampp\htdocs\cakeblog\src\] >Enter(QでもDでもない)
Current paths: C:\xampp\htdocs\cakeblog\src\
What is the path you would like to extract?
[Q]uit [D]one
[C:\xampp\htdocs\cakeblog\templates\] >Enter(QでもDでもない)
Current paths: C:\xampp\htdocs\cakeblog\src\, C:\xampp\htdocs\cakeblog\templates\
What is the path you would like to extract?
[Q]uit [D]one
[D] >Enter(QでもDでもない)
Would you like to extract the messages from the CakePHP core? (y/n)
[n] >Enter(QでもDでもない)
What is the path you would like to output?
[Q]uit
[C:\xampp\htdocs\cakeblog\resources\locales\] >Enter(QでもDでもない)
Extracting...
-------------------------------------------------------------------------------
Paths:
C:\xampp\htdocs\cakeblog\src\
C:\xampp\htdocs\cakeblog\templates\
Output Directory: C:\xampp\htdocs\cakeblog\resources\locales\
-------------------------------------------------------------------------------
==========================================================================> 100%
Done.
実行するとresources/cake.potとresources/default.potが作成される。
default.potをresource/locales/ja_JPの下にコピーする。
ファイル名はdefault.potからdefault.poに変更する。
次にconfig/app.phpに20行目を追記する。
'App' => [
'namespace' => 'App',
'encoding' => env('APP_ENCODING', 'UTF-8'),
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
'base' => false,
'dir' => 'src',
'webroot' => 'webroot',
'wwwRoot' => WWW_ROOT,
//'baseUrl' => env('SCRIPT_NAME'),
'fullBaseUrl' => false,
'imageBaseUrl' => 'img/',
'cssBaseUrl' => 'css/',
'jsBaseUrl' => 'js/',
'paths' => [
'plugins' => [ROOT . DS . 'plugins' . DS],
'templates' => [ROOT . DS . 'templates' . DS],
'locales' => [RESOURCES . 'locales' . DS],
],
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'ja_JP'),
],
Page 12 of 34.
1.php_xdebug-3.0.4-8.0-vs16-x86_64.dll
すぺぺぺ
本サイトの作成者。
プログラムは趣味と勉強を兼ねて、のんびり本サイトを作っています。
フレームワークはdjango。
ChatGPTで自動プログラム作成に取り組み中。
https://www.osumoi-stdio.com/novel/