From 8bc59d393252f01768ca90d86cb0ab166df50f0f Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 30 Oct 2022 14:29:43 +0100 Subject: [PATCH] Added zh-Hant --- ios/tooot.xcodeproj/project.pbxproj | 3 +++ ios/zh-Hant.lproj/InfoPlist.strings | 2 ++ src/i18n/i18n.ts | 6 +++++- src/i18n/locales.ts | 3 ++- src/i18n/zh-Hant/_all.ts | 18 ++++++++++++++++++ 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 ios/zh-Hant.lproj/InfoPlist.strings create mode 100644 src/i18n/zh-Hant/_all.ts diff --git a/ios/tooot.xcodeproj/project.pbxproj b/ios/tooot.xcodeproj/project.pbxproj index 413887e6..5ee42bb0 100644 --- a/ios/tooot.xcodeproj/project.pbxproj +++ b/ios/tooot.xcodeproj/project.pbxproj @@ -76,6 +76,7 @@ E633A427281EAEAB000E540F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E633A42F281EAF38000E540F /* ShareViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ShareViewController.swift; path = "../../node_modules/react-native-share-menu/ios/ShareViewController.swift"; sourceTree = ""; }; E633A431281EB55C000E540F /* ShareExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ShareExtension-Bridging-Header.h"; sourceTree = ""; }; + E671BDF8290EAFB800287BD0 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = ""; }; E69EBACA28DF282D0057EDEC /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = ""; }; E69EBACB28DF283A0057EDEC /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = ""; }; E69EBACC28DF28420057EDEC /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -289,6 +290,7 @@ "pt-BR", vi, ja, + "zh-Hant", ); mainGroup = 83CBB9F61A601CBA00E9B192; productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; @@ -514,6 +516,7 @@ E69EBACD28DF284D0057EDEC /* pt-BR */, E69EBACE28DF28560057EDEC /* vi */, E6C8B26628F5F9FC0062CF2E /* ja */, + E671BDF8290EAFB800287BD0 /* zh-Hant */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/ios/zh-Hant.lproj/InfoPlist.strings b/ios/zh-Hant.lproj/InfoPlist.strings new file mode 100644 index 00000000..e9af2b76 --- /dev/null +++ b/ios/zh-Hant.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +"NSPhotoLibraryAddUsageDescription" = "允許tooot保存圖片至相冊"; +"NSPhotoLibraryUsageDescription" = "允許tooot保存圖片至相冊"; diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 1991c2c3..c3fde20c 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -9,6 +9,7 @@ import ko from '@root/i18n/ko/_all' import pt_BR from '@root/i18n/pt_BR/_all' import vi from '@root/i18n/vi/_all' import zh_Hans from '@root/i18n/zh-Hans/_all' +import zh_Hant from '@root/i18n/zh-Hant/_all' import '@formatjs/intl-getcanonicallocales/polyfill' import '@formatjs/intl-locale/polyfill' @@ -32,6 +33,7 @@ import '@formatjs/intl-numberformat/locale-data/ko' import '@formatjs/intl-numberformat/locale-data/pt' import '@formatjs/intl-numberformat/locale-data/vi' import '@formatjs/intl-numberformat/locale-data/zh-Hans' +import '@formatjs/intl-numberformat/locale-data/zh-Hant' import '@formatjs/intl-datetimeformat/polyfill' import '@formatjs/intl-datetimeformat/locale-data/de' @@ -42,6 +44,7 @@ import '@formatjs/intl-datetimeformat/locale-data/ko' import '@formatjs/intl-datetimeformat/locale-data/pt' import '@formatjs/intl-datetimeformat/locale-data/vi' import '@formatjs/intl-datetimeformat/locale-data/zh-Hans' +import '@formatjs/intl-datetimeformat/locale-data/zh-Hant' import '@formatjs/intl-datetimeformat/add-all-tz' import '@formatjs/intl-relativetimeformat/polyfill' @@ -53,6 +56,7 @@ import '@formatjs/intl-relativetimeformat/locale-data/ko' import '@formatjs/intl-relativetimeformat/locale-data/pt' import '@formatjs/intl-relativetimeformat/locale-data/vi' import '@formatjs/intl-relativetimeformat/locale-data/zh-Hans' +import '@formatjs/intl-relativetimeformat/locale-data/zh-Hant' i18n.use(initReactI18next).init({ lng: 'en', @@ -61,7 +65,7 @@ i18n.use(initReactI18next).init({ ns: ['common'], defaultNS: 'common', - resources: { de, en, it, ja, ko, 'pt-BR': pt_BR, vi, 'zh-Hans': zh_Hans }, + resources: { de, en, it, ja, ko, 'pt-BR': pt_BR, vi, 'zh-Hans': zh_Hans, 'zh-Hant': zh_Hant }, returnEmptyString: false, saveMissing: true, diff --git a/src/i18n/locales.ts b/src/i18n/locales.ts index af9769b3..fb48f337 100644 --- a/src/i18n/locales.ts +++ b/src/i18n/locales.ts @@ -6,7 +6,8 @@ const LOCALES = { ko: '한국어', 'pt-BR': 'Português (Brasil)', vi: 'Tiếng Việt', - 'zh-Hans': '简体中文' + 'zh-Hans': '简体中文', + 'zh-Hant': '繁體中文' } export { LOCALES } diff --git a/src/i18n/zh-Hant/_all.ts b/src/i18n/zh-Hant/_all.ts new file mode 100644 index 00000000..5f2a7a82 --- /dev/null +++ b/src/i18n/zh-Hant/_all.ts @@ -0,0 +1,18 @@ +export default { + common: require('./common'), + + screens: require('./screens'), + screenActions: require('./screens/actions'), + screenAnnouncements: require('./screens/announcements'), + screenCompose: require('./screens/compose'), + screenImageViewer: require('./screens/imageViewer'), + screenTabs: require('./screens/tabs'), + + componentContextMenu: require('./components/contextMenu'), + componentEmojis: require('./components/emojis'), + componentInstance: require('./components/instance'), + componentMediaSelector: require('./components/mediaSelector'), + componentParse: require('./components/parse'), + componentRelationship: require('./components/relationship'), + componentTimeline: require('./components/timeline') +}