feat: add photo cap per event and Portuguese (pt-BR) locale
- Add photo_cap column to events table (migration 074) to limit photos per event - Enforce photo cap in upload route, returning 400 when limit exceeded - Pass photo_cap through all event CRUD routes and frontend forms - Add complete Portuguese (pt-BR) translation (2300+ strings) - Register pt locale in i18n config, language selector, date formatting - Add photoCap/photoCapHelp translation keys to all locale files (en, de, ru, pt)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { format as dateFnsFormat, formatDistanceToNow as dateFnsFormatDistanceToNow } from 'date-fns';
|
||||
import { de, enUS } from 'date-fns/locale';
|
||||
import { de, enUS, ptBR } from 'date-fns/locale';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { publicSettingsService } from '../services/publicSettings.service';
|
||||
|
||||
@@ -24,7 +24,9 @@ export const useLocalizedDate = () => {
|
||||
});
|
||||
|
||||
const getLocale = () => {
|
||||
return i18n.language === 'de' ? de : enUS;
|
||||
if (i18n.language === 'de') return de;
|
||||
if (i18n.language === 'pt' || i18n.language === 'pt-BR') return ptBR;
|
||||
return enUS;
|
||||
};
|
||||
|
||||
const format = (date: Date | string, formatStr?: string) => {
|
||||
|
||||
Reference in New Issue
Block a user