export text to tranlation file

This commit is contained in:
n313893254 2018-05-17 16:45:30 +08:00
parent c7989d2afa
commit 6375a865b3
10 changed files with 82 additions and 42 deletions

View File

@ -1,22 +1,15 @@
import Component from '@ember/component'; import Component from '@ember/component';
import layout from './template'; import layout from './template';
import { set, get } from '@ember/object'; import { set, get } from '@ember/object';
import { inject as service } from '@ember/service';
const stepOneChoice = [{ const stepOneChoice = [{
id: 'scm', id: 'scm',
}]; }];
const stepsChoices = [{
id: 'task',
name: 'run a script'
},{
id: 'build',
name: 'publish an image'
}
];
export default Component.extend({ export default Component.extend({
layout, layout,
intl: service(),
selectedModel: function(){ selectedModel: function(){
return get(this, 'model')[get(this, 'type')] return get(this, 'model')[get(this, 'type')]
}.property('model','type'), }.property('model','type'),
@ -29,7 +22,19 @@ export default Component.extend({
if(stepMode === 'scm'){ if(stepMode === 'scm'){
set(this, 'stepsTypeChoices', stepOneChoice); set(this, 'stepsTypeChoices', stepOneChoice);
}else{ }else{
set(this, 'stepsTypeChoices', stepsChoices); set(this, 'stepsTypeChoices', this.getStepsChoices());
} }
} },
getStepsChoices() {
const intl = get(this, 'intl')
const stepsChoices = [{
id: 'task',
name: intl.t('newPipelineStep.stepType.build.stepsChoices.task'),
},{
id: 'build',
name: intl.t('newPipelineStep.stepType.build.stepsChoices.build'),
}
];
return stepsChoices
},
}); });

View File

@ -40,4 +40,4 @@
modalOpts=modalOpts modalOpts=modalOpts
modalState=modalState modalState=modalState
}} }}
{{/if}} {{/if}}

View File

@ -1,6 +1,6 @@
<div class="pt-20"></div> <div class="pt-20"></div>
<div class="inline-form"> <div class="inline-form">
<label>Language Environment</label> <label>{{t 'newPipelineStep.stepType.language.header'}}</label>
<div class="pt-10"></div> <div class="pt-10"></div>
{{#each environmentTypes as |envType| }} {{#each environmentTypes as |envType| }}
{{radio-button id=envType.label selection=selectedType value=envType.label disabled=(if (eq modalOpts.type 'review') true false)}} {{radio-button id=envType.label selection=selectedType value=envType.label disabled=(if (eq modalOpts.type 'review') true false)}}
@ -89,21 +89,21 @@
</div> </div>
{{else}} {{else}}
<div class="inline-form"> <div class="inline-form">
<label>{{t 'newPipelineStep.stepType.task.entryPoint'}}</label> <label>{{t 'newPipelineStep.stepType.task.entryPoint.label'}}</label>
<div class="pt-10"></div> <div class="pt-10"></div>
{{input {{input
value=runScriptConfig.entrypoint value=runScriptConfig.entrypoint
placeholder="If you want use the default entrypoint, just leave me empty" placeholder=(t 'newPipelineStep.stepType.task.entryPoint.placeholder')
disabled=(if (eq modalOpts.type 'review') true false) disabled=(if (eq modalOpts.type 'review') true false)
}} }}
</div> </div>
<div class="pt-20"></div> <div class="pt-20"></div>
<div class="inline-form"> <div class="inline-form">
<label>{{t 'newPipelineStep.stepType.task.command'}}</label> <label>{{t 'newPipelineStep.stepType.task.command.label'}}</label>
<div class="pt-10"></div> <div class="pt-10"></div>
{{input {{input
value=runScriptConfig.command value=runScriptConfig.command
placeholder="Arguments of entrypoint" placeholder=(t 'newPipelineStep.stepType.task.command.placeholder')
disabled=(if (eq modalOpts.type 'review') true false) disabled=(if (eq modalOpts.type 'review') true false)
}} }}
</div> </div>
@ -129,4 +129,4 @@
disabled=(if (eq modalOpts.type 'review') true false) disabled=(if (eq modalOpts.type 'review') true false)
}} }}
</div> </div>
{{/if}} {{/if}}

View File

@ -9,7 +9,7 @@
</label> </label>
{{#if selectedModel.sourceCodeConfig.url}} {{#if selectedModel.sourceCodeConfig.url}}
{{#unless selectedRepo.permissions.admin}} {{#unless selectedRepo.permissions.admin}}
{{banner-message color='bg-warning mb-0 mt-10' message='No permission to set webhook'}} {{banner-message color='bg-warning mb-0 mt-10' message=(t 'newPipelineStep.stepType.scm.noWebhook')}}
{{/unless}} {{/unless}}
{{/if}} {{/if}}
</div> </div>
@ -21,7 +21,7 @@
</label> </label>
{{#if selectedModel.sourceCodeConfig.url}} {{#if selectedModel.sourceCodeConfig.url}}
{{#unless selectedRepo.permissions.admin}} {{#unless selectedRepo.permissions.admin}}
{{banner-message color='bg-warning mb-0 mt-10' message='No permission to set webhook'}} {{banner-message color='bg-warning mb-0 mt-10' message=(t 'newPipelineStep.stepType.scm.noWebhook')}}
{{/unless}} {{/unless}}
{{/if}} {{/if}}
</div> </div>
@ -34,7 +34,7 @@
</label> </label>
{{#if selectedModel.sourceCodeConfig.url}} {{#if selectedModel.sourceCodeConfig.url}}
{{#unless selectedRepo.permissions.admin}} {{#unless selectedRepo.permissions.admin}}
{{banner-message color='bg-warning mb-0 mt-10' message='No permission to set webhook'}} {{banner-message color='bg-warning mb-0 mt-10' message=(t 'newPipelineStep.stepType.scm.noWebhook')}}
{{/unless}} {{/unless}}
{{/if}} {{/if}}
</div> </div>
@ -97,4 +97,4 @@
</div> </div>
{{/if}} {{/if}}
</div> </div>

View File

@ -45,7 +45,7 @@
</button> </button>
{{else}} {{else}}
<button class="btn bg-primary" <button class="btn bg-primary"
disabled="disabled" disabled="disabled"
> >
<i class="icon icon-spinner icon-spin"></i> {{t 'authPage.github.testAuth.buttonText.post'}} <i class="icon icon-spinner icon-spin"></i> {{t 'authPage.github.testAuth.buttonText.post'}}
</button> </button>
@ -89,13 +89,13 @@
optionValuePath="url" optionValuePath="url"
readOnly=readOnly readOnly=readOnly
}} }}
<button {{action "fetchPipelineFromRepo"}} <button {{action "fetchPipelineFromRepo"}}
disabled={{if selectedModel.sourceCodeConfig.url fetchPipelineFromRepoState true}} disabled={{if selectedModel.sourceCodeConfig.url fetchPipelineFromRepoState true}}
class="mt-10 btn bg-info" class="mt-10 btn bg-info"
style="color:white;" style="color:white;"
> >
{{#if fetchPipelineFromRepoState}} {{#if fetchPipelineFromRepoState}}
<i class="icon icon-spin icon-spinner"></i> <i class="icon icon-spin icon-spinner"></i>
{{/if}} {{/if}}
{{t 'newPipelineStep.stepType.scm.importFromRepo'}} {{t 'newPipelineStep.stepType.scm.importFromRepo'}}
</button> </button>
@ -118,7 +118,7 @@
<div class="label-wrap"> <div class="label-wrap">
{{radio-button disabled=(or (eq modalOpts.type 'review') (and (not-eq type.value 'only') allowOnly)) id=type.value selection=selectedModel.sourceCodeConfig.branchCondition value=type.value}} {{radio-button disabled=(or (eq modalOpts.type 'review') (and (not-eq type.value 'only') allowOnly)) id=type.value selection=selectedModel.sourceCodeConfig.branchCondition value=type.value}}
<label class="acc-label" for={{type.value}}> <label class="acc-label" for={{type.value}}>
{{type.label}} {{t type.label}}
</label> </label>
</div> </div>
{{#if (not-eq type.value 'all')}} {{#if (not-eq type.value 'all')}}

View File

@ -1,9 +1,9 @@
<section class="header clearfix"> <section class="header clearfix">
<h1>Import pipeline.yml</h1> <h1>{{t 'importPage.header'}}</h1>
</section> </section>
<section class="container-fluid"> <section class="container-fluid">
{{input-text-file mode='yaml' accept=".yml, .yaml" name="pipeline.yml" canChangeName=false value=compose placeholder="pipelinesPage.importPlaceHolder"}} {{input-text-file mode='yaml' accept=".yml, .yaml" name="pipeline.yaml" canChangeName=false value=compose placeholder="pipelinesPage.importPlaceHolder"}}
</section> </section>
{{top-errors errors=errors}} {{top-errors errors=errors}}

View File

@ -1,9 +1,11 @@
<section class="header clearfix"> <section class="header clearfix">
<h1>Add Pipeline</h1> <h1>{{t 'newPipeline.header'}}</h1>
</section> </section>
<div class="mt-10"></div> <div class="mt-10"></div>
<section class="has-tabs clearfix row"> <section class="has-tabs clearfix row">
<h1 class="col span-2" style="margin-top: 8px">{{input type="text" value=model.pipeline.name classNames="form-control" placeholder="Pipeline Name"}}</h1> <h1 class="col span-2" style="margin-top: 8px">{{input type="text" value=model.pipeline.name classNames="form-control"
placeholder=(t 'newPipeline.name.placeholder')}}
</h1>
</section> </section>
<section class="pipeline-container"> <section class="pipeline-container">
@ -30,4 +32,4 @@
<div class="text-center pipeline-wrap-header-button"> <div class="text-center pipeline-wrap-header-button">
{{#save-cancel class="pipeline-save-cancel" createLabel="newPipeline.add" save="save" cancel="cancel"}} {{#save-cancel class="pipeline-save-cancel" createLabel="newPipeline.add" save="save" cancel="cancel"}}
{{/save-cancel}} {{/save-cancel}}
</div> </div>

View File

@ -1,11 +1,11 @@
export default [ export default [
{ {
value: 'only', value: 'only',
label: 'Only the branch' label: 'newPipelineStep.stepType.scm.branchConditionsEnums.only'
}, { }, {
value: 'except', value: 'except',
label: 'Everything but' label: 'newPipelineStep.stepType.scm.branchConditionsEnums.except'
}, { }, {
value: 'all', value: 'all',
label: 'All branches' label: 'newPipelineStep.stepType.scm.branchConditionsEnums.all'
}] }]

View File

@ -166,6 +166,11 @@ newPipelineStep:
importFromRepo: Import Pipeline From Repository importFromRepo: Import Pipeline From Repository
importPipelineSuccess: Imported From Branch <span class="text-info">{branch}</span> importPipelineSuccess: Imported From Branch <span class="text-info">{branch}</span>
importPipelineFail: No Pipeline Found importPipelineFail: No Pipeline Found
branchConditionsEnums:
only: Only the branch
except: Everything but
all: All branches
noWebhook: No permission to set webhook
build: build:
here: here here: here
label: publish an image label: publish an image
@ -182,15 +187,22 @@ newPipelineStep:
pushWarning3: to authenticate it. pushWarning3: to authenticate it.
scope: "Scope: Available to all namespaces in this project" scope: "Scope: Available to all namespaces in this project"
registryExist: Registry {registry} registered with {username} registryExist: Registry {registry} registered with {username}
stepsChoices:
task: run a script
build: publish an image
task: task:
label: run a script label: run a script
runAsService: Run As a Service runAsService: Run As a Service
runAsServiceTip: Click this to make it a long running process/container. runAsServiceTip: Click this to make it a long running process/container.
shellScript: Shell Script shellScript: Shell Script
customEntryPoint: Custom Entrypoint customEntryPoint: Custom Entrypoint
command: Command command:
label: Command
placeholder: Arguments of entrypoint
commandLabel: 'sh' commandLabel: 'sh'
entryPoint: EntryPoint entryPoint:
label: EntryPoint
placeholder: If you want use the default entrypoint, just leave me empty
timeout: Timeout timeout: Timeout
timeoutWarning: If a step does not complete by the specified amount of time (in minutes; at least 3), then the build will be terminated automatically and marked as Fail. timeoutWarning: If a step does not complete by the specified amount of time (in minutes; at least 3), then the build will be terminated automatically and marked as Fail.
minutes: minutes minutes: minutes
@ -204,6 +216,8 @@ newPipelineStep:
targetEnv: targetEnv:
label: Target another environment label: Target another environment
tip: Default target is current environment, if you want target another enviroment, then check this option. tip: Default target is current environment, if you want target another enviroment, then check this option.
language:
header: Language Environment
authPage: authPage:
github: github:
@ -300,3 +314,6 @@ authPage:
pre: Authenticate with GitHub pre: Authenticate with GitHub
preVariable: Enable Pipeline preVariable: Enable Pipeline
post: Creating post: Creating
importPage:
header: Import pipeline.yaml

View File

@ -167,6 +167,11 @@ newPipelineStep:
importFromRepo: 从代码库导入Pipeline配置 importFromRepo: 从代码库导入Pipeline配置
importPipelineSuccess: 从<span class="text-info">{branch}</span>分支导入 importPipelineSuccess: 从<span class="text-info">{branch}</span>分支导入
importPipelineFail: 没有发现Pipeline importPipelineFail: 没有发现Pipeline
branchConditionsEnums:
only: Only the branch
except: Everything but
all: All branches
noWebhook: No permission to set webhook
build: build:
here: 这里 here: 这里
label: 上传镜像 label: 上传镜像
@ -183,15 +188,22 @@ newPipelineStep:
pushWarning3: 去认证 pushWarning3: 去认证
scope: "范围:可用于此项目中的所有命名空间" scope: "范围:可用于此项目中的所有命名空间"
registryExist: 使用{username}注册的镜像仓库{registry} registryExist: 使用{username}注册的镜像仓库{registry}
stepsChoices:
task: run a script
build: 发布镜像
task: task:
label: 运行一个脚本 label: 运行一个脚本
runAsService: 作为服务运行 runAsService: 作为服务运行
runAsServiceTip: 单击此按钮使之成为一个长时间运行的进程/容器 runAsServiceTip: 单击此按钮使之成为一个长时间运行的进程/容器
shellScript: Shell脚本 shellScript: Shell脚本
customEntryPoint: 自定义Entrypoint customEntryPoint: 自定义Entrypoint
command: Command command:
label: 命令
placeholder: Arguments of entrypoint
commandLabel: 'sh' commandLabel: 'sh'
entryPoint: EntryPoint entryPoint:
label: EntryPoint
placeholder: If you want use the default entrypoint, just leave me empty
timeout: 超时时间 timeout: 超时时间
timeoutWarning: 如果某个步骤在指定时间(以分钟为单位默认3分钟)内未完成,则构建将自动终止并标记为“失败” timeoutWarning: 如果某个步骤在指定时间(以分钟为单位默认3分钟)内未完成,则构建将自动终止并标记为“失败”
minutes: 分钟 minutes: 分钟
@ -205,6 +217,8 @@ newPipelineStep:
targetEnv: targetEnv:
label: 目标环境非本环境 label: 目标环境非本环境
tip: 默认目标环境为本环境,如果要将目标环境设定为其他环境,请勾选本选项 tip: 默认目标环境为本环境,如果要将目标环境设定为其他环境,请勾选本选项
language:
header: 语言环境
authPage: authPage:
github: github:
@ -301,3 +315,5 @@ authPage:
pre: GitHub验证 pre: GitHub验证
preVariable: 启用Pipeline preVariable: 启用Pipeline
post: 等待GitHub返回 post: 等待GitHub返回
importPage:
header: 导入 pipeline.yaml