从CakePHP的批处理文件自动提取i18n的shell进程 [英] CakePHP automating i18n extract shell process from batch file

查看:177
本文介绍了从CakePHP的批处理文件自动提取i18n的shell进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要创建的CakePHP 2.3的i18n默认锅文件,在Windows中,我创建这样一个bat文件。

To create default pot file for CakePHP 2.3 i18n, in windows I created a bat file like this.

CD F:\mywork\app\View
F:\mywork\lib\Cake\Console\cake.bat i18n extract

但我得到这个错误:

But I get this error:

Your database configuration was not found. Take a moment to create one.
---------------------------------------------------------------
Database Configuration:
---------------------------------------------------------------
Name:
[default] >

但在应用程序\\ CONFIG \\ database.php中文件我有数据库的配置和他们工作得很好。所以我删除提取物的说法。

But inside app\Config\database.php file I have database configurations and they work well. So I removed extract argument.

我创造这样一个新的BAT文件。

I created a new bat file like this.

CD F:\mywork\app\View
F:\mywork\lib\Cake\Console\cake.bat i18n

当我运行批处理文件,我得到这样的:

When I run bat file, I get this:

[E]xtract POT file from sources
[I]nitialize i18n database table
[H]elp
[Q]uit
What would you like to do? (E/I/H/Q)

我选择电子邮件即可。我得到这样的:

Current paths: None
What is the path you would like to extract?
[Q]uit [D]one
[F:\mywork\app\View\] >

我preSS 输入。我得到这样的:

Current paths: F:\mywork\app\View\
What is the path you would like to extract?
[Q]uit [D]one
[D] >

我preSS 输入。我得到这样的:

Would you like to extract the messages from the CakePHP core? (y/n)
[n] >

我preSS 输入。我得到这样的:

What is the path you would like to output?
[Q]uit
[F:\mywork\app\View\Locale] >

我粘贴: F:\\ MYWORK \\程序\\区域设置\\工程\\ LC_MESSAGES
比我得到这样的:

I paste this: F:\mywork\app\Locale\eng\LC_MESSAGES. Than I get this:

Would you like to merge all domains strings into the default.pot file? (y/n)
[n] >

我preSS 输入。蛋糕开始处理所有查看文件。创建锅文件。然后我得到这样的:

I press Enter. cake starts to process all View files. Creates pot file. Then I get this:

[E]xtract POT file from sources
[I]nitialize i18n database table
[H]elp
[Q]uit
What would you like to do? (E/I/H/Q)

我preSS 问:并程序结束。

是否有可能使自动化这一过程?设置路径事前,而不是通过手工选择的选项?

Is it possible to automatize this process ? Setting paths beforehand and not selecting options by hand ?

推荐答案

刚工作的同样的问题。您需要启动

Just working on the same issue. You need to start

cake.bat i18n extract

从/应用程序路径,而不是从该视图的路径。该过程可以是自动化的文件的逗号分隔的列表:

from the /app path and not from the view path. The process can be automated for comma-seperated list of files:

cake i18n extract --files %ListOfFiles% --ignore-model-validation --output .\Locale\eng\LC_MESSAGES\ --paths .\View  --overwrite no --extract-core no --merge no

也应该没有文件的列表工作:

Should also work without a list of files:

cake i18n extract --ignore-model-validation --output .\Locale\eng\LC_MESSAGES --paths .\View  --overwrite no --extract-core no --merge no

这篇关于从CakePHP的批处理文件自动提取i18n的shell进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆