]> Untitled Git - lemmy.git/blob - ui/src/i18next.ts
Starting to work on internationalization
[lemmy.git] / ui / src / i18next.ts
1 import * as i18next from 'i18next';
2
3 const resources = {
4         en: {
5                 translation: {
6       trending: 'NO',
7       subscribed_to_communities:'Subscribed to <1>communities</1>',
8       create_a_community: 'Create a community',
9
10
11
12
13
14
15       foo: 'foo',
16                         bar: '<1>bar</1>',
17                         baz: '<1>{{count}}</1>',
18                         qux: 'qux<1></1>',
19                         qux_plural: 'quxes<1></1>',
20                         quux: '<1>{{name, uppercase}}</1>',
21                         userMessagesUnread: 'Hello <1>{{name}}</1>, you have {{count}} unread messages. <3>Go to messages</3>.',
22                         userMessagesUnread_plural: 'Hello <1>{{name}}</1>, you have {{count}} unread messages. <3>Go to messages</3>.'
23                 },
24         },
25 };
26
27 function format(value: any, format: any, lng: any) {
28         if (format === 'uppercase') return value.toUpperCase();
29         return value;
30 }
31
32 i18next.init({
33         lng: 'en',
34         resources,
35         interpolation: {
36                 format: format
37         }
38 });
39
40 export { i18next, resources };