Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Brazilian Portuguese - pt-BR by hOurNouns - cherrry picked from… #483

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/nouns-webapp/lingui.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const linguiConfig = {
formatOptions: {
lineNumbers: false,
},
locales: ['en-US', 'ja-JP', 'pseudo'],
locales: ['en-US', 'ja-JP', 'pt-BR','pseudo'],
orderBy: 'messageId',
rootDir: '.',
runtimeConfigModule: ['@lingui/core', 'i18n'],
Expand Down
6 changes: 3 additions & 3 deletions packages/nouns-webapp/public/_redirects
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/discord https://discord.gg/nouns 302

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this on this PR?

/docs https://nouns.notion.site/Explore-Nouns-a2a9dceeb1d54e10b9cbf3f931c2266f 302
/* /index.html 200
/discord https://discord.gg/nGqN2tX3 302
/treasury https://etherscan.io/address/0xC00eA5baA4b7E04C1d7E158E1951B40182fd8F37 302
/* https://nouns.build/dao/0x2c7f07B18c655AfB2D12F469b96313BDebb5E2Ba 200
3 changes: 2 additions & 1 deletion packages/nouns-webapp/src/i18n/NounsI18nProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { i18n } from '@lingui/core';
import { I18nProvider } from '@lingui/react';
import { DEFAULT_LOCALE, SupportedLocale } from './locales';
import { en, ja } from 'make-plural/plurals';
import { en, ja, pt } from 'make-plural/plurals';
import { PluralCategory } from 'make-plural/plurals';
import { ReactNode, useEffect } from 'react';

Expand All @@ -15,6 +15,7 @@ type LocalePlural = {
const plurals: LocalePlural = {
'en-US': en,
'ja-JP': ja,
'pt-BR': pt,
pseudo: en,
};

Expand Down
5 changes: 5 additions & 0 deletions packages/nouns-webapp/src/i18n/locales.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import en, { Locale as DaysJSLocale } from 'dayjs/locale/en';
import ja from 'dayjs/locale/ja';
import pt from 'dayjs/locale/pt-br';

export const SUPPORTED_LOCALES = [
// order as they appear in the language dropdown
'en-US',
'ja-JP',
'pt-BR',
];
export type SupportedLocale = typeof SUPPORTED_LOCALES[number] | 'pseudo';

Expand All @@ -13,17 +15,20 @@ export const DEFAULT_LOCALE: SupportedLocale = 'en-US';
export const LOCALE_LABEL: { [locale in SupportedLocale]: string } = {
'en-US': 'English',
'ja-JP': '日本語',
'pt-BR': 'Português',
pseudo: 'ƥƨèúδô',
};

export enum Locales {
en_US = 'en-US',
ja_JP = 'ja-JP',
pt_BR = 'pt-BR',
}

// Map SupportedLocale string to DaysJS locale object (used for locale aware time formatting)
export const SUPPORTED_LOCALE_TO_DAYSJS_LOCALE: { [locale in SupportedLocale]: DaysJSLocale } = {
'en-US': en,
'ja-JP': ja,
'pt-BR': pt,
pseudo: en,
};