-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(translations): adds translations support
- Loading branch information
1 parent
fe31311
commit ab396fc
Showing
7 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import config from './config'; | ||
import iconCache from './icon-cache'; | ||
import translations from './translations'; | ||
|
||
declare var Context: any; | ||
|
||
Context.config = config; | ||
Context.iconCache = iconCache; | ||
Context.translations = translations; |
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,18 @@ | ||
import da from '../translations/da'; | ||
import en from '../translations/en'; | ||
import fi from '../translations/fi'; | ||
import no from '../translations/no'; | ||
import sv from '../translations/sv'; | ||
|
||
const allTranslations = { da: da, en: en, fi: fi, no: no, sv: sv }; | ||
|
||
export class Translations { | ||
public get(key, language = 'en') { | ||
return allTranslations[language][key]; | ||
} | ||
} | ||
|
||
const translations = new Translations(); | ||
export default (() => { | ||
return translations; | ||
})(); |
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,5 @@ | ||
export default { | ||
'date-picker.month.heading': 'Måned', | ||
'date-picker.quarter.heading': 'Kvartal', | ||
'date-picker.year.heading': 'År', | ||
}; |
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,5 @@ | ||
export default { | ||
'date-picker.month.heading': 'Month', | ||
'date-picker.quarter.heading': 'Quarter', | ||
'date-picker.year.heading': 'Year', | ||
}; |
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,5 @@ | ||
export default { | ||
'date-picker.month.heading': 'Kuukausi', | ||
'date-picker.quarter.heading': 'Vuosineljännes', | ||
'date-picker.year.heading': 'Vuosi', | ||
}; |
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,5 @@ | ||
export default { | ||
'date-picker.month.heading': 'Måned', | ||
'date-picker.quarter.heading': 'Kvartal', | ||
'date-picker.year.heading': 'År', | ||
}; |
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,5 @@ | ||
export default { | ||
'date-picker.month.heading': 'Månad', | ||
'date-picker.quarter.heading': 'Kvartal', | ||
'date-picker.year.heading': 'År', | ||
}; |