• Lincoln Nogueira's avatar
    feat: improve i18n support as a whole (#1526) · 557278fa
    Lincoln Nogueira authored
    * feat: improve i18n support as a whole
    
    - Remove dayjs in favor of /helpers/datetime.ts, which uses
    Intl.DateTimeFormat and Date. Dayjs is not exactly i18n friendly
    and has several locale related opened issues.
    
    - Move/refactor date/time code from /helpers/utils.ts to
    /helpers/datetime.ts.
    
    - Fix Daily Review weekday not changing according to selected date.
    
    - Localize Daily review weekday and month.
    
    - Load i18n listed strings from /locales/{locale}.json in a dynamic way.
    This makes much easier to add new locales, by just adding a properly
    named json file and listing it only in /web/src/i18n.ts and
    /api/user_setting.go.
    
    - Fallback languages are now set in /web/src/i18n.ts.
    
    - Full language codes are now preffered, but they fallback to 2-letter
    codes when not available.
    
    - The locale dropdown is now populated dynamically from the available
    locales. Locale names are populated by the browser via
    Intl.DisplayNames(locale).
    
    - /web/src/i18n.ts now exports a type TLocale from availableLocales
    array. This is used only by findNearestLanguageMatch(). As I was unable
    to use this type in ".d.ts" files, I switched the Locale type from
    /web/src/types/i18n.d.ts to string.
    
    - Move pretty much all hardcoded text strings to i18n strings.
    
    - Add pt-BR translation.
    
    - Remove site.ts and move its content to a i18n string.
    
    - Rename zh.json to zh-Hans.json to get the correct language name on
    selector dropdown.
    
    - Remove pt_BR.json and replace with pt-BR.json.
    
    - Some minor layout spacing fixes to accommodate larger texts.
    
    - Improve some error messages.
    
    * Delete .yarnrc.yml
    
    * Delete package-lock.json
    
    * fix: 158:28  error  Insert `⏎`  prettier/prettier
    557278fa
Name
Last commit
Last update
..
Dialog Loading commit data...
Editor Loading commit data...
Settings Loading commit data...
kit Loading commit data...
AboutSiteDialog.tsx Loading commit data...
AppearanceSelect.tsx Loading commit data...
ArchivedMemo.tsx Loading commit data...
ArchivedMemoDialog.tsx Loading commit data...
AskAIDialog.tsx Loading commit data...
BetaBadge.tsx Loading commit data...
ChangeMemberPasswordDialog.tsx Loading commit data...
ChangeMemoCreatedTsDialog.tsx Loading commit data...
ChangePasswordDialog.tsx Loading commit data...
ChangeResourceFilenameDialog.tsx Loading commit data...
CreateIdentityProviderDialog.tsx Loading commit data...
CreateResourceDialog.tsx Loading commit data...
CreateShortcutDialog.tsx Loading commit data...
CreateStorageServiceDialog.tsx Loading commit data...
CreateTagDialog.tsx Loading commit data...
DailyMemo.tsx Loading commit data...
EmbedMemoDialog.tsx Loading commit data...
GitHubBadge.tsx Loading commit data...
Header.tsx Loading commit data...
HomeSidebar.tsx Loading commit data...
Icon.ts Loading commit data...
Image.tsx Loading commit data...
LearnMore.tsx Loading commit data...
LocaleSelect.tsx Loading commit data...
Memo.tsx Loading commit data...
MemoContent.tsx Loading commit data...
MemoEditor.tsx Loading commit data...
MemoFilter.tsx Loading commit data...
MemoList.tsx Loading commit data...
MemoResource.tsx Loading commit data...
MemoResources.tsx Loading commit data...
MobileHeader.tsx Loading commit data...
PreviewImageDialog.tsx Loading commit data...
RequiredBadge.tsx Loading commit data...
ResourceCard.tsx Loading commit data...
ResourceCover.tsx Loading commit data...
ResourceIcon.tsx Loading commit data...
ResourceItem.tsx Loading commit data...
ResourceItemDropdown.tsx Loading commit data...
ResourceSearchBar.tsx Loading commit data...
ResourcesSelectorDialog.tsx Loading commit data...
SearchBar.tsx Loading commit data...
SettingDialog.tsx Loading commit data...
ShareMemoDialog.tsx Loading commit data...
ShortcutList.tsx Loading commit data...
TagList.tsx Loading commit data...
UpdateAccountDialog.tsx Loading commit data...
UpdateCustomizedProfileDialog.tsx Loading commit data...
UpdateLocalStorageDialog.tsx Loading commit data...
UpgradeVersionBanner.tsx Loading commit data...
UsageHeatMap.tsx Loading commit data...
UserAvatar.tsx Loading commit data...
UserBanner.tsx Loading commit data...