-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup translations
- Loading branch information
Showing
27 changed files
with
2,437 additions
and
307 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<div class="contribute-modal" style={{blobcolor @data.selected.title}}> | ||
<button type="button" class="modal-close" {{on 'click' @close}}><FaIcon @icon='close'/></button> | ||
{{svg-jar @data.selected.icon class='illustration'}} | ||
<p class="modal-title">{{@data.selected.title}}</p> | ||
<p class="modal-description">{{@data.selected.description}}</p> | ||
<button type="button" class="button button-secondary" {{on 'click' @close}}>I'll come back</button> | ||
<p class="modal-title">{{t @data.selected.title}}</p> | ||
<p class="modal-description">{{t @data.selected.description}}</p> | ||
<button type="button" class="button button-secondary" {{on 'click' @close}}>{{t "contribute.cancel"}}</button> | ||
{{#if @data.selected.completed}} | ||
<button type="button" class="button complete" {{on 'click' (fn @data.removeSquare @close)}}>Remove from my roles</button> | ||
<button type="button" class="button complete" {{on 'click' (fn @data.removeSquare @close)}}>{{t "contribute.remove"}}</button> | ||
{{else}} | ||
<button type="button" class="button complete" {{on 'click' (fn @data.completeSquare @close)}}>Add to my roles</button> | ||
<button type="button" class="button complete" {{on 'click' (fn @data.completeSquare @close)}}>{{t "contribute.add"}}</button> | ||
{{/if}} | ||
</div> | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Controller from '@ember/controller'; | ||
import { service } from '@ember/service'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class ApplicationController extends Controller { | ||
@service intl; | ||
|
||
@tracked activeLocale = this.intl.primaryLocale; | ||
|
||
locales = this.intl.locales.slice(1); | ||
|
||
@action | ||
changeLocale(locale) { | ||
this.activeLocale = locale.target.value; | ||
this.intl.setLocale(this.activeLocale); | ||
localStorage.setItem('locale', this.activeLocale); | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export default { | ||
time: { | ||
hhmmss: { | ||
hour: 'numeric', | ||
minute: 'numeric', | ||
second: 'numeric', | ||
}, | ||
}, | ||
date: { | ||
hhmmss: { | ||
hour: 'numeric', | ||
minute: 'numeric', | ||
second: 'numeric', | ||
}, | ||
}, | ||
number: { | ||
compact: { notation: 'compact' }, | ||
EUR: { | ||
style: 'currency', | ||
currency: 'EUR', | ||
}, | ||
USD: { | ||
style: 'currency', | ||
currency: 'USD', | ||
}, | ||
}, | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const langToCode = { | ||
en: 'US', | ||
hi: 'IN', | ||
zh: 'CN', | ||
nl: 'NL', | ||
de: 'DE', | ||
es: 'ES', | ||
fr: 'FR', | ||
}; | ||
|
||
export default function countryflag(countryCode /*, named*/) { | ||
const codePoints = langToCode[countryCode.split('-')[0]] | ||
.split('') | ||
.map((char) => 127397 + char.charCodeAt()); | ||
return String.fromCodePoint(...codePoints); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const codeToName = { | ||
en: 'English', | ||
hi: 'हिंदी', | ||
zh: '汉语 ', | ||
nl: 'Nederlands', | ||
de: 'Deutsch', | ||
es: 'Español', | ||
fr: 'Francais', | ||
}; | ||
|
||
export default function language(countryCode /*, named*/) { | ||
return codeToName[countryCode]; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Route from '@ember/routing/route'; | ||
import { service } from '@ember/service'; | ||
|
||
export default class ApplicationRoute extends Route { | ||
@service intl; | ||
|
||
beforeModel() { | ||
this.intl.setLocale(localStorage.getItem('locale') || ['en']); | ||
} | ||
} |
Oops, something went wrong.