]> Untitled Git - lemmy.git/blob - ui/src/i18next.ts
Main done.
[lemmy.git] / ui / src / i18next.ts
1 import * as i18next from 'i18next';
2
3 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
4 const resources = {
5         en: {
6                 translation: {
7       subscribed_to_communities:'Subscribed to <1>communities</1>',
8       create_a_community: 'Create a community',
9       trending_communities:'Trending <1>communities</1>',
10       edit: 'edit',
11       number_of_users:'{{count}} Users',
12       number_of_posts:'{{count}} Posts',
13       number_of_comments:'{{count}} Comments',
14       modlog: 'Modlog',
15       admins: 'admins',
16       powered_by: 'Powered by',
17       landing_0: 'Lemmy is a <1>link aggregator</1> / reddit alternative, intended to work in the <2>fediverse</2>.<3></3>Its self-hostable, has live-updating comment threads, and is tiny (<4>~80kB</4>). Federation into the ActivityPub network is on the roadmap. <5></5>This is a <6>very early beta version</6>, and a lot of features are currently broken or missing. <7></7>Suggest new features or report bugs <8>here.</8><9></9>Made with <10>Rust</10>, <11>Actix</11>, <12>Inferno</12>, <13>Typescript</13>.',
18
19
20       foo: 'foo',
21                         bar: '<1>bar</1>',
22                         baz: '<1>{{count}}</1>',
23                         qux: 'qux<1></1>',
24                         qux_plural: 'quxes<1></1>',
25                         quux: '<1>{{name, uppercase}}</1>',
26                         userMessagesUnread: 'Hello <1>{{name}}</1>, you have {{count}} unread messages. <3>Go to messages</3>.',
27                         userMessagesUnread_plural: 'Hello <1>{{name}}</1>, you have {{count}} unread messages. <3>Go to messages</3>.'
28                 },
29         },
30 };
31
32 function format(value: any, format: any, lng: any) {
33         if (format === 'uppercase') return value.toUpperCase();
34         return value;
35 }
36
37 i18next.init({
38         lng: 'en',
39         resources,
40         interpolation: {
41                 format: format
42         }
43 });
44
45 export { i18next, resources };