Skip to content

Commit

Permalink
Update Korean localization and mark more text for localization
Browse files Browse the repository at this point in the history
  • Loading branch information
quiple committed Dec 28, 2023
1 parent 605cdfb commit d8fb0bd
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/lib/strings/time.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {t} from '@lingui/macro'

const NOW = 5
const MINUTE = 60
const HOUR = MINUTE * 60
Expand All @@ -15,17 +17,17 @@ export function ago(date: number | string | Date): string {
}
const diffSeconds = Math.floor((Date.now() - ts) / 1e3)
if (diffSeconds < NOW) {
return `now`
return t`now`
} else if (diffSeconds < MINUTE) {
return `${diffSeconds}s`
return t`${diffSeconds}s`
} else if (diffSeconds < HOUR) {
return `${Math.floor(diffSeconds / MINUTE)}m`
return t`${Math.floor(diffSeconds / MINUTE)}m`
} else if (diffSeconds < DAY) {
return `${Math.floor(diffSeconds / HOUR)}h`
return t`${Math.floor(diffSeconds / HOUR)}h`
} else if (diffSeconds < MONTH) {
return `${Math.floor(diffSeconds / DAY)}d`
return t`${Math.floor(diffSeconds / DAY)}d`
} else if (diffSeconds < YEAR) {
return `${Math.floor(diffSeconds / MONTH)}mo`
return t`${Math.floor(diffSeconds / MONTH)}mo`
} else {
return new Date(ts).toLocaleDateString()
}
Expand Down
25 changes: 25 additions & 0 deletions src/locale/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ msgstr "{0}"
msgid "{0} {purposeLabel} List"
msgstr "{0} {purposeLabel} Liste"

#: src/lib/strings/time.ts:28
msgid "{0}d"
msgstr ""

#: src/lib/strings/time.ts:26
msgid "{0}h"
msgstr ""

#: src/lib/strings/time.ts:24
msgid "{0}m"
msgstr ""

#: src/lib/strings/time.ts:30
msgid "{0}mo"
msgstr ""

#: src/lib/strings/time.ts:22
msgid "{diffSeconds}s"
msgstr ""

#: src/view/shell/desktop/RightNav.tsx:143
msgid "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
msgstr ""
Expand Down Expand Up @@ -354,6 +374,7 @@ msgstr "Darf nur Buchstaben, Zahlen, Leerzeichen, Bindestriche und Unterstriche
#: src/view/com/modals/ChangeEmail.tsx:220
#: src/view/com/modals/ChangeHandle.tsx:153
#: src/view/com/modals/Confirm.tsx:88
#: src/view/com/modals/Confirm.tsx:91
#: src/view/com/modals/CreateOrEditList.tsx:267
#: src/view/com/modals/CreateOrEditList.tsx:272
#: src/view/com/modals/crop-image/CropImage.web.tsx:137
Expand Down Expand Up @@ -1423,6 +1444,10 @@ msgstr "Hinweis: Bluesky ist ein offenes und öffentliches Netzwerk. Diese Einst
msgid "Notifications"
msgstr "Benachrichtigungen "

#: src/lib/strings/time.ts:20
msgid "now"
msgstr ""

#: src/view/com/util/ErrorBoundary.tsx:34
msgid "Oh no!"
msgstr "Ach nein!"
Expand Down
25 changes: 25 additions & 0 deletions src/locale/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ msgstr ""
msgid "{0} {purposeLabel} List"
msgstr ""

#: src/lib/strings/time.ts:28
msgid "{0}d"
msgstr ""

#: src/lib/strings/time.ts:26
msgid "{0}h"
msgstr ""

#: src/lib/strings/time.ts:24
msgid "{0}m"
msgstr ""

#: src/lib/strings/time.ts:30
msgid "{0}mo"
msgstr ""

#: src/lib/strings/time.ts:22
msgid "{diffSeconds}s"
msgstr ""

#: src/view/shell/desktop/RightNav.tsx:143
msgid "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
msgstr ""
Expand Down Expand Up @@ -382,6 +402,7 @@ msgstr ""
#: src/view/com/modals/ChangeEmail.tsx:220
#: src/view/com/modals/ChangeHandle.tsx:153
#: src/view/com/modals/Confirm.tsx:88
#: src/view/com/modals/Confirm.tsx:91
#: src/view/com/modals/CreateOrEditList.tsx:267
#: src/view/com/modals/CreateOrEditList.tsx:272
#: src/view/com/modals/crop-image/CropImage.web.tsx:137
Expand Down Expand Up @@ -1517,6 +1538,10 @@ msgstr ""
msgid "Notifications"
msgstr ""

#: src/lib/strings/time.ts:20
msgid "now"
msgstr ""

#: src/view/com/util/ErrorBoundary.tsx:34
msgid "Oh no!"
msgstr ""
Expand Down
25 changes: 25 additions & 0 deletions src/locale/locales/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ msgstr "{0}"
msgid "{0} {purposeLabel} List"
msgstr "Lista {purposeLabel} {0}"

#: src/lib/strings/time.ts:28
msgid "{0}d"
msgstr ""

#: src/lib/strings/time.ts:26
msgid "{0}h"
msgstr ""

#: src/lib/strings/time.ts:24
msgid "{0}m"
msgstr ""

#: src/lib/strings/time.ts:30
msgid "{0}mo"
msgstr ""

#: src/lib/strings/time.ts:22
msgid "{diffSeconds}s"
msgstr ""

#: src/view/shell/desktop/RightNav.tsx:143
msgid "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
msgstr ""
Expand Down Expand Up @@ -354,6 +374,7 @@ msgstr "Sólo puede contener letras, números, espacios, guiones y guiones bajos
#: src/view/com/modals/ChangeEmail.tsx:220
#: src/view/com/modals/ChangeHandle.tsx:153
#: src/view/com/modals/Confirm.tsx:88
#: src/view/com/modals/Confirm.tsx:91
#: src/view/com/modals/CreateOrEditList.tsx:267
#: src/view/com/modals/CreateOrEditList.tsx:272
#: src/view/com/modals/crop-image/CropImage.web.tsx:137
Expand Down Expand Up @@ -1423,6 +1444,10 @@ msgstr "Nota: Bluesky es una red abierta y pública. Esta configuración sólo l
msgid "Notifications"
msgstr "Notificaciones"

#: src/lib/strings/time.ts:20
msgid "now"
msgstr ""

#: src/view/com/util/ErrorBoundary.tsx:34
msgid "Oh no!"
msgstr "¡Qué problema!"
Expand Down
25 changes: 25 additions & 0 deletions src/locale/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ msgstr "{0}"
msgid "{0} {purposeLabel} List"
msgstr "{0} {purposeLabel} Liste"

#: src/lib/strings/time.ts:28
msgid "{0}d"
msgstr ""

#: src/lib/strings/time.ts:26
msgid "{0}h"
msgstr ""

#: src/lib/strings/time.ts:24
msgid "{0}m"
msgstr ""

#: src/lib/strings/time.ts:30
msgid "{0}mo"
msgstr ""

#: src/lib/strings/time.ts:22
msgid "{diffSeconds}s"
msgstr ""

#: src/view/shell/desktop/RightNav.tsx:143
msgid "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
msgstr "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
Expand Down Expand Up @@ -354,6 +374,7 @@ msgstr "Ne peut contenir que des lettres, des chiffres, des espaces, des tirets
#: src/view/com/modals/ChangeEmail.tsx:220
#: src/view/com/modals/ChangeHandle.tsx:153
#: src/view/com/modals/Confirm.tsx:88
#: src/view/com/modals/Confirm.tsx:91
#: src/view/com/modals/CreateOrEditList.tsx:267
#: src/view/com/modals/CreateOrEditList.tsx:272
#: src/view/com/modals/crop-image/CropImage.web.tsx:137
Expand Down Expand Up @@ -1423,6 +1444,10 @@ msgstr "Remarque : Bluesky est un réseau ouvert et public. Ce paramètre limit
msgid "Notifications"
msgstr "Notifications"

#: src/lib/strings/time.ts:20
msgid "now"
msgstr ""

#: src/view/com/util/ErrorBoundary.tsx:34
msgid "Oh no!"
msgstr "Oh non !"
Expand Down
25 changes: 25 additions & 0 deletions src/locale/locales/hi/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ msgstr "{0}"
msgid "{0} {purposeLabel} List"
msgstr "{0} {purposeLabel} सूची"

#: src/lib/strings/time.ts:28
msgid "{0}d"
msgstr ""

#: src/lib/strings/time.ts:26
msgid "{0}h"
msgstr ""

#: src/lib/strings/time.ts:24
msgid "{0}m"
msgstr ""

#: src/lib/strings/time.ts:30
msgid "{0}mo"
msgstr ""

#: src/lib/strings/time.ts:22
msgid "{diffSeconds}s"
msgstr ""

#: src/view/shell/desktop/RightNav.tsx:143
msgid "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
msgstr ""
Expand Down Expand Up @@ -382,6 +402,7 @@ msgstr "केवल अक्षर, संख्या, रिक्त स्
#: src/view/com/modals/ChangeEmail.tsx:220
#: src/view/com/modals/ChangeHandle.tsx:153
#: src/view/com/modals/Confirm.tsx:88
#: src/view/com/modals/Confirm.tsx:91
#: src/view/com/modals/CreateOrEditList.tsx:267
#: src/view/com/modals/CreateOrEditList.tsx:272
#: src/view/com/modals/crop-image/CropImage.web.tsx:137
Expand Down Expand Up @@ -1509,6 +1530,10 @@ msgstr ""
msgid "Notifications"
msgstr "सूचनाएं"

#: src/lib/strings/time.ts:20
msgid "now"
msgstr ""

#: src/view/com/util/ErrorBoundary.tsx:34
msgid "Oh no!"
msgstr "अरे नहीं!"
Expand Down
25 changes: 25 additions & 0 deletions src/locale/locales/ja/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ msgstr "{0}"
msgid "{0} {purposeLabel} List"
msgstr "{0} {purposeLabel} リスト"

#: src/lib/strings/time.ts:28
msgid "{0}d"
msgstr ""

#: src/lib/strings/time.ts:26
msgid "{0}h"
msgstr ""

#: src/lib/strings/time.ts:24
msgid "{0}m"
msgstr ""

#: src/lib/strings/time.ts:30
msgid "{0}mo"
msgstr ""

#: src/lib/strings/time.ts:22
msgid "{diffSeconds}s"
msgstr ""

#: src/view/shell/desktop/RightNav.tsx:143
msgid "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
msgstr "{invitesAvailable, plural, other {招待コード: # 個利用可能}}"
Expand Down Expand Up @@ -354,6 +374,7 @@ msgstr "文字、数字、スペース、ハイフン、およびアンダース
#: src/view/com/modals/ChangeEmail.tsx:220
#: src/view/com/modals/ChangeHandle.tsx:153
#: src/view/com/modals/Confirm.tsx:88
#: src/view/com/modals/Confirm.tsx:91
#: src/view/com/modals/CreateOrEditList.tsx:267
#: src/view/com/modals/CreateOrEditList.tsx:272
#: src/view/com/modals/crop-image/CropImage.web.tsx:137
Expand Down Expand Up @@ -1435,6 +1456,10 @@ msgstr "注記:Blueskyはオープンでパブリックなネットワーク
msgid "Notifications"
msgstr "通知"

#: src/lib/strings/time.ts:20
msgid "now"
msgstr ""

#: src/view/com/util/ErrorBoundary.tsx:34
msgid "Oh no!"
msgstr "ちょっと!"
Expand Down
25 changes: 25 additions & 0 deletions src/locale/locales/ko/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ msgstr "{0}"
msgid "{0} {purposeLabel} List"
msgstr "{purposeLabel} 리스트 {0}"

#: src/lib/strings/time.ts:28
msgid "{0}d"
msgstr "{0}일"

#: src/lib/strings/time.ts:26
msgid "{0}h"
msgstr "{0}시간"

#: src/lib/strings/time.ts:24
msgid "{0}m"
msgstr "{0}분"

#: src/lib/strings/time.ts:30
msgid "{0}mo"
msgstr "{0}개월"

#: src/lib/strings/time.ts:22
msgid "{diffSeconds}s"
msgstr "{diffSeconds}초"

#: src/view/shell/desktop/RightNav.tsx:143
msgid "{invitesAvailable, plural, one {Invite codes: # available} other {Invite codes: # available}}"
msgstr "{invitesAvailable, plural, one {초대 코드: #개 사용 가능} other {초대 코드: #개 사용 가능}}"
Expand Down Expand Up @@ -382,6 +402,7 @@ msgstr "글자, 숫자, 공백, 대시, 밑줄만 포함할 수 있습니다.
#: src/view/com/modals/ChangeEmail.tsx:220
#: src/view/com/modals/ChangeHandle.tsx:153
#: src/view/com/modals/Confirm.tsx:88
#: src/view/com/modals/Confirm.tsx:91
#: src/view/com/modals/CreateOrEditList.tsx:267
#: src/view/com/modals/CreateOrEditList.tsx:272
#: src/view/com/modals/crop-image/CropImage.web.tsx:137
Expand Down Expand Up @@ -1517,6 +1538,10 @@ msgstr "참고: Bluesky는 개방형 공개 네트워크입니다. 이 설정은
msgid "Notifications"
msgstr "알림"

#: src/lib/strings/time.ts:20
msgid "now"
msgstr "지금"

#: src/view/com/util/ErrorBoundary.tsx:34
msgid "Oh no!"
msgstr "안 돼!"
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/modals/Confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function Component({
accessibilityLabel={_(msg`Cancel`)}
accessibilityHint="">
<Text type="button-lg" style={pal.textLight}>
{cancelBtnText ?? 'Cancel'}
{cancelBtnText ?? _(msg`Cancel`)}
</Text>
</TouchableOpacity>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/view/screens/ProfileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(

const renderPostsEmpty = useCallback(() => {
return <EmptyState icon="feed" message={_(msg`This feed is empty!`)} />
}, [])
}, [msg])

return (
<View>
Expand Down

0 comments on commit d8fb0bd

Please sign in to comment.