From 24eb45425efc82b55c7412f4b43eae1f49d771ca Mon Sep 17 00:00:00 2001 From: Koala Yeung Date: Wed, 12 Apr 2017 14:50:50 +0800 Subject: Add Traditional Chinese, Hong Kong translation (zh-HK) (#1544) * Added Chinese Traditional Hong Kong (zh-HK) for Ruby * Added translations for Ruby. * Added Chinese Traditional Hong Kong (zh-HK) for JS * Added translations for javascript code. * Rearrange language references in mastodon.jsx * Break `addLocaleData` into multiple lines. Make future commit more readable. * Roughly re-sort the languages in alphabetical orders (only manually put English on top because it is default). * Sort application.rb locale with alphabetical order With exception that English (default language) goes first. Improve code readability. * Resort language selection box alphabetically Sort HUMAN_LOCALES in the alphabetical order of display name (except English, the default language, come first). Improve usability. --- .../javascripts/components/containers/mastodon.jsx | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'app/assets/javascripts/components/containers') diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx index d48bb2ba9..37440da86 100644 --- a/app/assets/javascripts/components/containers/mastodon.jsx +++ b/app/assets/javascripts/components/containers/mastodon.jsx @@ -41,15 +41,17 @@ import Report from '../features/report'; import { IntlProvider, addLocaleData } from 'react-intl'; import en from 'react-intl/locale-data/en'; import de from 'react-intl/locale-data/de'; +import eo from 'react-intl/locale-data/eo'; import es from 'react-intl/locale-data/es'; +import fi from 'react-intl/locale-data/fi'; import fr from 'react-intl/locale-data/fr'; -import pt from 'react-intl/locale-data/pt'; import hu from 'react-intl/locale-data/hu'; -import uk from 'react-intl/locale-data/uk'; -import fi from 'react-intl/locale-data/fi'; -import eo from 'react-intl/locale-data/eo'; -import ru from 'react-intl/locale-data/ru'; import ja from 'react-intl/locale-data/ja'; +import pt from 'react-intl/locale-data/pt'; +import ru from 'react-intl/locale-data/ru'; +import uk from 'react-intl/locale-data/uk'; +import zh from 'react-intl/locale-data/zh'; +import { localeData as zh_hk } from '../locales/zh-hk'; import getMessagesForLocale from '../locales'; import { hydrateStore } from '../actions/store'; @@ -64,7 +66,21 @@ const browserHistory = useRouterHistory(createBrowserHistory)({ }); -addLocaleData([...en, ...de, ...es, ...fr, ...pt, ...hu, ...uk, ...fi, ...eo, ...ru, ...ja]); +addLocaleData([ + ...en, + ...de, + ...eo, + ...es, + ...fi, + ...fr, + ...hu, + ...ja, + ...pt, + ...ru, + ...uk, + ...zh, + ...zh_hk, +]); const Mastodon = React.createClass({ -- cgit