From f44c8fd130e51b5d8f707be8fd53ccc81211eb73 Mon Sep 17 00:00:00 2001
From: cwm <chriswmartin@protonmail.com>
Date: Fri, 8 Dec 2017 19:40:49 -0600
Subject: merged tootsuite pr #5750 into glitch flavour

---
 app/javascript/flavours/glitch/actions/lists.js    | 313 +++++++++++++++++++++
 .../flavours/glitch/actions/streaming.js           |   1 +
 .../flavours/glitch/actions/timelines.js           |   2 +
 .../features/list_editor/components/account.js     |  77 +++++
 .../features/list_editor/components/search.js      |  75 +++++
 .../flavours/glitch/features/list_editor/index.js  |  80 ++++++
 .../glitch/features/list_timeline/index.js         | 170 +++++++++++
 .../features/lists/components/new_list_form.js     |  78 +++++
 .../flavours/glitch/features/lists/index.js        |  76 +++++
 .../glitch/features/ui/components/columns_area.js  |   3 +-
 .../flavours/glitch/features/ui/index.js           |   3 +-
 app/javascript/flavours/glitch/reducers/index.js   |   2 +
 .../flavours/glitch/reducers/list_editor.js        |  89 ++++++
 app/javascript/flavours/glitch/reducers/lists.js   |  37 +++
 .../flavours/glitch/util/async-components.js       |   4 +
 15 files changed, 1008 insertions(+), 2 deletions(-)
 create mode 100644 app/javascript/flavours/glitch/actions/lists.js
 create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/account.js
 create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/search.js
 create mode 100644 app/javascript/flavours/glitch/features/list_editor/index.js
 create mode 100644 app/javascript/flavours/glitch/features/list_timeline/index.js
 create mode 100644 app/javascript/flavours/glitch/features/lists/components/new_list_form.js
 create mode 100644 app/javascript/flavours/glitch/features/lists/index.js
 create mode 100644 app/javascript/flavours/glitch/reducers/list_editor.js
 create mode 100644 app/javascript/flavours/glitch/reducers/lists.js

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/actions/lists.js b/app/javascript/flavours/glitch/actions/lists.js
new file mode 100644
index 000000000..3c3af5fee
--- /dev/null
+++ b/app/javascript/flavours/glitch/actions/lists.js
@@ -0,0 +1,313 @@
+import api from 'flavours/glitch/util/api';
+
+export const LIST_FETCH_REQUEST = 'LIST_FETCH_REQUEST';
+export const LIST_FETCH_SUCCESS = 'LIST_FETCH_SUCCESS';
+export const LIST_FETCH_FAIL    = 'LIST_FETCH_FAIL';
+
+export const LISTS_FETCH_REQUEST = 'LISTS_FETCH_REQUEST';
+export const LISTS_FETCH_SUCCESS = 'LISTS_FETCH_SUCCESS';
+export const LISTS_FETCH_FAIL    = 'LISTS_FETCH_FAIL';
+
+export const LIST_EDITOR_TITLE_CHANGE = 'LIST_EDITOR_TITLE_CHANGE';
+export const LIST_EDITOR_RESET        = 'LIST_EDITOR_RESET';
+export const LIST_EDITOR_SETUP        = 'LIST_EDITOR_SETUP';
+
+export const LIST_CREATE_REQUEST = 'LIST_CREATE_REQUEST';
+export const LIST_CREATE_SUCCESS = 'LIST_CREATE_SUCCESS';
+export const LIST_CREATE_FAIL    = 'LIST_CREATE_FAIL';
+
+export const LIST_UPDATE_REQUEST = 'LIST_UPDATE_REQUEST';
+export const LIST_UPDATE_SUCCESS = 'LIST_UPDATE_SUCCESS';
+export const LIST_UPDATE_FAIL    = 'LIST_UPDATE_FAIL';
+
+export const LIST_DELETE_REQUEST = 'LIST_DELETE_REQUEST';
+export const LIST_DELETE_SUCCESS = 'LIST_DELETE_SUCCESS';
+export const LIST_DELETE_FAIL    = 'LIST_DELETE_FAIL';
+
+export const LIST_ACCOUNTS_FETCH_REQUEST = 'LIST_ACCOUNTS_FETCH_REQUEST';
+export const LIST_ACCOUNTS_FETCH_SUCCESS = 'LIST_ACCOUNTS_FETCH_SUCCESS';
+export const LIST_ACCOUNTS_FETCH_FAIL    = 'LIST_ACCOUNTS_FETCH_FAIL';
+
+export const LIST_EDITOR_SUGGESTIONS_CHANGE = 'LIST_EDITOR_SUGGESTIONS_CHANGE';
+export const LIST_EDITOR_SUGGESTIONS_READY  = 'LIST_EDITOR_SUGGESTIONS_READY';
+export const LIST_EDITOR_SUGGESTIONS_CLEAR  = 'LIST_EDITOR_SUGGESTIONS_CLEAR';
+
+export const LIST_EDITOR_ADD_REQUEST = 'LIST_EDITOR_ADD_REQUEST';
+export const LIST_EDITOR_ADD_SUCCESS = 'LIST_EDITOR_ADD_SUCCESS';
+export const LIST_EDITOR_ADD_FAIL    = 'LIST_EDITOR_ADD_FAIL';
+
+export const LIST_EDITOR_REMOVE_REQUEST = 'LIST_EDITOR_REMOVE_REQUEST';
+export const LIST_EDITOR_REMOVE_SUCCESS = 'LIST_EDITOR_REMOVE_SUCCESS';
+export const LIST_EDITOR_REMOVE_FAIL    = 'LIST_EDITOR_REMOVE_FAIL';
+
+export const fetchList = id => (dispatch, getState) => {
+  if (getState().getIn(['lists', id])) {
+    return;
+  }
+
+  dispatch(fetchListRequest(id));
+
+  api(getState).get(`/api/v1/lists/${id}`)
+    .then(({ data }) => dispatch(fetchListSuccess(data)))
+    .catch(err => dispatch(fetchListFail(id, err)));
+};
+
+export const fetchListRequest = id => ({
+  type: LIST_FETCH_REQUEST,
+  id,
+});
+
+export const fetchListSuccess = list => ({
+  type: LIST_FETCH_SUCCESS,
+  list,
+});
+
+export const fetchListFail = (id, error) => ({
+  type: LIST_FETCH_FAIL,
+  id,
+  error,
+});
+
+export const fetchLists = () => (dispatch, getState) => {
+  dispatch(fetchListsRequest());
+
+  api(getState).get('/api/v1/lists')
+    .then(({ data }) => dispatch(fetchListsSuccess(data)))
+    .catch(err => dispatch(fetchListsFail(err)));
+};
+
+export const fetchListsRequest = () => ({
+  type: LISTS_FETCH_REQUEST,
+});
+
+export const fetchListsSuccess = lists => ({
+  type: LISTS_FETCH_SUCCESS,
+  lists,
+});
+
+export const fetchListsFail = error => ({
+  type: LISTS_FETCH_FAIL,
+  error,
+});
+
+export const submitListEditor = shouldReset => (dispatch, getState) => {
+  const listId = getState().getIn(['listEditor', 'listId']);
+  const title  = getState().getIn(['listEditor', 'title']);
+
+  if (listId === null) {
+    dispatch(createList(title, shouldReset));
+  } else {
+    dispatch(updateList(listId, title, shouldReset));
+  }
+};
+
+export const setupListEditor = listId => (dispatch, getState) => {
+  dispatch({
+    type: LIST_EDITOR_SETUP,
+    list: getState().getIn(['lists', listId]),
+  });
+
+  dispatch(fetchListAccounts(listId));
+};
+
+export const changeListEditorTitle = value => ({
+  type: LIST_EDITOR_TITLE_CHANGE,
+  value,
+});
+
+export const createList = (title, shouldReset) => (dispatch, getState) => {
+  dispatch(createListRequest());
+
+  api(getState).post('/api/v1/lists', { title }).then(({ data }) => {
+    dispatch(createListSuccess(data));
+
+    if (shouldReset) {
+      dispatch(resetListEditor());
+    }
+  }).catch(err => dispatch(createListFail(err)));
+};
+
+export const createListRequest = () => ({
+  type: LIST_CREATE_REQUEST,
+});
+
+export const createListSuccess = list => ({
+  type: LIST_CREATE_SUCCESS,
+  list,
+});
+
+export const createListFail = error => ({
+  type: LIST_CREATE_FAIL,
+  error,
+});
+
+export const updateList = (id, title, shouldReset) => (dispatch, getState) => {
+  dispatch(updateListRequest(id));
+
+  api(getState).put(`/api/v1/lists/${id}`, { title }).then(({ data }) => {
+    dispatch(updateListSuccess(data));
+
+    if (shouldReset) {
+      dispatch(resetListEditor());
+    }
+  }).catch(err => dispatch(updateListFail(id, err)));
+};
+
+export const updateListRequest = id => ({
+  type: LIST_UPDATE_REQUEST,
+  id,
+});
+
+export const updateListSuccess = list => ({
+  type: LIST_UPDATE_SUCCESS,
+  list,
+});
+
+export const updateListFail = (id, error) => ({
+  type: LIST_UPDATE_FAIL,
+  id,
+  error,
+});
+
+export const resetListEditor = () => ({
+  type: LIST_EDITOR_RESET,
+});
+
+export const deleteList = id => (dispatch, getState) => {
+  dispatch(deleteListRequest(id));
+
+  api(getState).delete(`/api/v1/lists/${id}`)
+    .then(() => dispatch(deleteListSuccess(id)))
+    .catch(err => dispatch(deleteListFail(id, err)));
+};
+
+export const deleteListRequest = id => ({
+  type: LIST_DELETE_REQUEST,
+  id,
+});
+
+export const deleteListSuccess = id => ({
+  type: LIST_DELETE_SUCCESS,
+  id,
+});
+
+export const deleteListFail = (id, error) => ({
+  type: LIST_DELETE_FAIL,
+  id,
+  error,
+});
+
+export const fetchListAccounts = listId => (dispatch, getState) => {
+  dispatch(fetchListAccountsRequest(listId));
+
+  api(getState).get(`/api/v1/lists/${listId}/accounts`, { params: { limit: 0 } })
+    .then(({ data }) => dispatch(fetchListAccountsSuccess(listId, data)))
+    .catch(err => dispatch(fetchListAccountsFail(listId, err)));
+};
+
+export const fetchListAccountsRequest = id => ({
+  type: LIST_ACCOUNTS_FETCH_REQUEST,
+  id,
+});
+
+export const fetchListAccountsSuccess = (id, accounts, next) => ({
+  type: LIST_ACCOUNTS_FETCH_SUCCESS,
+  id,
+  accounts,
+  next,
+});
+
+export const fetchListAccountsFail = (id, error) => ({
+  type: LIST_ACCOUNTS_FETCH_FAIL,
+  id,
+  error,
+});
+
+export const fetchListSuggestions = q => (dispatch, getState) => {
+  const params = {
+    q,
+    resolve: false,
+    limit: 4,
+    following: true,
+  };
+
+  api(getState).get('/api/v1/accounts/search', { params })
+    .then(({ data }) => dispatch(fetchListSuggestionsReady(q, data)));
+};
+
+export const fetchListSuggestionsReady = (query, accounts) => ({
+  type: LIST_EDITOR_SUGGESTIONS_READY,
+  query,
+  accounts,
+});
+
+export const clearListSuggestions = () => ({
+  type: LIST_EDITOR_SUGGESTIONS_CLEAR,
+});
+
+export const changeListSuggestions = value => ({
+  type: LIST_EDITOR_SUGGESTIONS_CHANGE,
+  value,
+});
+
+export const addToListEditor = accountId => (dispatch, getState) => {
+  dispatch(addToList(getState().getIn(['listEditor', 'listId']), accountId));
+};
+
+export const addToList = (listId, accountId) => (dispatch, getState) => {
+  dispatch(addToListRequest(listId, accountId));
+
+  api(getState).post(`/api/v1/lists/${listId}/accounts`, { account_ids: [accountId] })
+    .then(() => dispatch(addToListSuccess(listId, accountId)))
+    .catch(err => dispatch(addToListFail(listId, accountId, err)));
+};
+
+export const addToListRequest = (listId, accountId) => ({
+  type: LIST_EDITOR_ADD_REQUEST,
+  listId,
+  accountId,
+});
+
+export const addToListSuccess = (listId, accountId) => ({
+  type: LIST_EDITOR_ADD_SUCCESS,
+  listId,
+  accountId,
+});
+
+export const addToListFail = (listId, accountId, error) => ({
+  type: LIST_EDITOR_ADD_FAIL,
+  listId,
+  accountId,
+  error,
+});
+
+export const removeFromListEditor = accountId => (dispatch, getState) => {
+  dispatch(removeFromList(getState().getIn(['listEditor', 'listId']), accountId));
+};
+
+export const removeFromList = (listId, accountId) => (dispatch, getState) => {
+  dispatch(removeFromListRequest(listId, accountId));
+
+  api(getState).delete(`/api/v1/lists/${listId}/accounts`, { params: { account_ids: [accountId] } })
+    .then(() => dispatch(removeFromListSuccess(listId, accountId)))
+    .catch(err => dispatch(removeFromListFail(listId, accountId, err)));
+};
+
+export const removeFromListRequest = (listId, accountId) => ({
+  type: LIST_EDITOR_REMOVE_REQUEST,
+  listId,
+  accountId,
+});
+
+export const removeFromListSuccess = (listId, accountId) => ({
+  type: LIST_EDITOR_REMOVE_SUCCESS,
+  listId,
+  accountId,
+});
+
+export const removeFromListFail = (listId, accountId, error) => ({
+  type: LIST_EDITOR_REMOVE_FAIL,
+  listId,
+  accountId,
+  error,
+});
diff --git a/app/javascript/flavours/glitch/actions/streaming.js b/app/javascript/flavours/glitch/actions/streaming.js
index 595eefa41..ae51e8349 100644
--- a/app/javascript/flavours/glitch/actions/streaming.js
+++ b/app/javascript/flavours/glitch/actions/streaming.js
@@ -52,3 +52,4 @@ export const connectMediaStream = () => connectTimelineStream('community', 'publ
 export const connectPublicStream = () => connectTimelineStream('public', 'public');
 export const connectHashtagStream = (tag) => connectTimelineStream(`hashtag:${tag}`, `hashtag&tag=${tag}`);
 export const connectDirectStream = () => connectTimelineStream('direct', 'direct');
+export const connectListStream = (id) => connectTimelineStream(`list:${id}`, `list&list=${id}`);
diff --git a/app/javascript/flavours/glitch/actions/timelines.js b/app/javascript/flavours/glitch/actions/timelines.js
index 3fabf3885..1665c2c48 100644
--- a/app/javascript/flavours/glitch/actions/timelines.js
+++ b/app/javascript/flavours/glitch/actions/timelines.js
@@ -119,6 +119,7 @@ export const refreshDirectTimeline       = () => refreshTimeline('direct', '/api
 export const refreshAccountTimeline      = accountId => refreshTimeline(`account:${accountId}`, `/api/v1/accounts/${accountId}/statuses`);
 export const refreshAccountMediaTimeline = accountId => refreshTimeline(`account:${accountId}:media`, `/api/v1/accounts/${accountId}/statuses`, { only_media: true });
 export const refreshHashtagTimeline      = hashtag => refreshTimeline(`hashtag:${hashtag}`, `/api/v1/timelines/tag/${hashtag}`);
+export const refreshListTimeline         = id => refreshTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`)
 
 export function refreshTimelineFail(timeline, error, skipLoading) {
   return {
@@ -160,6 +161,7 @@ export const expandDirectTimeline       = () => expandTimeline('direct', '/api/v
 export const expandAccountTimeline      = accountId => expandTimeline(`account:${accountId}`, `/api/v1/accounts/${accountId}/statuses`);
 export const expandAccountMediaTimeline = accountId => expandTimeline(`account:${accountId}:media`, `/api/v1/accounts/${accountId}/statuses`, { only_media: true });
 export const expandHashtagTimeline      = hashtag => expandTimeline(`hashtag:${hashtag}`, `/api/v1/timelines/tag/${hashtag}`);
+export const expandListTimeline         = id => expandTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`);
 
 export function expandTimelineRequest(timeline) {
   return {
diff --git a/app/javascript/flavours/glitch/features/list_editor/components/account.js b/app/javascript/flavours/glitch/features/list_editor/components/account.js
new file mode 100644
index 000000000..f48df759d
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/list_editor/components/account.js
@@ -0,0 +1,77 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
+import { makeGetAccount } from 'flavours/glitch/selectors';
+import ImmutablePureComponent from 'react-immutable-pure-component';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import Avatar from 'flavours/glitch/components/avatar';
+import DisplayName from 'flavours/glitch/components/display_name';
+import IconButton from 'flavours/glitch/components/icon_button';
+import { defineMessages, injectIntl } from 'react-intl';
+import { removeFromListEditor, addToListEditor } from 'flavours/glitch/actions/lists';
+
+const messages = defineMessages({
+  remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' },
+  add: { id: 'lists.account.add', defaultMessage: 'Add to list' },
+});
+
+const makeMapStateToProps = () => {
+  const getAccount = makeGetAccount();
+
+  const mapStateToProps = (state, { accountId, added }) => ({
+    account: getAccount(state, accountId),
+    added: typeof added === 'undefined' ? state.getIn(['listEditor', 'accounts', 'items']).includes(accountId) : added,
+  });
+
+  return mapStateToProps;
+};
+
+const mapDispatchToProps = (dispatch, { accountId }) => ({
+  onRemove: () => dispatch(removeFromListEditor(accountId)),
+  onAdd: () => dispatch(addToListEditor(accountId)),
+});
+
+@connect(makeMapStateToProps, mapDispatchToProps)
+@injectIntl
+export default class Account extends ImmutablePureComponent {
+
+  static propTypes = {
+    account: ImmutablePropTypes.map.isRequired,
+    intl: PropTypes.object.isRequired,
+    onRemove: PropTypes.func.isRequired,
+    onAdd: PropTypes.func.isRequired,
+    added: PropTypes.bool,
+  };
+
+  static defaultProps = {
+    added: false,
+  };
+
+  render () {
+    const { account, intl, onRemove, onAdd, added } = this.props;
+
+    let button;
+
+    if (added) {
+      button = <IconButton icon='times' title={intl.formatMessage(messages.remove)} onClick={onRemove} />;
+    } else {
+      button = <IconButton icon='plus' title={intl.formatMessage(messages.add)} onClick={onAdd} />;
+    }
+
+    return (
+      <div className='account'>
+        <div className='account__wrapper'>
+          <div className='account__display-name'>
+            <div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div>
+            <DisplayName account={account} />
+          </div>
+
+          <div className='account__relationship'>
+            {button}
+          </div>
+        </div>
+      </div>
+    );
+  }
+
+}
diff --git a/app/javascript/flavours/glitch/features/list_editor/components/search.js b/app/javascript/flavours/glitch/features/list_editor/components/search.js
new file mode 100644
index 000000000..45c4d0f2e
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/list_editor/components/search.js
@@ -0,0 +1,75 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
+import { defineMessages, injectIntl } from 'react-intl';
+import { fetchListSuggestions, clearListSuggestions, changeListSuggestions } from '../../../actions/lists';
+import classNames from 'classnames';
+
+const messages = defineMessages({
+  search: { id: 'lists.search', defaultMessage: 'Search among people you follow' },
+});
+
+const mapStateToProps = state => ({
+  value: state.getIn(['listEditor', 'suggestions', 'value']),
+});
+
+const mapDispatchToProps = dispatch => ({
+  onSubmit: value => dispatch(fetchListSuggestions(value)),
+  onClear: () => dispatch(clearListSuggestions()),
+  onChange: value => dispatch(changeListSuggestions(value)),
+});
+
+@connect(mapStateToProps, mapDispatchToProps)
+@injectIntl
+export default class Search extends React.PureComponent {
+
+  static propTypes = {
+    intl: PropTypes.object.isRequired,
+    value: PropTypes.string.isRequired,
+    onChange: PropTypes.func.isRequired,
+    onSubmit: PropTypes.func.isRequired,
+    onClear: PropTypes.func.isRequired,
+  };
+
+  handleChange = e => {
+    this.props.onChange(e.target.value);
+  }
+
+  handleKeyUp = e => {
+    if (e.keyCode === 13) {
+      this.props.onSubmit(this.props.value);
+    }
+  }
+
+  handleClear = () => {
+    this.props.onClear();
+  }
+
+  render () {
+    const { value, intl } = this.props;
+    const hasValue = value.length > 0;
+
+    return (
+      <div className='list-editor__search search'>
+        <label>
+          <span style={{ display: 'none' }}>{intl.formatMessage(messages.search)}</span>
+
+          <input
+            className='search__input'
+            type='text'
+            value={value}
+            onChange={this.handleChange}
+            onKeyUp={this.handleKeyUp}
+            placeholder={intl.formatMessage(messages.search)}
+          />
+        </label>
+
+        <div role='button' tabIndex='0' className='search__icon' onClick={this.handleClear}>
+          <i className={classNames('fa fa-search', { active: !hasValue })} />
+          <i aria-label={intl.formatMessage(messages.search)} className={classNames('fa fa-times-circle', { active: hasValue })} />
+        </div>
+      </div>
+    );
+  }
+
+}
diff --git a/app/javascript/flavours/glitch/features/list_editor/index.js b/app/javascript/flavours/glitch/features/list_editor/index.js
new file mode 100644
index 000000000..7f9c6b0e9
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/list_editor/index.js
@@ -0,0 +1,80 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import { connect } from 'react-redux';
+import ImmutablePureComponent from 'react-immutable-pure-component';
+import { injectIntl } from 'react-intl';
+import { setupListEditor, clearListSuggestions, resetListEditor } from 'flavours/glitch/actions/lists';
+import Account from './components/account';
+import Search from './components/search';
+import Motion from 'flavours/glitch/util/optional_motion';
+import spring from 'react-motion/lib/spring';
+
+const mapStateToProps = state => ({
+  title: state.getIn(['listEditor', 'title']),
+  accountIds: state.getIn(['listEditor', 'accounts', 'items']),
+  searchAccountIds: state.getIn(['listEditor', 'suggestions', 'items']),
+});
+
+const mapDispatchToProps = dispatch => ({
+  onInitialize: listId => dispatch(setupListEditor(listId)),
+  onClear: () => dispatch(clearListSuggestions()),
+  onReset: () => dispatch(resetListEditor()),
+});
+
+@connect(mapStateToProps, mapDispatchToProps)
+@injectIntl
+export default class ListEditor extends ImmutablePureComponent {
+
+  static propTypes = {
+    listId: PropTypes.string.isRequired,
+    onClose: PropTypes.func.isRequired,
+    intl: PropTypes.object.isRequired,
+    onInitialize: PropTypes.func.isRequired,
+    onClear: PropTypes.func.isRequired,
+    onReset: PropTypes.func.isRequired,
+    title: PropTypes.string.isRequired,
+    accountIds: ImmutablePropTypes.list.isRequired,
+    searchAccountIds: ImmutablePropTypes.list.isRequired,
+  };
+
+  componentDidMount () {
+    const { onInitialize, listId } = this.props;
+    onInitialize(listId);
+  }
+
+  componentWillUnmount () {
+    const { onReset } = this.props;
+    onReset();
+  }
+
+  render () {
+    const { title, accountIds, searchAccountIds, onClear } = this.props;
+    const showSearch = searchAccountIds.size > 0;
+
+    return (
+      <div className='modal-root__modal list-editor'>
+        <h4>{title}</h4>
+
+        <Search />
+
+        <div className='drawer__pager'>
+          <div className='drawer__inner list-editor__accounts'>
+            {accountIds.map(accountId => <Account key={accountId} accountId={accountId} added />)}
+          </div>
+
+          {showSearch && <div role='button' tabIndex='-1' className='drawer__backdrop' onClick={onClear} />}
+
+          <Motion defaultStyle={{ x: -100 }} style={{ x: spring(showSearch ? 0 : -100, { stiffness: 210, damping: 20 }) }}>
+            {({ x }) =>
+              <div className='drawer__inner backdrop' style={{ transform: x === 0 ? null : `translateX(${x}%)`, visibility: x === -100 ? 'hidden' : 'visible' }}>
+                {searchAccountIds.map(accountId => <Account key={accountId} accountId={accountId} />)}
+              </div>
+            }
+          </Motion>
+        </div>
+      </div>
+    );
+  }
+
+}
diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.js b/app/javascript/flavours/glitch/features/list_timeline/index.js
new file mode 100644
index 000000000..bcc752d34
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/list_timeline/index.js
@@ -0,0 +1,170 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import PropTypes from 'prop-types';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container';
+import Column from 'flavours/glitch/components/column';
+import ColumnHeader from 'flavours/glitch/components/column_header';
+import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';
+import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
+import { connectListStream } from 'flavours/glitch/actions/streaming';
+import { refreshListTimeline, expandListTimeline } from 'flavours/glitch/actions/timelines';
+import { fetchList, deleteList } from 'flavours/glitch/actions/lists';
+import { openModal } from 'flavours/glitch/actions/modal';
+import MissingIndicator from 'flavours/glitch/components/missing_indicator';
+import LoadingIndicator from 'flavours/glitch/components/loading_indicator';
+
+const messages = defineMessages({
+  deleteMessage: { id: 'confirmations.delete_list.message', defaultMessage: 'Are you sure you want to permanently delete this list?' },
+  deleteConfirm: { id: 'confirmations.delete_list.confirm', defaultMessage: 'Delete' },
+});
+
+const mapStateToProps = (state, props) => ({
+  list: state.getIn(['lists', props.params.id]),
+  hasUnread: state.getIn(['timelines', `list:${props.params.id}`, 'unread']) > 0,
+});
+
+@connect(mapStateToProps)
+@injectIntl
+export default class ListTimeline extends React.PureComponent {
+
+  static contextTypes = {
+    router: PropTypes.object,
+  };
+
+  static propTypes = {
+    params: PropTypes.object.isRequired,
+    dispatch: PropTypes.func.isRequired,
+    columnId: PropTypes.string,
+    hasUnread: PropTypes.bool,
+    multiColumn: PropTypes.bool,
+    list: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]),
+    intl: PropTypes.object.isRequired,
+  };
+
+  handlePin = () => {
+    const { columnId, dispatch } = this.props;
+
+    if (columnId) {
+      dispatch(removeColumn(columnId));
+    } else {
+      dispatch(addColumn('LIST', { id: this.props.params.id }));
+      this.context.router.history.push('/');
+    }
+  }
+
+  handleMove = (dir) => {
+    const { columnId, dispatch } = this.props;
+    dispatch(moveColumn(columnId, dir));
+  }
+
+  handleHeaderClick = () => {
+    this.column.scrollTop();
+  }
+
+  componentDidMount () {
+    const { dispatch } = this.props;
+    const { id } = this.props.params;
+
+    dispatch(fetchList(id));
+    dispatch(refreshListTimeline(id));
+
+    this.disconnect = dispatch(connectListStream(id));
+  }
+
+  componentWillUnmount () {
+    if (this.disconnect) {
+      this.disconnect();
+      this.disconnect = null;
+    }
+  }
+
+  setRef = c => {
+    this.column = c;
+  }
+
+  handleLoadMore = () => {
+    const { id } = this.props.params;
+    this.props.dispatch(expandListTimeline(id));
+  }
+
+  handleEditClick = () => {
+    this.props.dispatch(openModal('LIST_EDITOR', { listId: this.props.params.id }));
+  }
+
+  handleDeleteClick = () => {
+    const { dispatch, columnId, intl } = this.props;
+    const { id } = this.props.params;
+
+    dispatch(openModal('CONFIRM', {
+      message: intl.formatMessage(messages.deleteMessage),
+      confirm: intl.formatMessage(messages.deleteConfirm),
+      onConfirm: () => {
+        dispatch(deleteList(id));
+
+        if (!!columnId) {
+          dispatch(removeColumn(columnId));
+        } else {
+          this.context.router.history.push('/lists');
+        }
+      },
+    }));
+  }
+
+  render () {
+    const { hasUnread, columnId, multiColumn, list } = this.props;
+    const { id } = this.props.params;
+    const pinned = !!columnId;
+    const title  = list ? list.get('title') : id;
+
+    if (typeof list === 'undefined') {
+      return (
+        <Column>
+          <LoadingIndicator />
+        </Column>
+      );
+    } else if (list === false) {
+      return (
+        <Column>
+          <MissingIndicator />
+        </Column>
+      );
+    }
+
+    return (
+      <Column ref={this.setRef}>
+        <ColumnHeader
+          icon='bars'
+          active={hasUnread}
+          title={title}
+          onPin={this.handlePin}
+          onMove={this.handleMove}
+          onClick={this.handleHeaderClick}
+          pinned={pinned}
+          multiColumn={multiColumn}
+        >
+          <div className='column-header__links'>
+            <button className='text-btn column-header__setting-btn' tabIndex='0' onClick={this.handleEditClick}>
+              <i className='fa fa-pencil' /> <FormattedMessage id='lists.edit' defaultMessage='Edit list' />
+            </button>
+
+            <button className='text-btn column-header__setting-btn' tabIndex='0' onClick={this.handleDeleteClick}>
+              <i className='fa fa-trash' /> <FormattedMessage id='lists.delete' defaultMessage='Delete list' />
+            </button>
+          </div>
+
+          <hr />
+        </ColumnHeader>
+
+        <StatusListContainer
+          trackScroll={!pinned}
+          scrollKey={`list_timeline-${columnId}`}
+          timelineId={`list:${id}`}
+          loadMore={this.handleLoadMore}
+          emptyMessage={<FormattedMessage id='empty_column.list' defaultMessage='There is nothing in this list yet.' />}
+        />
+      </Column>
+    );
+  }
+
+}
diff --git a/app/javascript/flavours/glitch/features/lists/components/new_list_form.js b/app/javascript/flavours/glitch/features/lists/components/new_list_form.js
new file mode 100644
index 000000000..61fcbeaf9
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/lists/components/new_list_form.js
@@ -0,0 +1,78 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import PropTypes from 'prop-types';
+import { changeListEditorTitle, submitListEditor } from 'flavours/glitch/actions/lists';
+import IconButton from 'flavours/glitch/components/icon_button';
+import { defineMessages, injectIntl } from 'react-intl';
+
+const messages = defineMessages({
+  label: { id: 'lists.new.title_placeholder', defaultMessage: 'New list title' },
+  title: { id: 'lists.new.create', defaultMessage: 'Add list' },
+});
+
+const mapStateToProps = state => ({
+  value: state.getIn(['listEditor', 'title']),
+  disabled: state.getIn(['listEditor', 'isSubmitting']),
+});
+
+const mapDispatchToProps = dispatch => ({
+  onChange: value => dispatch(changeListEditorTitle(value)),
+  onSubmit: () => dispatch(submitListEditor(true)),
+});
+
+@connect(mapStateToProps, mapDispatchToProps)
+@injectIntl
+export default class NewListForm extends React.PureComponent {
+
+  static propTypes = {
+    value: PropTypes.string.isRequired,
+    disabled: PropTypes.bool,
+    intl: PropTypes.object.isRequired,
+    onChange: PropTypes.func.isRequired,
+    onSubmit: PropTypes.func.isRequired,
+  };
+
+  handleChange = e => {
+    this.props.onChange(e.target.value);
+  }
+
+  handleSubmit = e => {
+    e.preventDefault();
+    this.props.onSubmit();
+  }
+
+  handleClick = () => {
+    this.props.onSubmit();
+  }
+
+  render () {
+    const { value, disabled, intl } = this.props;
+
+    const label = intl.formatMessage(messages.label);
+    const title = intl.formatMessage(messages.title);
+
+    return (
+      <form className='column-inline-form' onSubmit={this.handleSubmit}>
+        <label>
+          <span style={{ display: 'none' }}>{label}</span>
+
+          <input
+            className='setting-text'
+            value={value}
+            disabled={disabled}
+            onChange={this.handleChange}
+            placeholder={label}
+          />
+        </label>
+
+        <IconButton
+          disabled={disabled}
+          icon='plus'
+          title={title}
+          onClick={this.handleClick}
+        />
+      </form>
+    );
+  }
+
+}
diff --git a/app/javascript/flavours/glitch/features/lists/index.js b/app/javascript/flavours/glitch/features/lists/index.js
new file mode 100644
index 000000000..c82b370bc
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/lists/index.js
@@ -0,0 +1,76 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import PropTypes from 'prop-types';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import LoadingIndicator from 'flavours/glitch/components/loading_indicator';
+import Column from 'flavours/glitch/features/ui/components/column';
+import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim';
+import { fetchLists } from 'flavours/glitch/actions/lists';
+import { defineMessages, injectIntl } from 'react-intl';
+import ImmutablePureComponent from 'react-immutable-pure-component';
+import ColumnLink from 'flavours/glitch/features/ui/components/column_link';
+import ColumnSubheading from 'flavours/glitch/features/ui/components/column_subheading';
+import NewListForm from './components/new_list_form';
+import { createSelector } from 'reselect';
+
+const messages = defineMessages({
+  heading: { id: 'column.lists', defaultMessage: 'Lists' },
+  subheading: { id: 'lists.subheading', defaultMessage: 'Your lists' },
+});
+
+const getOrderedLists = createSelector([state => state.get('lists')], lists => {
+  if (!lists) {
+    return lists;
+  }
+
+  return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title')));
+});
+
+const mapStateToProps = state => ({
+  lists: getOrderedLists(state),
+});
+
+@connect(mapStateToProps)
+@injectIntl
+export default class Lists extends ImmutablePureComponent {
+
+  static propTypes = {
+    params: PropTypes.object.isRequired,
+    dispatch: PropTypes.func.isRequired,
+    lists: ImmutablePropTypes.list,
+    intl: PropTypes.object.isRequired,
+  };
+
+  componentWillMount () {
+    this.props.dispatch(fetchLists());
+  }
+
+  render () {
+    const { intl, lists } = this.props;
+
+    if (!lists) {
+      return (
+        <Column>
+          <LoadingIndicator />
+        </Column>
+      );
+    }
+
+    return (
+      <Column icon='bars' heading={intl.formatMessage(messages.heading)}>
+        <ColumnBackButtonSlim />
+
+        <NewListForm />
+
+        <div className='scrollable'>
+          <ColumnSubheading text={intl.formatMessage(messages.subheading)} />
+
+          {lists.map(list =>
+            <ColumnLink key={list.get('id')} to={`/timelines/list/${list.get('id')}`} icon='bars' text={list.get('title')} />
+          )}
+        </div>
+      </Column>
+    );
+  }
+
+}
diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js
index 264f60724..4167ff693 100644
--- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js
+++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js
@@ -11,7 +11,7 @@ import BundleContainer from '../containers/bundle_container';
 import ColumnLoading from './column_loading';
 import DrawerLoading from './drawer_loading';
 import BundleColumnError from './bundle_column_error';
-import { Compose, Notifications, HomeTimeline, CommunityTimeline, PublicTimeline, HashtagTimeline, DirectTimeline, FavouritedStatuses } from 'flavours/glitch/util/async-components';
+import { Compose, Notifications, HomeTimeline, CommunityTimeline, PublicTimeline, HashtagTimeline, DirectTimeline, FavouritedStatuses, ListTimeline } from 'flavours/glitch/util/async-components';
 
 import detectPassiveEvents from 'detect-passive-events';
 import { scrollRight } from 'flavours/glitch/util/scroll';
@@ -25,6 +25,7 @@ const componentMap = {
   'HASHTAG': HashtagTimeline,
   'DIRECT': DirectTimeline,
   'FAVOURITES': FavouritedStatuses,
+  'LIST': ListTimeline,
 };
 
 @component => injectIntl(component, { withRef: true })
diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js
index 4a1982916..3dee7ca19 100644
--- a/app/javascript/flavours/glitch/features/ui/index.js
+++ b/app/javascript/flavours/glitch/features/ui/index.js
@@ -35,6 +35,7 @@ import {
   FollowRequests,
   GenericNotFound,
   FavouritedStatuses,
+  ListTimeline,
   Blocks,
   Mutes,
   PinnedStatuses,
@@ -407,7 +408,7 @@ export default class UI extends React.Component {
               <WrappedRoute path='/timelines/public/local' component={CommunityTimeline} content={children} />
               <WrappedRoute path='/timelines/direct' component={DirectTimeline} content={children} />
               <WrappedRoute path='/timelines/tag/:id' component={HashtagTimeline} content={children} />
-
+              <WrappedRoute path='/timelines/list/:id' component={ListTimeline} content={children} />
               <WrappedRoute path='/notifications' component={Notifications} content={children} />
               <WrappedRoute path='/favourites' component={FavouritedStatuses} content={children} />
               <WrappedRoute path='/pinned' component={PinnedStatuses} content={children} />
diff --git a/app/javascript/flavours/glitch/reducers/index.js b/app/javascript/flavours/glitch/reducers/index.js
index aa748421a..25baaef71 100644
--- a/app/javascript/flavours/glitch/reducers/index.js
+++ b/app/javascript/flavours/glitch/reducers/index.js
@@ -23,6 +23,7 @@ import media_attachments from './media_attachments';
 import notifications from './notifications';
 import height_cache from './height_cache';
 import custom_emojis from './custom_emojis';
+import lists from './lists';
 
 const reducers = {
   timelines,
@@ -49,6 +50,7 @@ const reducers = {
   notifications,
   height_cache,
   custom_emojis,
+  lists,
 };
 
 export default combineReducers(reducers);
diff --git a/app/javascript/flavours/glitch/reducers/list_editor.js b/app/javascript/flavours/glitch/reducers/list_editor.js
new file mode 100644
index 000000000..02a0dabb1
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/list_editor.js
@@ -0,0 +1,89 @@
+import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
+import {
+  LIST_CREATE_REQUEST,
+  LIST_CREATE_FAIL,
+  LIST_CREATE_SUCCESS,
+  LIST_UPDATE_REQUEST,
+  LIST_UPDATE_FAIL,
+  LIST_UPDATE_SUCCESS,
+  LIST_EDITOR_RESET,
+  LIST_EDITOR_SETUP,
+  LIST_EDITOR_TITLE_CHANGE,
+  LIST_ACCOUNTS_FETCH_REQUEST,
+  LIST_ACCOUNTS_FETCH_SUCCESS,
+  LIST_ACCOUNTS_FETCH_FAIL,
+  LIST_EDITOR_SUGGESTIONS_READY,
+  LIST_EDITOR_SUGGESTIONS_CLEAR,
+  LIST_EDITOR_SUGGESTIONS_CHANGE,
+  LIST_EDITOR_ADD_SUCCESS,
+  LIST_EDITOR_REMOVE_SUCCESS,
+} from '../actions/lists';
+
+const initialState = ImmutableMap({
+  listId: null,
+  isSubmitting: false,
+  title: '',
+
+  accounts: ImmutableMap({
+    items: ImmutableList(),
+    loaded: false,
+    isLoading: false,
+  }),
+
+  suggestions: ImmutableMap({
+    value: '',
+    items: ImmutableList(),
+  }),
+});
+
+export default function listEditorReducer(state = initialState, action) {
+  switch(action.type) {
+  case LIST_EDITOR_RESET:
+    return initialState;
+  case LIST_EDITOR_SETUP:
+    return state.withMutations(map => {
+      map.set('listId', action.list.get('id'));
+      map.set('title', action.list.get('title'));
+      map.set('isSubmitting', false);
+    });
+  case LIST_EDITOR_TITLE_CHANGE:
+    return state.set('title', action.value);
+  case LIST_CREATE_REQUEST:
+  case LIST_UPDATE_REQUEST:
+    return state.set('isSubmitting', true);
+  case LIST_CREATE_FAIL:
+  case LIST_UPDATE_FAIL:
+    return state.set('isSubmitting', false);
+  case LIST_CREATE_SUCCESS:
+  case LIST_UPDATE_SUCCESS:
+    return state.withMutations(map => {
+      map.set('isSubmitting', false);
+      map.set('listId', action.list.id);
+    });
+  case LIST_ACCOUNTS_FETCH_REQUEST:
+    return state.setIn(['accounts', 'isLoading'], true);
+  case LIST_ACCOUNTS_FETCH_FAIL:
+    return state.setIn(['accounts', 'isLoading'], false);
+  case LIST_ACCOUNTS_FETCH_SUCCESS:
+    return state.update('accounts', accounts => accounts.withMutations(map => {
+      map.set('isLoading', false);
+      map.set('loaded', true);
+      map.set('items', ImmutableList(action.accounts.map(item => item.id)));
+    }));
+  case LIST_EDITOR_SUGGESTIONS_CHANGE:
+    return state.setIn(['suggestions', 'value'], action.value);
+  case LIST_EDITOR_SUGGESTIONS_READY:
+    return state.setIn(['suggestions', 'items'], ImmutableList(action.accounts.map(item => item.id)));
+  case LIST_EDITOR_SUGGESTIONS_CLEAR:
+    return state.update('suggestions', suggestions => suggestions.withMutations(map => {
+      map.set('items', ImmutableList());
+      map.set('value', '');
+    }));
+  case LIST_EDITOR_ADD_SUCCESS:
+    return state.updateIn(['accounts', 'items'], list => list.unshift(action.accountId));
+  case LIST_EDITOR_REMOVE_SUCCESS:
+    return state.updateIn(['accounts', 'items'], list => list.filterNot(item => item === action.accountId));
+  default:
+    return state;
+  }
+};
diff --git a/app/javascript/flavours/glitch/reducers/lists.js b/app/javascript/flavours/glitch/reducers/lists.js
new file mode 100644
index 000000000..f30ffbcbd
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/lists.js
@@ -0,0 +1,37 @@
+import {
+  LIST_FETCH_SUCCESS,
+  LIST_FETCH_FAIL,
+  LISTS_FETCH_SUCCESS,
+  LIST_CREATE_SUCCESS,
+  LIST_UPDATE_SUCCESS,
+  LIST_DELETE_SUCCESS,
+} from '../actions/lists';
+import { Map as ImmutableMap, fromJS } from 'immutable';
+
+const initialState = ImmutableMap();
+
+const normalizeList = (state, list) => state.set(list.id, fromJS(list));
+
+const normalizeLists = (state, lists) => {
+  lists.forEach(list => {
+    state = normalizeList(state, list);
+  });
+
+  return state;
+};
+
+export default function lists(state = initialState, action) {
+  switch(action.type) {
+  case LIST_FETCH_SUCCESS:
+  case LIST_CREATE_SUCCESS:
+  case LIST_UPDATE_SUCCESS:
+    return normalizeList(state, action.list);
+  case LISTS_FETCH_SUCCESS:
+    return normalizeLists(state, action.lists);
+  case LIST_DELETE_SUCCESS:
+  case LIST_FETCH_FAIL:
+    return state.set(action.id, false);
+  default:
+    return state;
+  }
+};
diff --git a/app/javascript/flavours/glitch/util/async-components.js b/app/javascript/flavours/glitch/util/async-components.js
index b7ac4d3ec..3056deab2 100644
--- a/app/javascript/flavours/glitch/util/async-components.js
+++ b/app/javascript/flavours/glitch/util/async-components.js
@@ -26,6 +26,10 @@ export function HashtagTimeline () {
   return import(/* webpackChunkName: "flavours/glitch/async/hashtag_timeline" */'flavours/glitch/features/hashtag_timeline');
 }
 
+export function ListTimeline () {
+  return import(/* webpackChunkName: "features/list_timeline" */'flavours/glitch/features/list_timeline');
+}
+
 export function DirectTimeline() {
   return import(/* webpackChunkName: "flavours/glitch/async/direct_timeline" */'flavours/glitch/features/direct_timeline');
 }
-- 
cgit 


From 47157e07b25f80aa9d2f90591bb59cf32cf593be Mon Sep 17 00:00:00 2001
From: cwm <chriswmartin@protonmail.com>
Date: Fri, 8 Dec 2017 20:13:08 -0600
Subject: merged tootsuite pr #5811 into glitch flavour

---
 .../glitch/features/getting_started/index.js       |  3 +
 .../glitch/features/ui/components/modal_root.js    |  2 +
 .../flavours/glitch/features/ui/index.js           |  2 +
 .../flavours/glitch/reducers/accounts.js           |  6 ++
 .../flavours/glitch/reducers/accounts_counters.js  |  6 ++
 app/javascript/flavours/glitch/reducers/index.js   |  2 +
 .../flavours/glitch/reducers/settings.js           |  7 ++
 .../flavours/glitch/styles/components/index.scss   | 84 ++++++++++++++++++++++
 .../flavours/glitch/util/async-components.js       |  8 +++
 9 files changed, 120 insertions(+)

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js
index 2af0fcf48..469fc2aa7 100644
--- a/app/javascript/flavours/glitch/features/getting_started/index.js
+++ b/app/javascript/flavours/glitch/features/getting_started/index.js
@@ -29,6 +29,7 @@ const messages = defineMessages({
   info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' },
   show_me_around: { id: 'getting_started.onboarding', defaultMessage: 'Show me around' },
   pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },
+  lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },
 });
 
 const mapStateToProps = state => ({
@@ -87,6 +88,7 @@ export default class GettingStarted extends ImmutablePureComponent {
     navItems = navItems.concat([
       <ColumnLink key='5' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,
       <ColumnLink key='6' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />,
+      <ColumnLink key='9' icon='bars' text={intl.formatMessage(messages.lists)} to='/lists' />,
     ]);
 
     if (myAccount.get('locked')) {
@@ -96,6 +98,7 @@ export default class GettingStarted extends ImmutablePureComponent {
     navItems = navItems.concat([
       <ColumnLink key='8' icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />,
       <ColumnLink key='9' icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />,
+      <ColumnLink key='10' icon='question' text={intl.formatMessage(messages.keyboard_shortcuts)} to='/keyboard-shortcuts' hideOnMobile />,
     ]);
 
     return (
diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_root.js b/app/javascript/flavours/glitch/features/ui/components/modal_root.js
index 61b239283..679578b75 100644
--- a/app/javascript/flavours/glitch/features/ui/components/modal_root.js
+++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.js
@@ -15,6 +15,7 @@ import {
   ReportModal,
   SettingsModal,
   EmbedModal,
+  ListEditor,
 } from 'flavours/glitch/util/async-components';
 
 const MODAL_COMPONENTS = {
@@ -29,6 +30,7 @@ const MODAL_COMPONENTS = {
   'SETTINGS': SettingsModal,
   'ACTIONS': () => Promise.resolve({ default: ActionsModal }),
   'EMBED': EmbedModal,
+  'LIST_EDITOR': ListEditor,
 };
 
 export default class ModalRoot extends React.PureComponent {
diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js
index 3dee7ca19..698ae996c 100644
--- a/app/javascript/flavours/glitch/features/ui/index.js
+++ b/app/javascript/flavours/glitch/features/ui/index.js
@@ -39,6 +39,7 @@ import {
   Blocks,
   Mutes,
   PinnedStatuses,
+  Lists,
 } from 'flavours/glitch/util/async-components';
 import { HotKeys } from 'react-hotkeys';
 import { me } from 'flavours/glitch/util/initial_state';
@@ -426,6 +427,7 @@ export default class UI extends React.Component {
               <WrappedRoute path='/follow_requests' component={FollowRequests} content={children} />
               <WrappedRoute path='/blocks' component={Blocks} content={children} />
               <WrappedRoute path='/mutes' component={Mutes} content={children} />
+              <WrappedRoute path='/lists' component={Lists} content={children} />
 
               <WrappedRoute component={GenericNotFound} content={children} />
             </WrappedSwitch>
diff --git a/app/javascript/flavours/glitch/reducers/accounts.js b/app/javascript/flavours/glitch/reducers/accounts.js
index 5113a281a..9ca05881a 100644
--- a/app/javascript/flavours/glitch/reducers/accounts.js
+++ b/app/javascript/flavours/glitch/reducers/accounts.js
@@ -43,6 +43,10 @@ import {
   FAVOURITED_STATUSES_FETCH_SUCCESS,
   FAVOURITED_STATUSES_EXPAND_SUCCESS,
 } from 'flavours/glitch/actions/favourites';
+import {
+  LIST_ACCOUNTS_FETCH_SUCCESS,
+  LIST_EDITOR_SUGGESTIONS_READY,
+} from 'flavours/glitch/actions/lists';
 import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
 import emojify from 'flavours/glitch/util/emoji';
 import { Map as ImmutableMap, fromJS } from 'immutable';
@@ -110,6 +114,8 @@ export default function accounts(state = initialState, action) {
   case BLOCKS_EXPAND_SUCCESS:
   case MUTES_FETCH_SUCCESS:
   case MUTES_EXPAND_SUCCESS:
+  case LIST_ACCOUNTS_FETCH_SUCCESS:
+  case LIST_EDITOR_SUGGESTIONS_READY:
     return action.accounts ? normalizeAccounts(state, action.accounts) : state;
   case NOTIFICATIONS_REFRESH_SUCCESS:
   case NOTIFICATIONS_EXPAND_SUCCESS:
diff --git a/app/javascript/flavours/glitch/reducers/accounts_counters.js b/app/javascript/flavours/glitch/reducers/accounts_counters.js
index a9aebd26f..0fd985a08 100644
--- a/app/javascript/flavours/glitch/reducers/accounts_counters.js
+++ b/app/javascript/flavours/glitch/reducers/accounts_counters.js
@@ -45,6 +45,10 @@ import {
   FAVOURITED_STATUSES_FETCH_SUCCESS,
   FAVOURITED_STATUSES_EXPAND_SUCCESS,
 } from 'flavours/glitch/actions/favourites';
+import {
+  LIST_ACCOUNTS_FETCH_SUCCESS,
+  LIST_EDITOR_SUGGESTIONS_READY,
+} from 'flavours/glitch/actions/lists';
 import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
 import { Map as ImmutableMap, fromJS } from 'immutable';
 
@@ -106,6 +110,8 @@ export default function accountsCounters(state = initialState, action) {
   case BLOCKS_EXPAND_SUCCESS:
   case MUTES_FETCH_SUCCESS:
   case MUTES_EXPAND_SUCCESS:
+  case LIST_ACCOUNTS_FETCH_SUCCESS:
+  case LIST_EDITOR_SUGGESTIONS_READY:
     return action.accounts ? normalizeAccounts(state, action.accounts) : state;
   case NOTIFICATIONS_REFRESH_SUCCESS:
   case NOTIFICATIONS_EXPAND_SUCCESS:
diff --git a/app/javascript/flavours/glitch/reducers/index.js b/app/javascript/flavours/glitch/reducers/index.js
index 25baaef71..e9c8d7c1d 100644
--- a/app/javascript/flavours/glitch/reducers/index.js
+++ b/app/javascript/flavours/glitch/reducers/index.js
@@ -24,6 +24,7 @@ import notifications from './notifications';
 import height_cache from './height_cache';
 import custom_emojis from './custom_emojis';
 import lists from './lists';
+import listEditor from './list_editor';
 
 const reducers = {
   timelines,
@@ -51,6 +52,7 @@ const reducers = {
   height_cache,
   custom_emojis,
   lists,
+  listEditor,
 };
 
 export default combineReducers(reducers);
diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js
index 6d5d71217..aaf7938df 100644
--- a/app/javascript/flavours/glitch/reducers/settings.js
+++ b/app/javascript/flavours/glitch/reducers/settings.js
@@ -2,6 +2,7 @@ import { SETTING_CHANGE, SETTING_SAVE } from 'flavours/glitch/actions/settings';
 import { COLUMN_ADD, COLUMN_REMOVE, COLUMN_MOVE } from 'flavours/glitch/actions/columns';
 import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
 import { EMOJI_USE } from 'flavours/glitch/actions/emojis';
+import { LIST_DELETE_SUCCESS, LIST_FETCH_FAIL } from '../actions/lists';
 import { Map as ImmutableMap, fromJS } from 'immutable';
 import uuid from 'flavours/glitch/util/uuid';
 
@@ -92,6 +93,8 @@ const moveColumn = (state, uuid, direction) => {
 
 const updateFrequentEmojis = (state, emoji) => state.update('frequentlyUsedEmojis', ImmutableMap(), map => map.update(emoji.id, 0, count => count + 1)).set('saved', false);
 
+const filterDeadListColumns = (state, listId) => state.update('columns', columns => columns.filterNot(column => column.get('id') === 'LIST' && column.get('params').get('id') === listId));
+
 export default function settings(state = initialState, action) {
   switch(action.type) {
   case STORE_HYDRATE:
@@ -114,6 +117,10 @@ export default function settings(state = initialState, action) {
     return updateFrequentEmojis(state, action.emoji);
   case SETTING_SAVE:
     return state.set('saved', true);
+  case LIST_FETCH_FAIL:
+    return action.error.response.status === 404 ? filterDeadListColumns(state, action.id) : state;
+  case LIST_DELETE_SUCCESS:
+    return filterDeadListColumns(state, action.id);
   default:
     return state;
   }
diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss
index 7aeab0a6a..147690562 100644
--- a/app/javascript/flavours/glitch/styles/components/index.scss
+++ b/app/javascript/flavours/glitch/styles/components/index.scss
@@ -4827,6 +4827,90 @@ noscript {
   }
 }
 
+
+.column-inline-form {
+  padding: 7px 15px;
+  padding-right: 5px;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  background: lighten($ui-base-color, 4%);
+
+  label {
+    flex: 1 1 auto;
+
+    input {
+      width: 100%;
+      margin-bottom: 6px;
+    }
+  }
+
+  .icon-button {
+    flex: 0 0 auto;
+    margin-left: 5px;
+  }
+}
+
+.drawer__backdrop {
+  cursor: pointer;
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background: rgba($base-overlay-background, 0.5);
+}
+
+.list-editor {
+  background: $ui-base-color;
+  flex-direction: column;
+  border-radius: 8px;
+  box-shadow: 2px 4px 15px rgba($base-shadow-color, 0.4);
+  width: 40vh;
+  overflow: hidden;
+
+  h4 {
+    padding: 15px 0;
+    background: lighten($ui-base-color, 13%);
+    font-weight: 500;
+    font-size: 16px;
+    text-align: center;
+    border-radius: 8px 8px 0 0;
+  }
+
+  .drawer__pager {
+    height: 50vh;
+  }
+
+  .drawer__inner {
+    border-radius: 0 0 8px 8px;
+
+    &.backdrop {
+      width: calc(100% - 60px);
+      box-shadow: 2px 4px 15px rgba($base-shadow-color, 0.4);
+      border-radius: 0 0 0 8px;
+    }
+  }
+
+  &__accounts {
+    overflow-y: auto;
+  }
+
+  .account__display-name {
+    &:hover strong {
+      text-decoration: none;
+    }
+  }
+
+  .account__avatar {
+    cursor: default;
+  }
+
+  .search {
+    margin-bottom: 0;
+  }
+}
+
 @import 'doodle';
 @import 'emoji_picker';
 @import 'local_settings';
diff --git a/app/javascript/flavours/glitch/util/async-components.js b/app/javascript/flavours/glitch/util/async-components.js
index 3056deab2..e4c991f01 100644
--- a/app/javascript/flavours/glitch/util/async-components.js
+++ b/app/javascript/flavours/glitch/util/async-components.js
@@ -30,6 +30,14 @@ export function ListTimeline () {
   return import(/* webpackChunkName: "features/list_timeline" */'flavours/glitch/features/list_timeline');
 }
 
+export function Lists () {
+  return import(/* webpackChunkName: "features/lists" */'flavours/glitch/features/lists');
+}
+
+export function ListEditor () {
+  return import(/* webpackChunkName: "features/list_editor" */'flavours/glitch/features/list_editor');
+}
+
 export function DirectTimeline() {
   return import(/* webpackChunkName: "flavours/glitch/async/direct_timeline" */'flavours/glitch/features/direct_timeline');
 }
-- 
cgit 


From b165950ca76f45bc04a730d61853063c0100914c Mon Sep 17 00:00:00 2001
From: cwm <chriswmartin@protonmail.com>
Date: Fri, 8 Dec 2017 20:30:45 -0600
Subject: add keyboard shortcut to getting started, add missing list style

---
 .../flavours/glitch/features/getting_started/index.js        |  3 ++-
 app/javascript/flavours/glitch/styles/components/index.scss  | 12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js
index 469fc2aa7..5307e583f 100644
--- a/app/javascript/flavours/glitch/features/getting_started/index.js
+++ b/app/javascript/flavours/glitch/features/getting_started/index.js
@@ -30,6 +30,7 @@ const messages = defineMessages({
   show_me_around: { id: 'getting_started.onboarding', defaultMessage: 'Show me around' },
   pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },
   lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },
+  keyboard_shortcuts: { id: 'navigation_bar.keyboard_shortcuts', defaultMessage: 'Keyboard shortcuts' },
 });
 
 const mapStateToProps = state => ({
@@ -88,7 +89,7 @@ export default class GettingStarted extends ImmutablePureComponent {
     navItems = navItems.concat([
       <ColumnLink key='5' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,
       <ColumnLink key='6' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />,
-      <ColumnLink key='9' icon='bars' text={intl.formatMessage(messages.lists)} to='/lists' />,
+      <ColumnLink key='11' icon='bars' text={intl.formatMessage(messages.lists)} to='/lists' />,
     ]);
 
     if (myAccount.get('locked')) {
diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss
index 147690562..db51b164d 100644
--- a/app/javascript/flavours/glitch/styles/components/index.scss
+++ b/app/javascript/flavours/glitch/styles/components/index.scss
@@ -2542,6 +2542,10 @@ button.icon-button.active i.fa-retweet {
   margin-left: 0;
 }
 
+.column-header__links .text-btn {
+  margin-right: 10px;
+}
+
 .column-header__button {
   background: lighten($ui-base-color, 4%);
   border: 0;
@@ -2664,6 +2668,14 @@ button.icon-button.active i.fa-retweet {
     overflow-y: hidden;
   }
 
+  hr {
+    height: 0;
+    background: transparent;
+    border: 0;
+    border-top: 1px solid lighten($ui-base-color, 12%);
+    margin: 10px 0;
+  }
+
   // notif cleaning drawer
   &.ncd {
     transition: none;
-- 
cgit 


From 28423dd0465cd88f274556023d6c6536199a1a53 Mon Sep 17 00:00:00 2001
From: cwm <chriswmartin@protonmail.com>
Date: Fri, 8 Dec 2017 20:45:18 -0600
Subject: merge tootsuite pr #5904 into glitch flavour

---
 app/javascript/flavours/glitch/styles/components/index.scss | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss
index db51b164d..03874845e 100644
--- a/app/javascript/flavours/glitch/styles/components/index.scss
+++ b/app/javascript/flavours/glitch/styles/components/index.scss
@@ -4878,9 +4878,13 @@ noscript {
   flex-direction: column;
   border-radius: 8px;
   box-shadow: 2px 4px 15px rgba($base-shadow-color, 0.4);
-  width: 40vh;
+  width: 380px;
   overflow: hidden;
 
+  @media screen and (max-width: 420px) {
+    width: 90%;
+  }
+
   h4 {
     padding: 15px 0;
     background: lighten($ui-base-color, 13%);
-- 
cgit 


From 4a5401a58e2c91ad8b7aab85aaff18c991317382 Mon Sep 17 00:00:00 2001
From: cwm <chriswmartin@protonmail.com>
Date: Fri, 8 Dec 2017 20:50:39 -0600
Subject: merge tootsuite prs #5895 and #5889 into glitch flavour

---
 app/javascript/flavours/glitch/components/autosuggest_textarea.js | 1 +
 app/javascript/flavours/glitch/styles/components/index.scss       | 4 ++++
 2 files changed, 5 insertions(+)

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js
index 551528e5a..d067b252f 100644
--- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js
+++ b/app/javascript/flavours/glitch/components/autosuggest_textarea.js
@@ -209,6 +209,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
             onBlur={this.onBlur}
             onPaste={this.onPaste}
             style={style}
+	    aria-autocomplete='list'
           />
         </label>
 
diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss
index 03874845e..e171b72c1 100644
--- a/app/javascript/flavours/glitch/styles/components/index.scss
+++ b/app/javascript/flavours/glitch/styles/components/index.scss
@@ -4854,6 +4854,10 @@ noscript {
     input {
       width: 100%;
       margin-bottom: 6px;
+
+      &:focus {
+        outline: 0;
+      }
     }
   }
 
-- 
cgit 


From 02d71c6a11339f3a6bd28b2ce14251a62185dd43 Mon Sep 17 00:00:00 2001
From: cwm <chriswmartin@protonmail.com>
Date: Fri, 8 Dec 2017 21:09:53 -0600
Subject: fix a missing semicolon and mixed tabs/spaces that travis was
 complaining about

---
 app/javascript/flavours/glitch/actions/timelines.js               | 2 +-
 app/javascript/flavours/glitch/components/autosuggest_textarea.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/actions/timelines.js b/app/javascript/flavours/glitch/actions/timelines.js
index 1665c2c48..9a5b2e6da 100644
--- a/app/javascript/flavours/glitch/actions/timelines.js
+++ b/app/javascript/flavours/glitch/actions/timelines.js
@@ -119,7 +119,7 @@ export const refreshDirectTimeline       = () => refreshTimeline('direct', '/api
 export const refreshAccountTimeline      = accountId => refreshTimeline(`account:${accountId}`, `/api/v1/accounts/${accountId}/statuses`);
 export const refreshAccountMediaTimeline = accountId => refreshTimeline(`account:${accountId}:media`, `/api/v1/accounts/${accountId}/statuses`, { only_media: true });
 export const refreshHashtagTimeline      = hashtag => refreshTimeline(`hashtag:${hashtag}`, `/api/v1/timelines/tag/${hashtag}`);
-export const refreshListTimeline         = id => refreshTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`)
+export const refreshListTimeline         = id => refreshTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`);
 
 export function refreshTimelineFail(timeline, error, skipLoading) {
   return {
diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js
index d067b252f..a29b2c9c5 100644
--- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js
+++ b/app/javascript/flavours/glitch/components/autosuggest_textarea.js
@@ -209,7 +209,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
             onBlur={this.onBlur}
             onPaste={this.onPaste}
             style={style}
-	    aria-autocomplete='list'
+            aria-autocomplete='list'
           />
         </label>
 
-- 
cgit 


From baf9ea80180afbd905397d67085b174a0921b7e8 Mon Sep 17 00:00:00 2001
From: cwm <chriswmartin@protonmail.com>
Date: Sat, 9 Dec 2017 10:32:46 -0600
Subject: remove keyboard shortcuts from getting started because thats a
 different thing

---
 app/javascript/flavours/glitch/features/getting_started/index.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js
index 5307e583f..47142fdd1 100644
--- a/app/javascript/flavours/glitch/features/getting_started/index.js
+++ b/app/javascript/flavours/glitch/features/getting_started/index.js
@@ -89,7 +89,7 @@ export default class GettingStarted extends ImmutablePureComponent {
     navItems = navItems.concat([
       <ColumnLink key='5' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,
       <ColumnLink key='6' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />,
-      <ColumnLink key='11' icon='bars' text={intl.formatMessage(messages.lists)} to='/lists' />,
+      <ColumnLink key='10' icon='bars' text={intl.formatMessage(messages.lists)} to='/lists' />,
     ]);
 
     if (myAccount.get('locked')) {
@@ -99,7 +99,6 @@ export default class GettingStarted extends ImmutablePureComponent {
     navItems = navItems.concat([
       <ColumnLink key='8' icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />,
       <ColumnLink key='9' icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />,
-      <ColumnLink key='10' icon='question' text={intl.formatMessage(messages.keyboard_shortcuts)} to='/keyboard-shortcuts' hideOnMobile />,
     ]);
 
     return (
-- 
cgit 


From d08d0f9f3335b2edbacf1febd4584eed9a7d1a11 Mon Sep 17 00:00:00 2001
From: kibigo! <marrus-sh@users.noreply.github.com>
Date: Thu, 7 Dec 2017 14:42:21 -0800
Subject: Ruby intl8n for themes

---
 app/javascript/flavours/glitch/names.yml       | 6 ++++++
 app/javascript/flavours/vanilla/names.yml      | 6 ++++++
 app/javascript/skins/vanilla/win95.scss        | 1 -
 app/javascript/skins/vanilla/win95/common.scss | 1 +
 app/javascript/skins/vanilla/win95/names.yml   | 4 ++++
 app/views/settings/preferences/show.html.haml  | 4 ++--
 config/initializers/locale.rb                  | 6 ++++++
 7 files changed, 25 insertions(+), 3 deletions(-)
 create mode 100644 app/javascript/flavours/glitch/names.yml
 create mode 100644 app/javascript/flavours/vanilla/names.yml
 delete mode 100644 app/javascript/skins/vanilla/win95.scss
 create mode 100644 app/javascript/skins/vanilla/win95/common.scss
 create mode 100644 app/javascript/skins/vanilla/win95/names.yml
 create mode 100644 config/initializers/locale.rb

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/names.yml b/app/javascript/flavours/glitch/names.yml
new file mode 100644
index 000000000..b3d579cb2
--- /dev/null
+++ b/app/javascript/flavours/glitch/names.yml
@@ -0,0 +1,6 @@
+en:
+  flavours:
+    glitch: Glitch Edition
+  skins:
+    glitch:
+      default: Default
diff --git a/app/javascript/flavours/vanilla/names.yml b/app/javascript/flavours/vanilla/names.yml
new file mode 100644
index 000000000..8816fcb3a
--- /dev/null
+++ b/app/javascript/flavours/vanilla/names.yml
@@ -0,0 +1,6 @@
+en:
+  flavours:
+    vanilla: Vanilla Mastodon
+  skins:
+    vanilla:
+      default: Default
diff --git a/app/javascript/skins/vanilla/win95.scss b/app/javascript/skins/vanilla/win95.scss
deleted file mode 100644
index 298f6ee9d..000000000
--- a/app/javascript/skins/vanilla/win95.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import 'styles/win95';
diff --git a/app/javascript/skins/vanilla/win95/common.scss b/app/javascript/skins/vanilla/win95/common.scss
new file mode 100644
index 000000000..298f6ee9d
--- /dev/null
+++ b/app/javascript/skins/vanilla/win95/common.scss
@@ -0,0 +1 @@
+@import 'styles/win95';
diff --git a/app/javascript/skins/vanilla/win95/names.yml b/app/javascript/skins/vanilla/win95/names.yml
new file mode 100644
index 000000000..2083084a2
--- /dev/null
+++ b/app/javascript/skins/vanilla/win95/names.yml
@@ -0,0 +1,4 @@
+en:
+  skins:
+    vanilla:
+      win95: Masto95
diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml
index 9564c0399..e2e48a699 100644
--- a/app/views/settings/preferences/show.html.haml
+++ b/app/views/settings/preferences/show.html.haml
@@ -27,8 +27,8 @@
 
   .fields-group
     - if Themes.instance.flavours.size > 1
-      = f.input :setting_flavour, collection: Themes.instance.flavours, label_method: lambda { |flavour| I18n.t("themes.#{flavour}", default: flavour) }, wrapper: :with_label, include_blank: false
-      = f.input :setting_skin, collection: Themes.instance.skins_for(current_flavour), label_method: lambda { |skin| I18n.t("themes.#{current_flavour}.skins.#{skin}", default: skin) }, wrapper: :with_label, include_blank: false
+      = f.input :setting_flavour, collection: Themes.instance.flavours, label_method: lambda { |flavour| I18n.t("flavours.#{flavour}", default: flavour) }, wrapper: :with_label, include_blank: false
+      = f.input :setting_skin, collection: Themes.instance.skins_for(current_flavour), label_method: lambda { |skin| I18n.t("skins.#{current_flavour}.#{skin}", default: skin) }, wrapper: :with_label, include_blank: false
 
     = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label
     = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label
diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb
new file mode 100644
index 000000000..04ed31646
--- /dev/null
+++ b/config/initializers/locale.rb
@@ -0,0 +1,6 @@
+# frozen_string_literal: true
+
+I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names.{rb,yml}').to_s]
+I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names', '*.{rb,yml}').to_s]
+I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names.{rb,yml}').to_s]
+I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s]
-- 
cgit 


From b28cd6769c77190160e4ffefde78b324c7aad269 Mon Sep 17 00:00:00 2001
From: kibigo! <marrus-sh@users.noreply.github.com>
Date: Thu, 7 Dec 2017 19:07:47 -0800
Subject: Javascript intl8n flavour support

---
 app/controllers/application_controller.rb          |   2 +
 app/javascript/flavours/glitch/locales/ar.js       |   7 +
 app/javascript/flavours/glitch/locales/bg.js       |   7 +
 app/javascript/flavours/glitch/locales/ca.js       |   7 +
 app/javascript/flavours/glitch/locales/de.js       |   7 +
 app/javascript/flavours/glitch/locales/en.js       |  50 +++++
 app/javascript/flavours/glitch/locales/eo.js       |   7 +
 app/javascript/flavours/glitch/locales/es.js       |   7 +
 app/javascript/flavours/glitch/locales/fa.js       |   7 +
 app/javascript/flavours/glitch/locales/fi.js       |   7 +
 app/javascript/flavours/glitch/locales/fr.js       |   7 +
 app/javascript/flavours/glitch/locales/he.js       |   7 +
 app/javascript/flavours/glitch/locales/hr.js       |   7 +
 app/javascript/flavours/glitch/locales/hu.js       |   7 +
 app/javascript/flavours/glitch/locales/id.js       |   7 +
 app/javascript/flavours/glitch/locales/io.js       |   7 +
 app/javascript/flavours/glitch/locales/it.js       |   7 +
 app/javascript/flavours/glitch/locales/ja.js       |   7 +
 app/javascript/flavours/glitch/locales/ko.js       |   7 +
 app/javascript/flavours/glitch/locales/nl.js       |   7 +
 app/javascript/flavours/glitch/locales/no.js       |   7 +
 app/javascript/flavours/glitch/locales/oc.js       |   7 +
 app/javascript/flavours/glitch/locales/pl.js       |  48 +++++
 app/javascript/flavours/glitch/locales/pt-BR.js    |   7 +
 app/javascript/flavours/glitch/locales/pt.js       |   7 +
 app/javascript/flavours/glitch/locales/ru.js       |   7 +
 app/javascript/flavours/glitch/locales/sv.js       |   7 +
 app/javascript/flavours/glitch/locales/th.js       |   7 +
 app/javascript/flavours/glitch/locales/tr.js       |   7 +
 app/javascript/flavours/glitch/locales/uk.js       |   7 +
 app/javascript/flavours/glitch/locales/zh-CN.js    |   7 +
 app/javascript/flavours/glitch/locales/zh-HK.js    |   7 +
 app/javascript/flavours/glitch/locales/zh-TW.js    |   7 +
 app/javascript/flavours/glitch/theme.yml           |   6 +
 app/javascript/flavours/vanilla/theme.yml          |  10 +-
 app/javascript/glitch/locales/en.json              |  46 -----
 app/javascript/glitch/locales/pl.json              |  44 ----
 app/javascript/locales/locale-data/README.md       | 221 +++++++++++++++++++++
 app/javascript/locales/locale-data/oc.js           | 108 ++++++++++
 .../mastodon/locales/locale-data/README.md         | 221 ---------------------
 app/javascript/mastodon/locales/locale-data/oc.js  | 108 ----------
 app/lib/themes.rb                                  |   8 +
 app/views/layouts/application.html.haml            |   5 +-
 config/webpack/configuration.js                    |   5 +-
 config/webpack/generateLocalePacks.js              | 108 +++++-----
 config/webpack/shared.js                           |   8 +-
 46 files changed, 722 insertions(+), 486 deletions(-)
 create mode 100644 app/javascript/flavours/glitch/locales/ar.js
 create mode 100644 app/javascript/flavours/glitch/locales/bg.js
 create mode 100644 app/javascript/flavours/glitch/locales/ca.js
 create mode 100644 app/javascript/flavours/glitch/locales/de.js
 create mode 100644 app/javascript/flavours/glitch/locales/en.js
 create mode 100644 app/javascript/flavours/glitch/locales/eo.js
 create mode 100644 app/javascript/flavours/glitch/locales/es.js
 create mode 100644 app/javascript/flavours/glitch/locales/fa.js
 create mode 100644 app/javascript/flavours/glitch/locales/fi.js
 create mode 100644 app/javascript/flavours/glitch/locales/fr.js
 create mode 100644 app/javascript/flavours/glitch/locales/he.js
 create mode 100644 app/javascript/flavours/glitch/locales/hr.js
 create mode 100644 app/javascript/flavours/glitch/locales/hu.js
 create mode 100644 app/javascript/flavours/glitch/locales/id.js
 create mode 100644 app/javascript/flavours/glitch/locales/io.js
 create mode 100644 app/javascript/flavours/glitch/locales/it.js
 create mode 100644 app/javascript/flavours/glitch/locales/ja.js
 create mode 100644 app/javascript/flavours/glitch/locales/ko.js
 create mode 100644 app/javascript/flavours/glitch/locales/nl.js
 create mode 100644 app/javascript/flavours/glitch/locales/no.js
 create mode 100644 app/javascript/flavours/glitch/locales/oc.js
 create mode 100644 app/javascript/flavours/glitch/locales/pl.js
 create mode 100644 app/javascript/flavours/glitch/locales/pt-BR.js
 create mode 100644 app/javascript/flavours/glitch/locales/pt.js
 create mode 100644 app/javascript/flavours/glitch/locales/ru.js
 create mode 100644 app/javascript/flavours/glitch/locales/sv.js
 create mode 100644 app/javascript/flavours/glitch/locales/th.js
 create mode 100644 app/javascript/flavours/glitch/locales/tr.js
 create mode 100644 app/javascript/flavours/glitch/locales/uk.js
 create mode 100644 app/javascript/flavours/glitch/locales/zh-CN.js
 create mode 100644 app/javascript/flavours/glitch/locales/zh-HK.js
 create mode 100644 app/javascript/flavours/glitch/locales/zh-TW.js
 delete mode 100644 app/javascript/glitch/locales/en.json
 delete mode 100644 app/javascript/glitch/locales/pl.json
 create mode 100644 app/javascript/locales/locale-data/README.md
 create mode 100644 app/javascript/locales/locale-data/oc.js
 delete mode 100644 app/javascript/mastodon/locales/locale-data/README.md
 delete mode 100644 app/javascript/mastodon/locales/locale-data/oc.js

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c6d148c8c..3b2070f39 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -62,6 +62,7 @@ class ApplicationController < ActionController::Base
       pack: pack_name,
       preload: nil,
       skin: nil,
+      supported_locales: data['locales'],
     }
     if data['pack'][pack_name].is_a?(Hash)
       pack_data[:common] = nil if data['pack'][pack_name]['use_common'] == false
@@ -93,6 +94,7 @@ class ApplicationController < ActionController::Base
       pack: nil,
       preload: nil,
       skin: nil,
+      supported_locales: data['locales'],
     }
   end
 
diff --git a/app/javascript/flavours/glitch/locales/ar.js b/app/javascript/flavours/glitch/locales/ar.js
new file mode 100644
index 000000000..1081147d5
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/ar.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/ar.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/bg.js b/app/javascript/flavours/glitch/locales/bg.js
new file mode 100644
index 000000000..979039376
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/bg.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/bg.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/ca.js b/app/javascript/flavours/glitch/locales/ca.js
new file mode 100644
index 000000000..baf76bd6f
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/ca.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/ca.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/de.js b/app/javascript/flavours/glitch/locales/de.js
new file mode 100644
index 000000000..ce6453623
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/de.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/de.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/en.js b/app/javascript/flavours/glitch/locales/en.js
new file mode 100644
index 000000000..96182196e
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/en.js
@@ -0,0 +1,50 @@
+import inherited from 'mastodon/locales/en.json';
+
+const messages = {
+  "getting_started.open_source_notice": "Glitchsoc is free open source software forked from {Mastodon}. You can contribute or report issues on GitHub at {github}.",
+  "layout.auto": "Auto",
+  "layout.current_is": "Your current layout is:",
+  "layout.desktop": "Desktop",
+  "layout.mobile": "Mobile",
+  "navigation_bar.app_settings": "App settings",
+  "getting_started.onboarding": "Show me around",
+  "onboarding.page_one.federation": "{domain} is an 'instance' of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.",
+  "onboarding.page_one.welcome": "Welcome to {domain}!",
+  "onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}, and is compatible with any Mastodon instance or app. Glitchsoc is entirely free and open-source. You can report bugs, request features, or contribute to the code on {github}.",
+  "settings.auto_collapse": "Automatic collapsing",
+  "settings.auto_collapse_all": "Everything",
+  "settings.auto_collapse_lengthy": "Lengthy toots",
+  "settings.auto_collapse_media": "Toots with media",
+  "settings.auto_collapse_notifications": "Notifications",
+  "settings.auto_collapse_reblogs": "Boosts",
+  "settings.auto_collapse_replies": "Replies",
+  "settings.close": "Close",
+  "settings.collapsed_statuses": "Collapsed toots",
+  "settings.enable_collapsed": "Enable collapsed toots",
+  "settings.general": "General",
+  "settings.image_backgrounds": "Image backgrounds",
+  "settings.image_backgrounds_media": "Preview collapsed toot media",
+  "settings.image_backgrounds_users": "Give collapsed toots an image background",
+  "settings.media": "Media",
+  "settings.media_letterbox": "Letterbox media",
+  "settings.media_fullwidth": "Full-width media previews",
+  "settings.preferences": "User preferences",
+  "settings.wide_view": "Wide view (Desktop mode only)",
+  "settings.navbar_under": "Navbar at the bottom (Mobile only)",
+  "status.collapse": "Collapse",
+  "status.uncollapse": "Uncollapse",
+
+  "home.column_settings.show_direct": "Show DMs",
+
+  "notification.markForDeletion": "Mark for deletion",
+  "notifications.clear": "Clear all my notifications",
+  "notifications.marked_clear_confirmation": "Are you sure you want to permanently clear all selected notifications?",
+  "notifications.marked_clear": "Clear selected notifications",
+
+  "notification_purge.btn_all": "Select\nall",
+  "notification_purge.btn_none": "Select\nnone",
+  "notification_purge.btn_invert": "Invert\nselection",
+  "notification_purge.btn_apply": "Clear\nselected",
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/eo.js b/app/javascript/flavours/glitch/locales/eo.js
new file mode 100644
index 000000000..04192f506
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/eo.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/eo.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/es.js b/app/javascript/flavours/glitch/locales/es.js
new file mode 100644
index 000000000..456df3c47
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/es.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/es.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/fa.js b/app/javascript/flavours/glitch/locales/fa.js
new file mode 100644
index 000000000..d82461a1a
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/fa.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/fa.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/fi.js b/app/javascript/flavours/glitch/locales/fi.js
new file mode 100644
index 000000000..11c3cd082
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/fi.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/fi.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/fr.js b/app/javascript/flavours/glitch/locales/fr.js
new file mode 100644
index 000000000..8562f5594
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/fr.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/fr.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/he.js b/app/javascript/flavours/glitch/locales/he.js
new file mode 100644
index 000000000..99516ee0c
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/he.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/he.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/hr.js b/app/javascript/flavours/glitch/locales/hr.js
new file mode 100644
index 000000000..dbf9b4b9f
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/hr.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/hr.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/hu.js b/app/javascript/flavours/glitch/locales/hu.js
new file mode 100644
index 000000000..1f0849af3
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/hu.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/hu.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/id.js b/app/javascript/flavours/glitch/locales/id.js
new file mode 100644
index 000000000..07e5f7e56
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/id.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/id.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/io.js b/app/javascript/flavours/glitch/locales/io.js
new file mode 100644
index 000000000..74ea6fae6
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/io.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/io.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/it.js b/app/javascript/flavours/glitch/locales/it.js
new file mode 100644
index 000000000..90f543093
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/it.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/it.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/ja.js b/app/javascript/flavours/glitch/locales/ja.js
new file mode 100644
index 000000000..cc7143443
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/ja.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/ja.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/ko.js b/app/javascript/flavours/glitch/locales/ko.js
new file mode 100644
index 000000000..3b55f89b9
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/ko.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/ko.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/nl.js b/app/javascript/flavours/glitch/locales/nl.js
new file mode 100644
index 000000000..17c371c58
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/nl.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/nl.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/no.js b/app/javascript/flavours/glitch/locales/no.js
new file mode 100644
index 000000000..794b1da25
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/no.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/no.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/oc.js b/app/javascript/flavours/glitch/locales/oc.js
new file mode 100644
index 000000000..8f161fd8c
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/oc.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/oc.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/pl.js b/app/javascript/flavours/glitch/locales/pl.js
new file mode 100644
index 000000000..ab96dec60
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/pl.js
@@ -0,0 +1,48 @@
+import inherited from 'mastodon/locales/pl.json';
+
+const messages = {
+  "getting_started.open_source_notice": "Glitchsoc jest wolnym i otwartoźródłowym forkiem oprogramowania {Mastodon}. Możesz współtworzyć projekt lub zgłaszać błędy na GitHubie pod adresem {github}.",
+  "layout.auto": "Automatyczny",
+  "layout.current_is": "Twój obecny układ to:",
+  "layout.desktop": "Desktopowy",
+  "layout.mobile": "Mobilny",
+  "navigation_bar.app_settings": "Ustawienia aplikacji",
+  "getting_started.onboarding": "Rozejrzyj się",
+  "onboarding.page_one.federation": "{domain} jest 'instancją' Mastodona. Mastodon to sieć działających niezależnie serwerów tworzących jedną sieć społecznościową. Te serwery nazywane są instancjami.",
+  "onboarding.page_one.welcome": "Witamy na {domain}!",
+  "onboarding.page_six.github": "{domain} jest oparty na Glitchsoc. Glitchsoc jest {forkiem} {Mastodon}a kompatybilnym z każdym klientem i aplikacją Mastodona. Glitchsoc jest całkowicie wolnym i otwartoźródłowym oprogramowaniem. Możesz zgłaszać błędy i sugestie funkcji oraz współtworzyć projekt na {github}.",
+  "settings.auto_collapse": "Automatyczne zwijanie",
+  "settings.auto_collapse_all": "Wszystko",
+  "settings.auto_collapse_lengthy": "Długie wpisy",
+  "settings.auto_collapse_media": "Wpisy z zawartością multimedialną",
+  "settings.auto_collapse_notifications": "Powiadomienia",
+  "settings.auto_collapse_reblogs": "Podbicia",
+  "settings.auto_collapse_replies": "Odpowiedzi",
+  "settings.close": "Zamknij",
+  "settings.collapsed_statuses": "Zwijanie wpisów",
+  "settings.enable_collapsed": "Włącz zwijanie wpisów",
+  "settings.general": "Ogólne",
+  "settings.image_backgrounds": "Obrazy w tle",
+  "settings.image_backgrounds_media": "Wyświetlaj zawartość multimedialną zwiniętych wpisów",
+  "settings.image_backgrounds_users": "Nadaj tło zwiniętym wpisom",
+  "settings.media": "Zawartość multimedialna",
+  "settings.media_letterbox": "Letterbox media",
+  "settings.media_fullwidth": "Podgląd zawartości multimedialnej o pełnej szerokości",
+  "settings.preferences": "Preferencje użyytkownika",
+  "settings.wide_view": "Szeroki widok (tylko w trybie desktopowym)",
+  "settings.navbar_under": "Pasek nawigacji na dole (tylko w trybie mobilnym)",
+  "status.collapse": "Zwiń",
+  "status.uncollapse": "Rozwiń",
+
+  "notification.markForDeletion": "Oznacz do usunięcia",
+  "notifications.clear": "Wyczyść wszystkie powiadomienia",
+  "notifications.marked_clear_confirmation": "Czy na pewno chcesz bezpowrtonie usunąć wszystkie powiadomienia?",
+  "notifications.marked_clear": "Usuń zaznaczone powiadomienia",
+
+  "notification_purge.btn_all": "Zaznacz\nwszystkie",
+  "notification_purge.btn_none": "Odznacz\nwszystkie",
+  "notification_purge.btn_invert": "Odwróć\nzaznaczenie",
+  "notification_purge.btn_apply": "Usuń\nzaznaczone"
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/pt-BR.js b/app/javascript/flavours/glitch/locales/pt-BR.js
new file mode 100644
index 000000000..6fed635f8
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/pt-BR.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/pt-BR.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/pt.js b/app/javascript/flavours/glitch/locales/pt.js
new file mode 100644
index 000000000..0156f55ff
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/pt.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/pt.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/ru.js b/app/javascript/flavours/glitch/locales/ru.js
new file mode 100644
index 000000000..0e9f1de71
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/ru.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/ru.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/sv.js b/app/javascript/flavours/glitch/locales/sv.js
new file mode 100644
index 000000000..b62c353fe
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/sv.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/sv.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/th.js b/app/javascript/flavours/glitch/locales/th.js
new file mode 100644
index 000000000..e939f8631
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/th.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/th.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/tr.js b/app/javascript/flavours/glitch/locales/tr.js
new file mode 100644
index 000000000..c2b740617
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/tr.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/tr.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/uk.js b/app/javascript/flavours/glitch/locales/uk.js
new file mode 100644
index 000000000..ab6d9a7dc
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/uk.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/uk.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/zh-CN.js b/app/javascript/flavours/glitch/locales/zh-CN.js
new file mode 100644
index 000000000..944588e02
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/zh-CN.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/zh-CN.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/zh-HK.js b/app/javascript/flavours/glitch/locales/zh-HK.js
new file mode 100644
index 000000000..b71c81f2b
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/zh-HK.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/zh-HK.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/zh-TW.js b/app/javascript/flavours/glitch/locales/zh-TW.js
new file mode 100644
index 000000000..de2b7769c
--- /dev/null
+++ b/app/javascript/flavours/glitch/locales/zh-TW.js
@@ -0,0 +1,7 @@
+import inherited from 'mastodon/locales/zh-TW.json';
+
+const messages = {
+  //  No translations available.
+};
+
+export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/theme.yml b/app/javascript/flavours/glitch/theme.yml
index fe09fa105..9437e2c04 100644
--- a/app/javascript/flavours/glitch/theme.yml
+++ b/app/javascript/flavours/glitch/theme.yml
@@ -20,6 +20,12 @@ pack:
   settings:
   share: packs/share.js
 
+#  (OPTIONAL) The directory which contains localization files for
+#  the flavour, relative to this directory. The contents of this
+#  directory must be `.js` or `.json` files whose names correspond to
+#  language tags and whose default exports are a messages object.
+locales: locales
+
 #  (OPTIONAL) The directory which contains the pack files.
 #  Defaults to the theme directory (`app/javascript/themes/[theme]`),
 #  which should be sufficient for like 99% of use-cases lol.
diff --git a/app/javascript/flavours/vanilla/theme.yml b/app/javascript/flavours/vanilla/theme.yml
index 67fd9723e..491ea173b 100644
--- a/app/javascript/flavours/vanilla/theme.yml
+++ b/app/javascript/flavours/vanilla/theme.yml
@@ -20,13 +20,17 @@ pack:
   settings:
   share: share.js
 
+#  (OPTIONAL) The directory which contains localization files for
+#  the flavour, relative to this directory.
+locales: ../../mastodon/locales
+
 #  (OPTIONAL) The directory which contains the pack files.
-#  Defaults to the theme directory (`app/javascript/themes/[theme]`),
-#  but in the case of the vanilla Mastodon theme the pack files are
+#  Defaults to this directory (`app/javascript/flavour/[flavour]`),
+#  but in the case of the vanilla Mastodon flavour the pack files are
 #  somewhere else.
 pack_directory: app/javascript/packs
 
-#  (OPTIONAL) By default the theme will fallback to the default theme
+#  (OPTIONAL) By default the theme will fallback to the default flavour
 #  if a particular pack is not provided. You can specify different
 #  fallbacks here, or disable fallback behaviours altogether by
 #  specifying a `null` value.
diff --git a/app/javascript/glitch/locales/en.json b/app/javascript/glitch/locales/en.json
deleted file mode 100644
index 0276cb837..000000000
--- a/app/javascript/glitch/locales/en.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
-  "getting_started.open_source_notice": "Glitchsoc is free open source software forked from {Mastodon}. You can contribute or report issues on GitHub at {github}.",
-  "layout.auto": "Auto",
-  "layout.current_is": "Your current layout is:",
-  "layout.desktop": "Desktop",
-  "layout.mobile": "Mobile",
-  "navigation_bar.app_settings": "App settings",
-  "getting_started.onboarding": "Show me around",
-  "onboarding.page_one.federation": "{domain} is an 'instance' of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.",
-  "onboarding.page_one.welcome": "Welcome to {domain}!",
-  "onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}, and is compatible with any Mastodon instance or app. Glitchsoc is entirely free and open-source. You can report bugs, request features, or contribute to the code on {github}.",
-  "settings.auto_collapse": "Automatic collapsing",
-  "settings.auto_collapse_all": "Everything",
-  "settings.auto_collapse_lengthy": "Lengthy toots",
-  "settings.auto_collapse_media": "Toots with media",
-  "settings.auto_collapse_notifications": "Notifications",
-  "settings.auto_collapse_reblogs": "Boosts",
-  "settings.auto_collapse_replies": "Replies",
-  "settings.close": "Close",
-  "settings.collapsed_statuses": "Collapsed toots",
-  "settings.enable_collapsed": "Enable collapsed toots",
-  "settings.general": "General",
-  "settings.image_backgrounds": "Image backgrounds",
-  "settings.image_backgrounds_media": "Preview collapsed toot media",
-  "settings.image_backgrounds_users": "Give collapsed toots an image background",
-  "settings.media": "Media",
-  "settings.media_letterbox": "Letterbox media",
-  "settings.media_fullwidth": "Full-width media previews",
-  "settings.preferences": "User preferences",
-  "settings.wide_view": "Wide view (Desktop mode only)",
-  "settings.navbar_under": "Navbar at the bottom (Mobile only)",
-  "status.collapse": "Collapse",
-  "status.uncollapse": "Uncollapse",
-
-  "home.column_settings.show_direct": "Show DMs",
-
-  "notification.markForDeletion": "Mark for deletion",
-  "notifications.clear": "Clear all my notifications",
-  "notifications.marked_clear_confirmation": "Are you sure you want to permanently clear all selected notifications?",
-  "notifications.marked_clear": "Clear selected notifications",
-
-  "notification_purge.btn_all": "Select\nall",
-  "notification_purge.btn_none": "Select\nnone",
-  "notification_purge.btn_invert": "Invert\nselection",
-  "notification_purge.btn_apply": "Clear\nselected"
-}
diff --git a/app/javascript/glitch/locales/pl.json b/app/javascript/glitch/locales/pl.json
deleted file mode 100644
index 1481b6a2a..000000000
--- a/app/javascript/glitch/locales/pl.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-  "getting_started.open_source_notice": "Glitchsoc jest wolnym i otwartoźródłowym forkiem oprogramowania {Mastodon}. Możesz współtworzyć projekt lub zgłaszać błędy na GitHubie pod adresem {github}.",
-  "layout.auto": "Automatyczny",
-  "layout.current_is": "Twój obecny układ to:",
-  "layout.desktop": "Desktopowy",
-  "layout.mobile": "Mobilny",
-  "navigation_bar.app_settings": "Ustawienia aplikacji",
-  "getting_started.onboarding": "Rozejrzyj się",
-  "onboarding.page_one.federation": "{domain} jest 'instancją' Mastodona. Mastodon to sieć działających niezależnie serwerów tworzących jedną sieć społecznościową. Te serwery nazywane są instancjami.",
-  "onboarding.page_one.welcome": "Witamy na {domain}!",
-  "onboarding.page_six.github": "{domain} jest oparty na Glitchsoc. Glitchsoc jest {forkiem} {Mastodon}a kompatybilnym z każdym klientem i aplikacją Mastodona. Glitchsoc jest całkowicie wolnym i otwartoźródłowym oprogramowaniem. Możesz zgłaszać błędy i sugestie funkcji oraz współtworzyć projekt na {github}.",
-  "settings.auto_collapse": "Automatyczne zwijanie",
-  "settings.auto_collapse_all": "Wszystko",
-  "settings.auto_collapse_lengthy": "Długie wpisy",
-  "settings.auto_collapse_media": "Wpisy z zawartością multimedialną",
-  "settings.auto_collapse_notifications": "Powiadomienia",
-  "settings.auto_collapse_reblogs": "Podbicia",
-  "settings.auto_collapse_replies": "Odpowiedzi",
-  "settings.close": "Zamknij",
-  "settings.collapsed_statuses": "Zwijanie wpisów",
-  "settings.enable_collapsed": "Włącz zwijanie wpisów",
-  "settings.general": "Ogólne",
-  "settings.image_backgrounds": "Obrazy w tle",
-  "settings.image_backgrounds_media": "Wyświetlaj zawartość multimedialną zwiniętych wpisów",
-  "settings.image_backgrounds_users": "Nadaj tło zwiniętym wpisom",
-  "settings.media": "Zawartość multimedialna",
-  "settings.media_letterbox": "Letterbox media",
-  "settings.media_fullwidth": "Podgląd zawartości multimedialnej o pełnej szerokości",
-  "settings.preferences": "Preferencje użyytkownika",
-  "settings.wide_view": "Szeroki widok (tylko w trybie desktopowym)",
-  "settings.navbar_under": "Pasek nawigacji na dole (tylko w trybie mobilnym)",
-  "status.collapse": "Zwiń",
-  "status.uncollapse": "Rozwiń",
-
-  "notification.markForDeletion": "Oznacz do usunięcia",
-  "notifications.clear": "Wyczyść wszystkie powiadomienia",
-  "notifications.marked_clear_confirmation": "Czy na pewno chcesz bezpowrtonie usunąć wszystkie powiadomienia?",
-  "notifications.marked_clear": "Usuń zaznaczone powiadomienia",
-
-  "notification_purge.btn_all": "Zaznacz\nwszystkie",
-  "notification_purge.btn_none": "Odznacz\nwszystkie",
-  "notification_purge.btn_invert": "Odwróć\nzaznaczenie",
-  "notification_purge.btn_apply": "Usuń\nzaznaczone"
-}
diff --git a/app/javascript/locales/locale-data/README.md b/app/javascript/locales/locale-data/README.md
new file mode 100644
index 000000000..83368fae7
--- /dev/null
+++ b/app/javascript/locales/locale-data/README.md
@@ -0,0 +1,221 @@
+# Custom Locale Data
+
+This folder is used to store custom locale data. These custom locale data are
+not yet provided by [Unicode Common Locale Data Repository](http://cldr.unicode.org/development/new-cldr-developers)
+and hence not provided in [react-intl/locale-data/*](https://github.com/yahoo/react-intl).
+
+The locale data should support [Locale Data APIs](https://github.com/yahoo/react-intl/wiki/API#locale-data-apis)
+of the react-intl library.
+
+It is recommended to start your custom locale data from this sample English
+locale data ([*](#plural-rules)):
+
+```javascript
+/*eslint eqeqeq: "off"*/
+/*eslint no-nested-ternary: "off"*/
+
+export default [
+  {
+    locale: "en",
+    pluralRuleFunction: function(e, a) {
+      var n = String(e).split("."),
+        l = !n[1],
+        o = Number(n[0]) == e,
+        t = o && n[0].slice(-1),
+        r = o && n[0].slice(-2);
+      return a ? 1 == t && 11 != r ? "one" : 2 == t && 12 != r ? "two" : 3 == t && 13 != r ? "few" : "other" : 1 == e && l ? "one" : "other"
+    },
+    fields: {
+      year: {
+        displayName: "year",
+        relative: {
+          0: "this year",
+          1: "next year",
+          "-1": "last year"
+        },
+        relativeTime: {
+          future: {
+            one: "in {0} year",
+            other: "in {0} years"
+          },
+          past: {
+            one: "{0} year ago",
+            other: "{0} years ago"
+          }
+        }
+      },
+      month: {
+        displayName: "month",
+        relative: {
+          0: "this month",
+          1: "next month",
+          "-1": "last month"
+        },
+        relativeTime: {
+          future: {
+            one: "in {0} month",
+            other: "in {0} months"
+          },
+          past: {
+            one: "{0} month ago",
+            other: "{0} months ago"
+          }
+        }
+      },
+      day: {
+        displayName: "day",
+        relative: {
+          0: "today",
+          1: "tomorrow",
+          "-1": "yesterday"
+        },
+        relativeTime: {
+          future: {
+            one: "in {0} day",
+            other: "in {0} days"
+          },
+          past: {
+            one: "{0} day ago",
+            other: "{0} days ago"
+          }
+        }
+      },
+      hour: {
+        displayName: "hour",
+        relativeTime: {
+          future: {
+            one: "in {0} hour",
+            other: "in {0} hours"
+          },
+          past: {
+            one: "{0} hour ago",
+            other: "{0} hours ago"
+          }
+        }
+      },
+      minute: {
+        displayName: "minute",
+        relativeTime: {
+          future: {
+            one: "in {0} minute",
+            other: "in {0} minutes"
+          },
+          past: {
+            one: "{0} minute ago",
+            other: "{0} minutes ago"
+          }
+        }
+      },
+      second: {
+        displayName: "second",
+        relative: {
+          0: "now"
+        },
+        relativeTime: {
+          future: {
+            one: "in {0} second",
+            other: "in {0} seconds"
+          },
+          past: {
+            one: "{0} second ago",
+            other: "{0} seconds ago"
+          }
+        }
+      }
+    }
+  }
+]
+
+```
+
+## Notes
+
+### Plural Rules
+
+The function `pluralRuleFunction()` should return the key to proper string of
+a plural form(s). The purpose of the function is to provide key of translate
+strings of correct plural form according. The different forms are described in
+[CLDR's Plural Rules][cldr-plural-rules],
+
+[cldr-plural-rules]: http://cldr.unicode.org/index/cldr-spec/plural-rules
+
+#### Quick Overview on CLDR Rules
+
+Let's take English as an example.
+
+When you describe a number, you can be either describe it as:
+* Cardinals: 1st, 2nd, 3rd ... 11th, 12th ... 21st, 22nd, 23nd ....
+* Ordinals: 1, 2, 3 ...
+
+In any of these cases, the nouns will reflect the number with singular or plural
+form. For example:
+* in 0 days
+* in 1 day
+* in 2 days
+
+The `pluralRuleFunction` receives 2 parameters:
+* `e`: a string representation of the number. Such as, "`1`", "`2`", "`2.1`".
+* `a`: `true` if this is "cardinal" type of description. `false` for ordinal and other case.
+
+#### How you should write `pluralRuleFunction`
+
+The first rule to write pluralRuleFunction is never translate the output string
+into your language. [Plural Rules][cldr-plural-rules] specified you should use
+these as the return values:
+
+  * "`zero`"
+  * "`one`" (singular)
+  * "`two`" (dual)
+  * "`few`" (paucal)
+  * "`many`" (also used for fractions if they have a separate class)
+  * "`other`" (required—general plural form—also used if the language only has a single form)
+
+Again, we'll use English as the example here.
+
+Let's read the `return` statement in the pluralRuleFunction above:
+```javascript
+  return a ? 1 == t && 11 != r ? "one" : 2 == t && 12 != r ? "two" : 3 == t && 13 != r ? "few" : "other" : 1 == e && l ? "one" : "other"
+```
+
+This nested ternary is hard to read. It basically means:
+```javascript
+// e: the number variable to examine
+// a: "true" if cardinals
+// l: "true" if the variable e has nothin after decimal mark (e.g. "1.0" would be false)
+// o: "true" if the variable e is an integer
+// t: the "ones" of the number. e.g. "3" for number "9123"
+// r: the "ones" and "tens" of the number. e.g. "23" for number "9123"
+if (a == true) {
+  if (t == 1 && r != 11) {
+    return "one"; // i.e. 1st, 21st, 101st, 121st ...
+  } else if (t == 2 && r != 12) {
+    return "two"; // i.e. 2nd, 22nd, 102nd, 122nd ...
+  } else if (t == 3 && r != 13) {
+    return "few"; // i.e. 3rd, 23rd, 103rd, 123rd ...
+  } else {
+    return "other"; // i.e. 4th, 11th, 12th, 24th ...
+  }
+} else {
+  if (e == 1 && l) {
+    return "one"; // i.e. 1 day
+  } else {
+    return "other"; // i.e. 0 days, 2 days, 3 days
+  }
+}
+```
+
+If your language, like French, do not have complicated cardinal rules, you may
+use the French's version of it:
+```javascript
+function (e, a) {
+  return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other";
+}
+```
+
+If your language, like Chinese, do not have any pluralization rule at all you
+may use the Chinese's version of it:
+```javascript
+function (e, a) {
+  return "other";
+}
+```
diff --git a/app/javascript/locales/locale-data/oc.js b/app/javascript/locales/locale-data/oc.js
new file mode 100644
index 000000000..c4b56350b
--- /dev/null
+++ b/app/javascript/locales/locale-data/oc.js
@@ -0,0 +1,108 @@
+/*eslint eqeqeq: "off"*/
+/*eslint no-nested-ternary: "off"*/
+/*eslint quotes: "off"*/
+
+export default [{
+  locale: "oc",
+  pluralRuleFunction: function (e, a) {
+    return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other";
+  },
+  fields: {
+    year: {
+      displayName: "an",
+      relative: {
+        0: "ongan",
+        1: "l'an que ven",
+        "-1": "l'an passat",
+      },
+      relativeTime: {
+        future: {
+          one: "dins {0} an",
+          other: "dins {0} ans",
+        },
+        past: {
+          one: "fa {0} an",
+          other: "fa {0} ans",
+        },
+      },
+    },
+    month: {
+      displayName: "mes",
+      relative: {
+        0: "aqueste mes",
+        1: "lo mes que ven",
+        "-1": "lo mes passat",
+      },
+      relativeTime: {
+        future: {
+          one: "dins {0} mes",
+          other: "dins {0} meses",
+        },
+        past: {
+          one: "fa {0} mes",
+          other: "fa {0} meses",
+        },
+      },
+    },
+    day: {
+      displayName: "jorn",
+      relative: {
+        0: "uèi",
+        1: "deman",
+        "-1": "ièr",
+      },
+      relativeTime: {
+        future: {
+          one: "dins {0} jorn",
+          other: "dins {0} jorns",
+        },
+        past: {
+          one: "fa {0} jorn",
+          other: "fa {0} jorns",
+        },
+      },
+    },
+    hour: {
+      displayName: "ora",
+      relativeTime: {
+        future: {
+          one: "dins {0} ora",
+          other: "dins {0} oras",
+        },
+        past: {
+          one: "fa {0} ora",
+          other: "fa {0} oras",
+        },
+      },
+    },
+    minute: {
+      displayName: "minuta",
+      relativeTime: {
+        future: {
+          one: "dins {0} minuta",
+          other: "dins {0} minutas",
+        },
+        past: {
+          one: "fa {0} minuta",
+          other: "fa {0} minutas",
+        },
+      },
+    },
+    second: {
+      displayName: "segonda",
+      relative: {
+        0: "ara",
+      },
+      relativeTime: {
+        future: {
+          one: "dins {0} segonda",
+          other: "dins {0} segondas",
+        },
+        past: {
+          one: "fa {0} segonda",
+          other: "fa {0} segondas",
+        },
+      },
+    },
+  },
+}];
diff --git a/app/javascript/mastodon/locales/locale-data/README.md b/app/javascript/mastodon/locales/locale-data/README.md
deleted file mode 100644
index 83368fae7..000000000
--- a/app/javascript/mastodon/locales/locale-data/README.md
+++ /dev/null
@@ -1,221 +0,0 @@
-# Custom Locale Data
-
-This folder is used to store custom locale data. These custom locale data are
-not yet provided by [Unicode Common Locale Data Repository](http://cldr.unicode.org/development/new-cldr-developers)
-and hence not provided in [react-intl/locale-data/*](https://github.com/yahoo/react-intl).
-
-The locale data should support [Locale Data APIs](https://github.com/yahoo/react-intl/wiki/API#locale-data-apis)
-of the react-intl library.
-
-It is recommended to start your custom locale data from this sample English
-locale data ([*](#plural-rules)):
-
-```javascript
-/*eslint eqeqeq: "off"*/
-/*eslint no-nested-ternary: "off"*/
-
-export default [
-  {
-    locale: "en",
-    pluralRuleFunction: function(e, a) {
-      var n = String(e).split("."),
-        l = !n[1],
-        o = Number(n[0]) == e,
-        t = o && n[0].slice(-1),
-        r = o && n[0].slice(-2);
-      return a ? 1 == t && 11 != r ? "one" : 2 == t && 12 != r ? "two" : 3 == t && 13 != r ? "few" : "other" : 1 == e && l ? "one" : "other"
-    },
-    fields: {
-      year: {
-        displayName: "year",
-        relative: {
-          0: "this year",
-          1: "next year",
-          "-1": "last year"
-        },
-        relativeTime: {
-          future: {
-            one: "in {0} year",
-            other: "in {0} years"
-          },
-          past: {
-            one: "{0} year ago",
-            other: "{0} years ago"
-          }
-        }
-      },
-      month: {
-        displayName: "month",
-        relative: {
-          0: "this month",
-          1: "next month",
-          "-1": "last month"
-        },
-        relativeTime: {
-          future: {
-            one: "in {0} month",
-            other: "in {0} months"
-          },
-          past: {
-            one: "{0} month ago",
-            other: "{0} months ago"
-          }
-        }
-      },
-      day: {
-        displayName: "day",
-        relative: {
-          0: "today",
-          1: "tomorrow",
-          "-1": "yesterday"
-        },
-        relativeTime: {
-          future: {
-            one: "in {0} day",
-            other: "in {0} days"
-          },
-          past: {
-            one: "{0} day ago",
-            other: "{0} days ago"
-          }
-        }
-      },
-      hour: {
-        displayName: "hour",
-        relativeTime: {
-          future: {
-            one: "in {0} hour",
-            other: "in {0} hours"
-          },
-          past: {
-            one: "{0} hour ago",
-            other: "{0} hours ago"
-          }
-        }
-      },
-      minute: {
-        displayName: "minute",
-        relativeTime: {
-          future: {
-            one: "in {0} minute",
-            other: "in {0} minutes"
-          },
-          past: {
-            one: "{0} minute ago",
-            other: "{0} minutes ago"
-          }
-        }
-      },
-      second: {
-        displayName: "second",
-        relative: {
-          0: "now"
-        },
-        relativeTime: {
-          future: {
-            one: "in {0} second",
-            other: "in {0} seconds"
-          },
-          past: {
-            one: "{0} second ago",
-            other: "{0} seconds ago"
-          }
-        }
-      }
-    }
-  }
-]
-
-```
-
-## Notes
-
-### Plural Rules
-
-The function `pluralRuleFunction()` should return the key to proper string of
-a plural form(s). The purpose of the function is to provide key of translate
-strings of correct plural form according. The different forms are described in
-[CLDR's Plural Rules][cldr-plural-rules],
-
-[cldr-plural-rules]: http://cldr.unicode.org/index/cldr-spec/plural-rules
-
-#### Quick Overview on CLDR Rules
-
-Let's take English as an example.
-
-When you describe a number, you can be either describe it as:
-* Cardinals: 1st, 2nd, 3rd ... 11th, 12th ... 21st, 22nd, 23nd ....
-* Ordinals: 1, 2, 3 ...
-
-In any of these cases, the nouns will reflect the number with singular or plural
-form. For example:
-* in 0 days
-* in 1 day
-* in 2 days
-
-The `pluralRuleFunction` receives 2 parameters:
-* `e`: a string representation of the number. Such as, "`1`", "`2`", "`2.1`".
-* `a`: `true` if this is "cardinal" type of description. `false` for ordinal and other case.
-
-#### How you should write `pluralRuleFunction`
-
-The first rule to write pluralRuleFunction is never translate the output string
-into your language. [Plural Rules][cldr-plural-rules] specified you should use
-these as the return values:
-
-  * "`zero`"
-  * "`one`" (singular)
-  * "`two`" (dual)
-  * "`few`" (paucal)
-  * "`many`" (also used for fractions if they have a separate class)
-  * "`other`" (required—general plural form—also used if the language only has a single form)
-
-Again, we'll use English as the example here.
-
-Let's read the `return` statement in the pluralRuleFunction above:
-```javascript
-  return a ? 1 == t && 11 != r ? "one" : 2 == t && 12 != r ? "two" : 3 == t && 13 != r ? "few" : "other" : 1 == e && l ? "one" : "other"
-```
-
-This nested ternary is hard to read. It basically means:
-```javascript
-// e: the number variable to examine
-// a: "true" if cardinals
-// l: "true" if the variable e has nothin after decimal mark (e.g. "1.0" would be false)
-// o: "true" if the variable e is an integer
-// t: the "ones" of the number. e.g. "3" for number "9123"
-// r: the "ones" and "tens" of the number. e.g. "23" for number "9123"
-if (a == true) {
-  if (t == 1 && r != 11) {
-    return "one"; // i.e. 1st, 21st, 101st, 121st ...
-  } else if (t == 2 && r != 12) {
-    return "two"; // i.e. 2nd, 22nd, 102nd, 122nd ...
-  } else if (t == 3 && r != 13) {
-    return "few"; // i.e. 3rd, 23rd, 103rd, 123rd ...
-  } else {
-    return "other"; // i.e. 4th, 11th, 12th, 24th ...
-  }
-} else {
-  if (e == 1 && l) {
-    return "one"; // i.e. 1 day
-  } else {
-    return "other"; // i.e. 0 days, 2 days, 3 days
-  }
-}
-```
-
-If your language, like French, do not have complicated cardinal rules, you may
-use the French's version of it:
-```javascript
-function (e, a) {
-  return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other";
-}
-```
-
-If your language, like Chinese, do not have any pluralization rule at all you
-may use the Chinese's version of it:
-```javascript
-function (e, a) {
-  return "other";
-}
-```
diff --git a/app/javascript/mastodon/locales/locale-data/oc.js b/app/javascript/mastodon/locales/locale-data/oc.js
deleted file mode 100644
index c4b56350b..000000000
--- a/app/javascript/mastodon/locales/locale-data/oc.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/*eslint eqeqeq: "off"*/
-/*eslint no-nested-ternary: "off"*/
-/*eslint quotes: "off"*/
-
-export default [{
-  locale: "oc",
-  pluralRuleFunction: function (e, a) {
-    return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other";
-  },
-  fields: {
-    year: {
-      displayName: "an",
-      relative: {
-        0: "ongan",
-        1: "l'an que ven",
-        "-1": "l'an passat",
-      },
-      relativeTime: {
-        future: {
-          one: "dins {0} an",
-          other: "dins {0} ans",
-        },
-        past: {
-          one: "fa {0} an",
-          other: "fa {0} ans",
-        },
-      },
-    },
-    month: {
-      displayName: "mes",
-      relative: {
-        0: "aqueste mes",
-        1: "lo mes que ven",
-        "-1": "lo mes passat",
-      },
-      relativeTime: {
-        future: {
-          one: "dins {0} mes",
-          other: "dins {0} meses",
-        },
-        past: {
-          one: "fa {0} mes",
-          other: "fa {0} meses",
-        },
-      },
-    },
-    day: {
-      displayName: "jorn",
-      relative: {
-        0: "uèi",
-        1: "deman",
-        "-1": "ièr",
-      },
-      relativeTime: {
-        future: {
-          one: "dins {0} jorn",
-          other: "dins {0} jorns",
-        },
-        past: {
-          one: "fa {0} jorn",
-          other: "fa {0} jorns",
-        },
-      },
-    },
-    hour: {
-      displayName: "ora",
-      relativeTime: {
-        future: {
-          one: "dins {0} ora",
-          other: "dins {0} oras",
-        },
-        past: {
-          one: "fa {0} ora",
-          other: "fa {0} oras",
-        },
-      },
-    },
-    minute: {
-      displayName: "minuta",
-      relativeTime: {
-        future: {
-          one: "dins {0} minuta",
-          other: "dins {0} minutas",
-        },
-        past: {
-          one: "fa {0} minuta",
-          other: "fa {0} minutas",
-        },
-      },
-    },
-    second: {
-      displayName: "segonda",
-      relative: {
-        0: "ara",
-      },
-      relativeTime: {
-        future: {
-          one: "dins {0} segonda",
-          other: "dins {0} segondas",
-        },
-        past: {
-          one: "fa {0} segonda",
-          other: "fa {0} segondas",
-        },
-      },
-    },
-  },
-}];
diff --git a/app/lib/themes.rb b/app/lib/themes.rb
index 863326e2d..49e9ebbc3 100644
--- a/app/lib/themes.rb
+++ b/app/lib/themes.rb
@@ -15,6 +15,14 @@ class Themes
     Dir.glob(Rails.root.join('app', 'javascript', 'flavours', '*', 'theme.yml')) do |path|
       data = YAML.load_file(path)
       name = File.basename(File.dirname(path))
+      if data['locales']
+        locales = []
+        Dir.glob(File.join(File.dirname(path), data['locales'], '*.{js,json}')) do |locale|
+          localeName = File.basename(locale, File.extname(locale))
+          locales.push(localeName) unless localeName.match(/defaultMessages|whitelist|index/)
+        end
+        data['locales'] = locales
+      end
       if data['pack']
         data['name'] = name
         data['skin'] = { 'default' => [] }
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 99ae7d90d..4d32c5035 100755
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -19,7 +19,10 @@
       = title
 
     = javascript_pack_tag "locales", integrity: true, crossorigin: 'anonymous'
-    = javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
+    - if @theme[:supported_locales].include? I18n.locale.to_s
+      = javascript_pack_tag "locales/#{@theme[:flavour]}/#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
+    - elsif @theme[:supported_locales].include? 'en'
+      = javascript_pack_tag "locales/#{@theme[:flavour]}/en", integrity: true, crossorigin: 'anonymous'
     = csrf_meta_tags
 
     = yield :header_tags
diff --git a/config/webpack/configuration.js b/config/webpack/configuration.js
index 9cdd6f934..852185eb9 100644
--- a/config/webpack/configuration.js
+++ b/config/webpack/configuration.js
@@ -30,6 +30,9 @@ for (let i = 0; i < flavourFiles.length; i++) {
   if (!data.pack_directory) {
     data.pack_directory = dirname(flavourFile);
   }
+  if (data.locales) {
+    data.locales = join(dirname(flavourFile), data.locales);
+  }
   if (data.pack && typeof data.pack === 'object') {
     flavours[data.name] = data;
   }
@@ -45,7 +48,7 @@ for (let i = 0; i < skinFiles.length; i++) {
   const data = flavours[name].skin;
   if (lstatSync(skinFile).isDirectory()) {
     data[skin] = {};
-    const skinPacks = glob.sync(resolve(skinFile, '*.{css,scss}'));
+    const skinPacks = glob.sync(join(skinFile, '*.{css,scss}'));
     for (let j = 0; j < skinPacks.length; j++) {
       const pack = skinPacks[i];
       data[skin][basename(pack, extname(pack))] = pack;
diff --git a/config/webpack/generateLocalePacks.js b/config/webpack/generateLocalePacks.js
index a943589f7..09fba4a18 100644
--- a/config/webpack/generateLocalePacks.js
+++ b/config/webpack/generateLocalePacks.js
@@ -1,70 +1,66 @@
+// A message from upstream:
+// ========================
 // To avoid adding a lot of boilerplate, locale packs are
 // automatically generated here. These are written into the tmp/
 // directory and then used to generate locale_en.js, locale_fr.js, etc.
 
-const fs = require('fs');
-const path = require('path');
+// Glitch note:
+// ============
+// This code has been entirely rewritten to support glitch flavours.
+// However, the underlying process is exactly the same.
+
+const { existsSync, readdirSync, writeFileSync } = require('fs');
+const { join, resolve } = require('path');
 const rimraf = require('rimraf');
 const mkdirp = require('mkdirp');
+const { flavours } = require('./configuration.js');
 
-const localesJsonPath = path.join(__dirname, '../../app/javascript/mastodon/locales');
-const locales = fs.readdirSync(localesJsonPath).filter(filename => {
-  return /\.json$/.test(filename) &&
-    !/defaultMessages/.test(filename) &&
-    !/whitelist/.test(filename);
-}).map(filename => filename.replace(/\.json$/, ''));
-
-const outPath = path.join(__dirname, '../../tmp/packs');
-
-rimraf.sync(outPath);
-mkdirp.sync(outPath);
-
-const outPaths = [];
-
-locales.forEach(locale => {
-  const localePath = path.join(outPath, `locale_${locale}.js`);
-  const baseLocale = locale.split('-')[0]; // e.g. 'zh-TW' -> 'zh'
-  const localeDataPath = [
-    // first try react-intl
-    `../../node_modules/react-intl/locale-data/${baseLocale}.js`,
-    // then check locales/locale-data
-    `../../app/javascript/mastodon/locales/locale-data/${baseLocale}.js`,
-    // fall back to English (this is what react-intl does anyway)
-    '../../node_modules/react-intl/locale-data/en.js',
-  ].filter(filename => fs.existsSync(path.join(outPath, filename)))
-    .map(filename => filename.replace(/..\/..\/node_modules\//, ''))[0];
-
-  let glitchInject = `
-const mergedMessages = messages;
-`;
-
-  const glitchPath = `../../app/javascript/glitch/locales/${locale}.json`;
-  if (fs.existsSync(path.join(outPath, glitchPath))) {
-    glitchInject = `
-import glitchMessages from ${JSON.stringify(glitchPath)};
-
-let mergedMessages = messages;
-Object.keys(glitchMessages).forEach(function (key) {
-   mergedMessages[key] = glitchMessages[key];
-});
-
-`;
+module.exports = Object.keys(flavours).reduce(function (map, entry) {
+  const flavour = flavours[entry];
+  if (!flavour.locales) {
+    return map;
   }
+  const locales = readdirSync(flavour.locales).filter(
+    filename => /\.js(?:on)?$/.test(filename) && !/defaultMessages|whitelist|index/.test(filename)
+  );
+  const outPath = resolve('tmp', 'locales', entry);
+
+  rimraf.sync(outPath);
+  mkdirp.sync(outPath);
 
-  const localeContent = `//
-// locale_${locale}.js
+  locales.forEach(function (locale) {
+    const localeName = locale.replace(/\.js(?:on)?$/, '');
+    const localePath = join(outPath, `${localeName}.js`);
+    const baseLocale = localeName.split('-')[0]; // e.g. 'zh-TW' -> 'zh'
+    const localeDataPath = [
+      // first try react-intl
+      `node_modules/react-intl/locale-data/${baseLocale}.js`,
+      // then check locales/locale-data
+      `app/javascript/locales/locale-data/${baseLocale}.js`,
+      // fall back to English (this is what react-intl does anyway)
+      'node_modules/react-intl/locale-data/en.js',
+    ].filter(
+      filename => existsSync(filename)
+    ).map(
+      filename => filename.replace(/(?:node_modules|app\/javascript)\//, '')
+    )[0];
+    const localeContent = `//
+// locales/${entry}/${localeName}.js
 // automatically generated by generateLocalePacks.js
 //
-import messages from '../../app/javascript/mastodon/locales/${locale}.json';
-import localeData from ${JSON.stringify(localeDataPath)};
-import { setLocale } from 'locales';
-${glitchInject}
-setLocale({messages: mergedMessages, localeData: localeData});
-`;
-  fs.writeFileSync(localePath, localeContent, 'utf8');
-  outPaths.push(localePath);
-});
 
-module.exports = outPaths;
+import messages from '../../../${flavour.locales}/${locale.replace(/\.js$/, '')}';
+import localeData from '${localeDataPath}';
+import { setLocale } from 'locales';
 
+setLocale({
+  localeData,
+  messages,
+});
+`;
+    writeFileSync(localePath, localeContent, 'utf8');
+    map[`locales/${entry}/${localeName}`] = localePath;
+  });
 
+  return map;
+}, {});
diff --git a/config/webpack/shared.js b/config/webpack/shared.js
index e4b057ffb..62d96c3a2 100644
--- a/config/webpack/shared.js
+++ b/config/webpack/shared.js
@@ -7,7 +7,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
 const ManifestPlugin = require('webpack-manifest-plugin');
 const extname = require('path-complete-extname');
 const { env, settings, core, flavours, output, loadersDir } = require('./configuration.js');
-const localePackPaths = require('./generateLocalePacks');
+const localePacks = require('./generateLocalePacks');
 
 function reducePacks (data, into = {}) {
   if (!data.pack) {
@@ -48,11 +48,7 @@ function reducePacks (data, into = {}) {
 module.exports = {
   entry: Object.assign(
     { locales: resolve('app', 'javascript', 'locales') },
-    localePackPaths.reduce((map, entry) => {
-      const localMap = map;
-      localMap[basename(entry, extname(entry, extname(entry)))] = resolve(entry);
-      return localMap;
-    }, {}),
+    localePacks,
     reducePacks(core),
     Object.keys(flavours).reduce((map, entry) => reducePacks(flavours[entry], map), {})
   ),
-- 
cgit 


From 6b7085a33e509e0619a67fa8b6721eb89b785773 Mon Sep 17 00:00:00 2001
From: kibigo! <marrus-sh@users.noreply.github.com>
Date: Thu, 7 Dec 2017 19:59:31 -0800
Subject: Linting fixes

---
 app/javascript/flavours/glitch/locales/en.js | 82 ++++++++++++++--------------
 app/javascript/flavours/glitch/locales/pl.js | 80 +++++++++++++--------------
 config/webpack/shared.js                     |  3 +-
 3 files changed, 82 insertions(+), 83 deletions(-)

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/locales/en.js b/app/javascript/flavours/glitch/locales/en.js
index 96182196e..1d2e0ecf4 100644
--- a/app/javascript/flavours/glitch/locales/en.js
+++ b/app/javascript/flavours/glitch/locales/en.js
@@ -1,50 +1,50 @@
 import inherited from 'mastodon/locales/en.json';
 
 const messages = {
-  "getting_started.open_source_notice": "Glitchsoc is free open source software forked from {Mastodon}. You can contribute or report issues on GitHub at {github}.",
-  "layout.auto": "Auto",
-  "layout.current_is": "Your current layout is:",
-  "layout.desktop": "Desktop",
-  "layout.mobile": "Mobile",
-  "navigation_bar.app_settings": "App settings",
-  "getting_started.onboarding": "Show me around",
-  "onboarding.page_one.federation": "{domain} is an 'instance' of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.",
-  "onboarding.page_one.welcome": "Welcome to {domain}!",
-  "onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}, and is compatible with any Mastodon instance or app. Glitchsoc is entirely free and open-source. You can report bugs, request features, or contribute to the code on {github}.",
-  "settings.auto_collapse": "Automatic collapsing",
-  "settings.auto_collapse_all": "Everything",
-  "settings.auto_collapse_lengthy": "Lengthy toots",
-  "settings.auto_collapse_media": "Toots with media",
-  "settings.auto_collapse_notifications": "Notifications",
-  "settings.auto_collapse_reblogs": "Boosts",
-  "settings.auto_collapse_replies": "Replies",
-  "settings.close": "Close",
-  "settings.collapsed_statuses": "Collapsed toots",
-  "settings.enable_collapsed": "Enable collapsed toots",
-  "settings.general": "General",
-  "settings.image_backgrounds": "Image backgrounds",
-  "settings.image_backgrounds_media": "Preview collapsed toot media",
-  "settings.image_backgrounds_users": "Give collapsed toots an image background",
-  "settings.media": "Media",
-  "settings.media_letterbox": "Letterbox media",
-  "settings.media_fullwidth": "Full-width media previews",
-  "settings.preferences": "User preferences",
-  "settings.wide_view": "Wide view (Desktop mode only)",
-  "settings.navbar_under": "Navbar at the bottom (Mobile only)",
-  "status.collapse": "Collapse",
-  "status.uncollapse": "Uncollapse",
+  'getting_started.open_source_notice': 'Glitchsoc is free open source software forked from {Mastodon}. You can contribute or report issues on GitHub at {github}.',
+  'layout.auto': 'Auto',
+  'layout.current_is': 'Your current layout is:',
+  'layout.desktop': 'Desktop',
+  'layout.mobile': 'Mobile',
+  'navigation_bar.app_settings': 'App settings',
+  'getting_started.onboarding': 'Show me around',
+  'onboarding.page_one.federation': '{domain} is an \'instance\' of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.',
+  'onboarding.page_one.welcome': 'Welcome to {domain}!',
+  'onboarding.page_six.github': '{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}, and is compatible with any Mastodon instance or app. Glitchsoc is entirely free and open-source. You can report bugs, request features, or contribute to the code on {github}.',
+  'settings.auto_collapse': 'Automatic collapsing',
+  'settings.auto_collapse_all': 'Everything',
+  'settings.auto_collapse_lengthy': 'Lengthy toots',
+  'settings.auto_collapse_media': 'Toots with media',
+  'settings.auto_collapse_notifications': 'Notifications',
+  'settings.auto_collapse_reblogs': 'Boosts',
+  'settings.auto_collapse_replies': 'Replies',
+  'settings.close': 'Close',
+  'settings.collapsed_statuses': 'Collapsed toots',
+  'settings.enable_collapsed': 'Enable collapsed toots',
+  'settings.general': 'General',
+  'settings.image_backgrounds': 'Image backgrounds',
+  'settings.image_backgrounds_media': 'Preview collapsed toot media',
+  'settings.image_backgrounds_users': 'Give collapsed toots an image background',
+  'settings.media': 'Media',
+  'settings.media_letterbox': 'Letterbox media',
+  'settings.media_fullwidth': 'Full-width media previews',
+  'settings.preferences': 'User preferences',
+  'settings.wide_view': 'Wide view (Desktop mode only)',
+  'settings.navbar_under': 'Navbar at the bottom (Mobile only)',
+  'status.collapse': 'Collapse',
+  'status.uncollapse': 'Uncollapse',
 
-  "home.column_settings.show_direct": "Show DMs",
+  'home.column_settings.show_direct': 'Show DMs',
 
-  "notification.markForDeletion": "Mark for deletion",
-  "notifications.clear": "Clear all my notifications",
-  "notifications.marked_clear_confirmation": "Are you sure you want to permanently clear all selected notifications?",
-  "notifications.marked_clear": "Clear selected notifications",
+  'notification.markForDeletion': 'Mark for deletion',
+  'notifications.clear': 'Clear all my notifications',
+  'notifications.marked_clear_confirmation': 'Are you sure you want to permanently clear all selected notifications?',
+  'notifications.marked_clear': 'Clear selected notifications',
 
-  "notification_purge.btn_all": "Select\nall",
-  "notification_purge.btn_none": "Select\nnone",
-  "notification_purge.btn_invert": "Invert\nselection",
-  "notification_purge.btn_apply": "Clear\nselected",
+  'notification_purge.btn_all': 'Select\nall',
+  'notification_purge.btn_none': 'Select\nnone',
+  'notification_purge.btn_invert': 'Invert\nselection',
+  'notification_purge.btn_apply': 'Clear\nselected',
 };
 
 export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/flavours/glitch/locales/pl.js b/app/javascript/flavours/glitch/locales/pl.js
index ab96dec60..818436710 100644
--- a/app/javascript/flavours/glitch/locales/pl.js
+++ b/app/javascript/flavours/glitch/locales/pl.js
@@ -1,48 +1,48 @@
 import inherited from 'mastodon/locales/pl.json';
 
 const messages = {
-  "getting_started.open_source_notice": "Glitchsoc jest wolnym i otwartoźródłowym forkiem oprogramowania {Mastodon}. Możesz współtworzyć projekt lub zgłaszać błędy na GitHubie pod adresem {github}.",
-  "layout.auto": "Automatyczny",
-  "layout.current_is": "Twój obecny układ to:",
-  "layout.desktop": "Desktopowy",
-  "layout.mobile": "Mobilny",
-  "navigation_bar.app_settings": "Ustawienia aplikacji",
-  "getting_started.onboarding": "Rozejrzyj się",
-  "onboarding.page_one.federation": "{domain} jest 'instancją' Mastodona. Mastodon to sieć działających niezależnie serwerów tworzących jedną sieć społecznościową. Te serwery nazywane są instancjami.",
-  "onboarding.page_one.welcome": "Witamy na {domain}!",
-  "onboarding.page_six.github": "{domain} jest oparty na Glitchsoc. Glitchsoc jest {forkiem} {Mastodon}a kompatybilnym z każdym klientem i aplikacją Mastodona. Glitchsoc jest całkowicie wolnym i otwartoźródłowym oprogramowaniem. Możesz zgłaszać błędy i sugestie funkcji oraz współtworzyć projekt na {github}.",
-  "settings.auto_collapse": "Automatyczne zwijanie",
-  "settings.auto_collapse_all": "Wszystko",
-  "settings.auto_collapse_lengthy": "Długie wpisy",
-  "settings.auto_collapse_media": "Wpisy z zawartością multimedialną",
-  "settings.auto_collapse_notifications": "Powiadomienia",
-  "settings.auto_collapse_reblogs": "Podbicia",
-  "settings.auto_collapse_replies": "Odpowiedzi",
-  "settings.close": "Zamknij",
-  "settings.collapsed_statuses": "Zwijanie wpisów",
-  "settings.enable_collapsed": "Włącz zwijanie wpisów",
-  "settings.general": "Ogólne",
-  "settings.image_backgrounds": "Obrazy w tle",
-  "settings.image_backgrounds_media": "Wyświetlaj zawartość multimedialną zwiniętych wpisów",
-  "settings.image_backgrounds_users": "Nadaj tło zwiniętym wpisom",
-  "settings.media": "Zawartość multimedialna",
-  "settings.media_letterbox": "Letterbox media",
-  "settings.media_fullwidth": "Podgląd zawartości multimedialnej o pełnej szerokości",
-  "settings.preferences": "Preferencje użyytkownika",
-  "settings.wide_view": "Szeroki widok (tylko w trybie desktopowym)",
-  "settings.navbar_under": "Pasek nawigacji na dole (tylko w trybie mobilnym)",
-  "status.collapse": "Zwiń",
-  "status.uncollapse": "Rozwiń",
+  'getting_started.open_source_notice': 'Glitchsoc jest wolnym i otwartoźródłowym forkiem oprogramowania {Mastodon}. Możesz współtworzyć projekt lub zgłaszać błędy na GitHubie pod adresem {github}.',
+  'layout.auto': 'Automatyczny',
+  'layout.current_is': 'Twój obecny układ to:',
+  'layout.desktop': 'Desktopowy',
+  'layout.mobile': 'Mobilny',
+  'navigation_bar.app_settings': 'Ustawienia aplikacji',
+  'getting_started.onboarding': 'Rozejrzyj się',
+  'onboarding.page_one.federation': '{domain} jest \'instancją\' Mastodona. Mastodon to sieć działających niezależnie serwerów tworzących jedną sieć społecznościową. Te serwery nazywane są instancjami.',
+  'onboarding.page_one.welcome': 'Witamy na {domain}!',
+  'onboarding.page_six.github': '{domain} jest oparty na Glitchsoc. Glitchsoc jest {forkiem} {Mastodon}a kompatybilnym z każdym klientem i aplikacją Mastodona. Glitchsoc jest całkowicie wolnym i otwartoźródłowym oprogramowaniem. Możesz zgłaszać błędy i sugestie funkcji oraz współtworzyć projekt na {github}.',
+  'settings.auto_collapse': 'Automatyczne zwijanie',
+  'settings.auto_collapse_all': 'Wszystko',
+  'settings.auto_collapse_lengthy': 'Długie wpisy',
+  'settings.auto_collapse_media': 'Wpisy z zawartością multimedialną',
+  'settings.auto_collapse_notifications': 'Powiadomienia',
+  'settings.auto_collapse_reblogs': 'Podbicia',
+  'settings.auto_collapse_replies': 'Odpowiedzi',
+  'settings.close': 'Zamknij',
+  'settings.collapsed_statuses': 'Zwijanie wpisów',
+  'settings.enable_collapsed': 'Włącz zwijanie wpisów',
+  'settings.general': 'Ogólne',
+  'settings.image_backgrounds': 'Obrazy w tle',
+  'settings.image_backgrounds_media': 'Wyświetlaj zawartość multimedialną zwiniętych wpisów',
+  'settings.image_backgrounds_users': 'Nadaj tło zwiniętym wpisom',
+  'settings.media': 'Zawartość multimedialna',
+  'settings.media_letterbox': 'Letterbox media',
+  'settings.media_fullwidth': 'Podgląd zawartości multimedialnej o pełnej szerokości',
+  'settings.preferences': 'Preferencje użyytkownika',
+  'settings.wide_view': 'Szeroki widok (tylko w trybie desktopowym)',
+  'settings.navbar_under': 'Pasek nawigacji na dole (tylko w trybie mobilnym)',
+  'status.collapse': 'Zwiń',
+  'status.uncollapse': 'Rozwiń',
 
-  "notification.markForDeletion": "Oznacz do usunięcia",
-  "notifications.clear": "Wyczyść wszystkie powiadomienia",
-  "notifications.marked_clear_confirmation": "Czy na pewno chcesz bezpowrtonie usunąć wszystkie powiadomienia?",
-  "notifications.marked_clear": "Usuń zaznaczone powiadomienia",
+  'notification.markForDeletion': 'Oznacz do usunięcia',
+  'notifications.clear': 'Wyczyść wszystkie powiadomienia',
+  'notifications.marked_clear_confirmation': 'Czy na pewno chcesz bezpowrtonie usunąć wszystkie powiadomienia?',
+  'notifications.marked_clear': 'Usuń zaznaczone powiadomienia',
 
-  "notification_purge.btn_all": "Zaznacz\nwszystkie",
-  "notification_purge.btn_none": "Odznacz\nwszystkie",
-  "notification_purge.btn_invert": "Odwróć\nzaznaczenie",
-  "notification_purge.btn_apply": "Usuń\nzaznaczone"
+  'notification_purge.btn_all': 'Zaznacz\nwszystkie',
+  'notification_purge.btn_none': 'Odznacz\nwszystkie',
+  'notification_purge.btn_invert': 'Odwróć\nzaznaczenie',
+  'notification_purge.btn_apply': 'Usuń\nzaznaczone',
 };
 
 export default Object.assign({}, inherited, messages);
diff --git a/config/webpack/shared.js b/config/webpack/shared.js
index 62d96c3a2..35b9bbd1c 100644
--- a/config/webpack/shared.js
+++ b/config/webpack/shared.js
@@ -1,11 +1,10 @@
 // Note: You must restart bin/webpack-dev-server for changes to take effect
 
 const webpack = require('webpack');
-const { basename, join, resolve } = require('path');
+const { join, resolve } = require('path');
 const { sync } = require('glob');
 const ExtractTextPlugin = require('extract-text-webpack-plugin');
 const ManifestPlugin = require('webpack-manifest-plugin');
-const extname = require('path-complete-extname');
 const { env, settings, core, flavours, output, loadersDir } = require('./configuration.js');
 const localePacks = require('./generateLocalePacks');
 
-- 
cgit 


From cd107e92cb179b875b119ab869e106e22afb2e77 Mon Sep 17 00:00:00 2001
From: kibigo! <marrus-sh@users.noreply.github.com>
Date: Sun, 10 Dec 2017 11:09:59 -0800
Subject: Move ja localization to new locaiton

---
 app/javascript/flavours/glitch/locales/ja.js | 43 ++++++++++++++++++++++++++-
 app/javascript/glitch/locales/ja.json        | 44 ----------------------------
 2 files changed, 42 insertions(+), 45 deletions(-)
 delete mode 100644 app/javascript/glitch/locales/ja.json

(limited to 'app/javascript/flavours/glitch')

diff --git a/app/javascript/flavours/glitch/locales/ja.js b/app/javascript/flavours/glitch/locales/ja.js
index cc7143443..2b55da1da 100644
--- a/app/javascript/flavours/glitch/locales/ja.js
+++ b/app/javascript/flavours/glitch/locales/ja.js
@@ -1,7 +1,48 @@
 import inherited from 'mastodon/locales/ja.json';
 
 const messages = {
-  //  No translations available.
+  'getting_started.open_source_notice': 'Glitchsocは{Mastodon}によるフリーなオープンソースソフトウェアです。誰でもGitHub({github})から開発に參加したり、問題を報告したりできます。',
+  'layout.auto': '自動',
+  'layout.current_is': 'あなたの現在のレイアウト:',
+  'layout.desktop': 'デスクトップ',
+  'layout.mobile': 'モバイル',
+  'navigation_bar.app_settings': 'アプリ設定',
+  'getting_started.onboarding': '解説',
+  'onboarding.page_one.federation': '{domain}はMastodonのインスタンスです。Mastodonとは、独立したサーバが連携して作るソーシャルネットワークです。これらのサーバーをインスタンスと呼びます。',
+  'onboarding.page_one.welcome': '{domain}へようこそ!',
+  'onboarding.page_six.github': '{domain}はGlitchsocを使用しています。Glitchsocは{Mastodon}のフレンドリーな{fork}で、どんなMastodonアプリやインスタンスとも互換性があります。Glitchsocは完全に無料で、オープンソースです。{github}でバグ報告や機能要望あるいは貢獻をすることが可能です。',
+  'settings.auto_collapse': '自動折りたたみ',
+  'settings.auto_collapse_all': 'すべて',
+  'settings.auto_collapse_lengthy': '長いトゥート',
+  'settings.auto_collapse_media': 'メディア付きトゥート',
+  'settings.auto_collapse_notifications': '通知',
+  'settings.auto_collapse_reblogs': 'ブースト',
+  'settings.auto_collapse_replies': '返信',
+  'settings.close': '閉じる',
+  'settings.collapsed_statuses': 'トゥート',
+  'settings.enable_collapsed': 'トゥート折りたたみを有効にする',
+  'settings.general': '一般',
+  'settings.image_backgrounds': '画像背景',
+  'settings.image_backgrounds_media': '折りたまれたメディア付きテゥートをプレビュー',
+  'settings.image_backgrounds_users': '折りたまれたトゥートの背景を変更する',
+  'settings.media': 'メディア',
+  'settings.media_letterbox': 'メディアをレターボックス式で表示',
+  'settings.media_fullwidth': '全幅メディアプリビュー',
+  'settings.preferences': 'ユーザー設定',
+  'settings.wide_view': 'ワイドビュー(デスクトップレイアウトのみ)',
+  'settings.navbar_under': 'ナビを画面下部に移動させる(モバイルレイアウトのみ)',
+  'status.collapse': '折りたたむ',
+  'status.uncollapse': '折りたたみを解除',
+
+  'notification.markForDeletion': '選択',
+  'notifications.clear': '通知を全てクリアする',
+  'notifications.marked_clear_confirmation': '削除した全ての通知を完全に削除してもよろしいですか?',
+  'notifications.marked_clear': '選択した通知を削除する',
+
+  'notification_purge.btn_all': 'すべて\n選択',
+  'notification_purge.btn_none': '選択\n解除',
+  'notification_purge.btn_invert': '選択を\n反転',
+  'notification_purge.btn_apply': '選択したものを\n削除',
 };
 
 export default Object.assign({}, inherited, messages);
diff --git a/app/javascript/glitch/locales/ja.json b/app/javascript/glitch/locales/ja.json
deleted file mode 100644
index 70091268f..000000000
--- a/app/javascript/glitch/locales/ja.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-  "getting_started.open_source_notice": "Glitchsocは{Mastodon}によるフリーなオープンソースソフトウェアです。誰でもGitHub({github})から開発に參加したり、問題を報告したりできます。",
-  "layout.auto": "自動",
-  "layout.current_is": "あなたの現在のレイアウト:",
-  "layout.desktop": "デスクトップ",
-  "layout.mobile": "モバイル",
-  "navigation_bar.app_settings": "アプリ設定",
-  "getting_started.onboarding": "解説",
-  "onboarding.page_one.federation": "{domain}はMastodonのインスタンスです。Mastodonとは、独立したサーバが連携して作るソーシャルネットワークです。これらのサーバーをインスタンスと呼びます。",
-  "onboarding.page_one.welcome": "{domain}へようこそ!",
-  "onboarding.page_six.github": "{domain}はGlitchsocを使用しています。Glitchsocは{Mastodon}のフレンドリーな{fork}で、どんなMastodonアプリやインスタンスとも互換性があります。Glitchsocは完全に無料で、オープンソースです。{github}でバグ報告や機能要望あるいは貢獻をすることが可能です。",
-  "settings.auto_collapse": "自動折りたたみ",
-  "settings.auto_collapse_all": "すべて",
-  "settings.auto_collapse_lengthy": "長いトゥート",
-  "settings.auto_collapse_media": "メディア付きトゥート",
-  "settings.auto_collapse_notifications": "通知",
-  "settings.auto_collapse_reblogs": "ブースト",
-  "settings.auto_collapse_replies": "返信",
-  "settings.close": "閉じる",
-  "settings.collapsed_statuses": "トゥート",
-  "settings.enable_collapsed": "トゥート折りたたみを有効にする",
-  "settings.general": "一般",
-  "settings.image_backgrounds": "画像背景",
-  "settings.image_backgrounds_media": "折りたまれたメディア付きテゥートをプレビュー",
-  "settings.image_backgrounds_users": "折りたまれたトゥートの背景を変更する",
-  "settings.media": "メディア",
-  "settings.media_letterbox": "メディアをレターボックス式で表示",
-  "settings.media_fullwidth": "全幅メディアプリビュー",
-  "settings.preferences": "ユーザー設定",
-  "settings.wide_view": "ワイドビュー(デスクトップレイアウトのみ)",
-  "settings.navbar_under": "ナビを画面下部に移動させる(モバイルレイアウトのみ)",
-  "status.collapse": "折りたたむ",
-  "status.uncollapse": "折りたたみを解除",
-
-  "notification.markForDeletion": "選択",
-  "notifications.clear": "通知を全てクリアする",
-  "notifications.marked_clear_confirmation": "削除した全ての通知を完全に削除してもよろしいですか?",
-  "notifications.marked_clear": "選択した通知を削除する",
-
-  "notification_purge.btn_all": "すべて\n選択",
-  "notification_purge.btn_none": "選択\n解除",
-  "notification_purge.btn_invert": "選択を\n反転",
-  "notification_purge.btn_apply": "選択したものを\n削除"
-}
-- 
cgit