
- Complete NestJS TypeScript implementation with WebSocket support - Direct messaging (DM) and group chat functionality - End-to-end encryption with AES encryption and key pairs - Media file support (images, videos, audio, documents) up to 100MB - Push notifications with Firebase Cloud Messaging integration - Mention alerts and real-time typing indicators - User authentication with JWT and Passport - SQLite database with TypeORM entities and relationships - Comprehensive API documentation with Swagger/OpenAPI - File upload handling with secure access control - Online/offline status tracking and presence management - Message editing, deletion, and reply functionality - Notification management with automatic cleanup - Health check endpoint for monitoring - CORS configuration for cross-origin requests - Environment-based configuration management - Structured for Flutter SDK integration Features implemented: ✅ Real-time messaging with Socket.IO ✅ User registration and authentication ✅ Direct messages and group chats ✅ Media file uploads and management ✅ End-to-end encryption ✅ Push notifications ✅ Mention alerts ✅ Typing indicators ✅ Message read receipts ✅ Online status tracking ✅ File access control ✅ Comprehensive API documentation Ready for Flutter SDK development and production deployment.
93 lines
2.0 KiB
JavaScript
93 lines
2.0 KiB
JavaScript
// Breton [br]
|
||
import dayjs from '../index';
|
||
|
||
function lastNumber(number) {
|
||
if (number > 9) {
|
||
return lastNumber(number % 10);
|
||
}
|
||
|
||
return number;
|
||
}
|
||
|
||
function softMutation(text) {
|
||
var mutationTable = {
|
||
m: 'v',
|
||
b: 'v',
|
||
d: 'z'
|
||
};
|
||
return mutationTable[text.charAt(0)] + text.substring(1);
|
||
}
|
||
|
||
function mutation(text, number) {
|
||
if (number === 2) {
|
||
return softMutation(text);
|
||
}
|
||
|
||
return text;
|
||
}
|
||
|
||
function relativeTimeWithMutation(number, withoutSuffix, key) {
|
||
var format = {
|
||
mm: 'munutenn',
|
||
MM: 'miz',
|
||
dd: 'devezh'
|
||
};
|
||
return number + " " + mutation(format[key], number);
|
||
}
|
||
|
||
function specialMutationForYears(number) {
|
||
/* istanbul ignore next line */
|
||
switch (lastNumber(number)) {
|
||
case 1:
|
||
case 3:
|
||
case 4:
|
||
case 5:
|
||
case 9:
|
||
return number + " bloaz";
|
||
|
||
default:
|
||
return number + " vloaz";
|
||
}
|
||
}
|
||
|
||
var locale = {
|
||
name: 'br',
|
||
weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
|
||
months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
|
||
weekStart: 1,
|
||
weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
|
||
monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
|
||
weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
|
||
ordinal: function ordinal(n) {
|
||
return n;
|
||
},
|
||
formats: {
|
||
LT: 'h[e]mm A',
|
||
LTS: 'h[e]mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [a viz] MMMM YYYY',
|
||
LLL: 'D [a viz] MMMM YYYY h[e]mm A',
|
||
LLLL: 'dddd, D [a viz] MMMM YYYY h[e]mm A'
|
||
},
|
||
relativeTime: {
|
||
future: 'a-benn %s',
|
||
past: '%s ʼzo',
|
||
s: 'un nebeud segondennoù',
|
||
m: 'ur vunutenn',
|
||
mm: relativeTimeWithMutation,
|
||
h: 'un eur',
|
||
hh: '%d eur',
|
||
d: 'un devezh',
|
||
dd: relativeTimeWithMutation,
|
||
M: 'ur miz',
|
||
MM: relativeTimeWithMutation,
|
||
y: 'ur bloaz',
|
||
yy: specialMutationForYears
|
||
},
|
||
meridiem: function meridiem(hour) {
|
||
return hour < 12 ? 'a.m.' : 'g.m.';
|
||
} // a-raok merenn | goude merenn
|
||
|
||
};
|
||
dayjs.locale(locale, null, true);
|
||
export default locale; |