- {LABELS[name]}
+ {i18n.categories[name.toLowerCase()]}
{emojis && emojis.map((emoji) =>
diff --git a/src/components/picker.js b/src/components/picker.js
index 30bb835..cc93756 100644
--- a/src/components/picker.js
+++ b/src/components/picker.js
@@ -5,6 +5,7 @@ import data from '../../data'
import store from '../utils/store'
import frequently from '../utils/frequently'
+import {deepMerge} from '../utils'
import {Anchors, Category, Emoji, Preview, Search} from '.'
@@ -16,10 +17,27 @@ const CATEGORIES = [
RECENT_CATEGORY,
].concat(data.categories)
+const I18N = {
+ search: 'Search',
+ categories: {
+ search: 'Search Results',
+ recent: 'Frequently Used',
+ people: 'Smileys & People',
+ nature: 'Animals & Nature',
+ foods: 'Food & Drink',
+ activity: 'Activity',
+ places: 'Travel & Places',
+ objects: 'Objects',
+ symbols: 'Symbols',
+ flags: 'Flags',
+ },
+}
+
export default class Picker extends React.Component {
constructor(props) {
super(props)
+ this.i18n = deepMerge(I18N, props.i18n)
this.state = {
skin: store.get('skin') || props.skin,
firstRender: true,
@@ -228,6 +246,7 @@ export default class Picker extends React.Component {
{this.getCategories().map((category, i) => {
@@ -248,6 +268,7 @@ export default class Picker extends React.Component {
emojis={category.emojis}
perLine={perLine}
hasStickyPosition={this.hasStickyPosition}
+ i18n={this.i18n}
emojiProps={{
skin: skin,
size: emojiSize,
@@ -286,6 +307,7 @@ Picker.propTypes = {
onClick: React.PropTypes.func,
perLine: React.PropTypes.number,
emojiSize: React.PropTypes.number,
+ i18n: React.PropTypes.object,
style: React.PropTypes.object,
title: React.PropTypes.string,
emoji: React.PropTypes.string,
@@ -299,6 +321,7 @@ Picker.defaultProps = {
onClick: (() => {}),
emojiSize: 24,
perLine: 9,
+ i18n: {},
style: {},
title: 'Emoji Mart™',
emoji: 'department_store',
diff --git a/src/components/search.js b/src/components/search.js
index 9550daa..47d9055 100644
--- a/src/components/search.js
+++ b/src/components/search.js
@@ -14,11 +14,13 @@ export default class Search extends React.Component {
}
render() {
+ var { i18n } = this.props
+
return
}
diff --git a/src/utils/index.js b/src/utils/index.js
index 2107c10..2de079a 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -89,4 +89,25 @@ function intersect(a, b) {
return Array.from(intersection)
}
-export { getData, getSanitizedData, intersect }
+function deepMerge(a, b) {
+ var o = {}
+
+ for (let key in a) {
+ let originalValue = a[key],
+ value = originalValue
+
+ if (b.hasOwnProperty(key)) {
+ value = b[key]
+ }
+
+ if (typeof value === 'object') {
+ value = deepMerge(originalValue, value)
+ }
+
+ o[key] = value
+ }
+
+ return o
+}
+
+export { getData, getSanitizedData, intersect, deepMerge }