Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Translate components #560

Merged
merged 1 commit into from
Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/charge-quantity.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default Ember.Component.extend({

quantityHelp: function() {
if (this.get('hasError')) {
return this.get('i18n').t('components.invalid_number');
return this.get('i18n').t('errors.invalidNumber');
}
}.property('hasError')

Expand Down
34 changes: 24 additions & 10 deletions app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default {
lessThanOrEqualTo: 'must be less than or equal to {{count}}',
otherThan: 'must be other than {{count}}',
odd: 'must be odd',
even: 'must be even'
even: 'must be even',
invalidNumber: 'not a valid number'
},
navigation: {
imaging: 'Imaging',
Expand Down Expand Up @@ -889,15 +890,28 @@ export default {
add_medication: 'Add Medication'
}
},
photos: {
how: 'How Do You Want To Add A Photo?',
take_photo: 'Take photo',
upload_photo: 'Upload Photo',
upload_file: 'Upload File',
camera: 'Camera',
photo: 'photo'
},
components: {
invalid_number: 'not a valid number'
chargesByTypeTab: {
charges: 'charges'
},
takePhoto: {
how: 'How Do You Want To Add A Photo?',
takePhoto: 'Take photo',
uploadPhoto: 'Upload Photo',
uploadFile: 'Upload File',
camera: 'Camera',
photo: 'photo',
preview: 'preview'
},
quantityConv: {
unit: 'Unit',
conversion: 'What does 1 {{name}} contain?'
},
quantityCalc: {
result: '{{targetUnit}} total: {{calculated}}'
},
priceList: {
charges: '{{pricingType}} charges'
}
}
};
2 changes: 1 addition & 1 deletion app/templates/components/charges-by-type-tab.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href={{tabHref}} role="tab" data-toggle="pill">{{pricingType}} charges</a>
<a href={{tabHref}} role="tab" data-toggle="pill">{{pricingType}} {{t 'components.chargesByTypeTab.charges'}}</a>
2 changes: 1 addition & 1 deletion app/templates/components/price-list.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="panel detail-section">
<div class="panel-heading">
<h3 class="panel-title">
{{pricingType}} charges
{{t 'components.priceList.charges' pricingType=pricingType}}
</h3>
</div>
<div class="panel-body detail-section-content">
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/quantity-calc.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label>{{targetUnit}} total: {{calculated}} </label>
<label>{{t 'components.quantityCalc.result' targetUnit=targetUnit calculated=calculated}}</label>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/quantity-conv.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="row">
<div class="col-xs-5">
<div class="form-group required {{quantityClass}}">
<label class="control-label">What does 1 {{unitName}} contain?</label>
<label class="control-label">{{t 'components.quantityConv.conversion' name=unitName}}</label>
</div>
</div>
</div>
Expand All @@ -22,7 +22,7 @@
<div class="col-xs-3">
<div class="form-group required {{unitClass}}">
{{#if firstQuantity}}
<label class="control-label">Unit</label>
<label class="control-label">{{t 'components.quantityConv.unit'}}</label>
{{/if}}
{{select-list
class='form-control test-inv-unit'
Expand Down
16 changes: 8 additions & 8 deletions app/templates/components/take-photo.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#if canCaptureVideo}}
<div class="form-group">
<label class="control-label" for="photo-source">{{t 'photos.how'}}</label>
<label class="control-label" for="photo-source">{{t 'components.takePhoto.how'}}</label>
{{select-list
action=photoSourceChange
class='form-control'
Expand All @@ -11,13 +11,13 @@
</div>
{{#if showCameraSelect}}
<div class="form-group">
<label class="control-label" for="camera">{{t 'photos.camera'}}</label>
<label class="control-label" for="camera">{{t 'components.takePhoto.camera'}}</label>
{{select-list
action=cameraChange
class='form-control'
content=videoSources
id='camera'
label=(t 'photos.camera')
label=(t 'components.takePhoto.camera')
optionLabelPath="label"
optionValuePath="id"
value=selectedCamera
Expand All @@ -27,22 +27,22 @@
<div class="camera panel panel-success">
<div class="panel-body">
<div class="col-sm-4">
<h2>Preview</h2>
<h2>{{t 'components.takePhoto.preview'}}</h2>
<video></video>
</div>
<div class="col-sm-2">
</div>
<div class="col-sm-4">
<h2>{{t 'photos.photo'}}</h2>
<h2>{{t 'components.takePhoto.photo'}}</h2>
<canvas id="canvas"></canvas>
</div>
</div>
<div class="panel-footer">
<button class="btn btn-default neutral" {{action 'takePhoto'}}>{{t 'photos.take_photo'}}</button>
<button class="btn btn-default neutral" {{action 'takePhoto'}}>{{t 'components.takePhoto.takePhoto'}}</button>
</div>
</div>
{{/if}}
<div class="fileupload row">
<h2>{{t 'photos.upload_photo'}}</h2>
{{image-upload label=(t 'photos.upload_file') property="fileName" selectedFile=photoFile }}
<h2>{{t 'components.takePhoto.uploadPhoto'}}</h2>
{{image-upload label=(t 'components.takePhoto.uploadFile') property="fileName" selectedFile=photoFile }}
</div>